diff options
| author | Dave Chapman <dave@dchapman.com> | 2005-10-06 19:27:43 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2005-10-06 19:27:43 +0000 |
| commit | 9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c (patch) | |
| tree | 1d0bc7970de2cd2f4fa365614f84f12517ad1b5f /apps/codecs | |
| parent | 1c3a83c44e6dd18990d813c2f12e83bab67f313a (diff) | |
| download | rockbox-9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c.zip rockbox-9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c.tar.gz rockbox-9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c.tar.bz2 rockbox-9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c.tar.xz | |
Replace SWAB16 and SWAB32 with a comprehensive set of byte-swap macros - letoh16, letoh32, htole16, htole32, betoh16, betoh32, htobe16 and htobe32
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7584 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/libmusepack/internal.h | 9 | ||||
| -rw-r--r-- | apps/codecs/wav.c | 2 |
2 files changed, 1 insertions, 10 deletions
diff --git a/apps/codecs/libmusepack/internal.h b/apps/codecs/libmusepack/internal.h index a912bfc..27656d5 100644 --- a/apps/codecs/libmusepack/internal.h +++ b/apps/codecs/libmusepack/internal.h @@ -42,15 +42,6 @@ enum { MPC_DECODER_SYNTH_DELAY = 481 }; -/// Big/little endian 32 bit byte swapping routine. -static inline -mpc_uint32_t swap32(mpc_uint32_t val) { - const unsigned char* src = (const unsigned char*)&val; - return - (mpc_uint32_t)src[0] | - ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24); -} - /// Searches for a ID3v2-tag and reads the length (in bytes) of it. /// \param reader supplying raw stream data /// \return size of tag, in bytes diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index 36076ca..2806409 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c @@ -482,7 +482,7 @@ enum codec_status codec_start(struct codec_api* api) else if (bitspersample > 8) { /* Byte-swap data. */ for (i=0;i<n/2;i++) { - int16_samples[i]=(int16_t)SWAB16(wavbuf[i]); + int16_samples[i]=(int16_t)letoh16(wavbuf[i]); } wavbufsize = n; } |