From 9e19c95d8efc78a22a32b4a77f9c4a0b4e64125c Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 6 Oct 2005 19:27:43 +0000 Subject: 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 --- apps/codecs/libmusepack/internal.h | 9 --------- apps/codecs/wav.c | 2 +- apps/metadata.c | 4 ++-- apps/plugins/midi/guspat.c | 7 +++---- 4 files changed, 6 insertions(+), 16 deletions(-) (limited to 'apps') diff --git a/apps/codecs/libmusepack/internal.h b/apps/codecs/libmusepack/internal.h index a912bfc0ab..27656d5a54 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 36076caf25..2806409dd5 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;inumSamples; a++) { - ((unsigned short *) wav->data)[a] = SWAB16(((unsigned short *) wav->data)[a]); + ((unsigned short *) wav->data)[a] = letoh16(((unsigned short *) wav->data)[a]); } #endif -- cgit v1.2.3