Fix big-endian compile (nw)

This commit is contained in:
R. Belmont 2012-03-04 04:13:50 +00:00
parent 92d4f9d76a
commit 9358a319fa
2 changed files with 4 additions and 1 deletions

View File

@ -143,11 +143,13 @@ struct FLAC__BitReader {
};
#ifdef LSB_FIRST
static FLAC__uint32 local_swap32_(FLAC__uint32 x)
{
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
return (x>>16) | (x<<16);
}
#endif
#if defined(_MSC_VER) && defined(_M_IX86)
/* OPT: an MSVC built-in would be better */

View File

@ -112,12 +112,13 @@ struct FLAC__BitWriter {
/* OPT: an MSVC built-in would be better */
#ifdef LSB_FIRST
static FLAC__uint32 local_swap32_(FLAC__uint32 x)
{
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
return (x>>16) | (x<<16);
}
#endif
/* * WATCHOUT: The current implementation only grows the buffer. */
static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add)