1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2005-10-06 19:27:43 +00:00
parent 1c3a83c44e
commit 9e19c95d8e
8 changed files with 89 additions and 60 deletions

View file

@ -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