diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2008-10-25 15:28:50 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2008-10-25 15:28:50 +0200 |
commit | 5dd5ce54267d6d29704b05e23f05d2e3bcfc9c30 (patch) | |
tree | 0c0b90cb49d0fa60ccb17cff1e0fb814b79d9bdd /libpiano | |
parent | 56b1686b8c27a0b01d0ae3f50615974d03574947 (diff) | |
download | pianobar-5dd5ce54267d6d29704b05e23f05d2e3bcfc9c30.tar.gz pianobar-5dd5ce54267d6d29704b05e23f05d2e3bcfc9c30.tar.bz2 pianobar-5dd5ce54267d6d29704b05e23f05d2e3bcfc9c30.zip |
Use own byteswap implementation
pianobar can be compiled on NetBSD (and maybe others) now.
Diffstat (limited to 'libpiano')
-rw-r--r-- | libpiano/src/crypt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpiano/src/crypt.c b/libpiano/src/crypt.c index 7e2bb80..475a1ce 100644 --- a/libpiano/src/crypt.c +++ b/libpiano/src/crypt.c @@ -23,12 +23,14 @@ THE SOFTWARE. #include <string.h> #include <stdio.h> #include <stdlib.h> -#include <byteswap.h> #include "crypt_key_output.h" #include "crypt_key_input.h" #include "main.h" +#define byteswap32(x) (((x >> 24) & 0x000000ff) | ((x >> 8) & 0x0000ff00) | \ + ((x << 8) & 0x00ff0000) | ((x << 24) & 0xff000000)) + /* hex string to array of unsigned int values * @param hex string * @param return array @@ -103,7 +105,7 @@ char *PianoIntsToString (const unsigned int *arrInts, size_t arrIntsN) { /* map string to 4-byte int */ tmp = (unsigned int *) &strDecoded[i*4]; /* FIXME: big endian does not need to byteswap */ - *tmp = bswap_32 (arrInts[i]); + *tmp = byteswap32 (arrInts[i]); } return strDecoded; } |