Little Endian vs Big Endian
Big Endian = 0x31014950
Little Endian = 0x50490131
However Using this Method
inline unsigned int endian
Have you unit-tested your code?
On my platform, this passes:
void LittleEndianTest::testLittleEndian()
{
unsigned int x = 0x31014950;
unsigned int result =
(
( (x & 0x000000FF) << 24 ) +
( (x & 0x0000FF00) << 8 ) +
( (x & 0x00FF0000) >> 8 ) +
( (x & 0xFF000000) >> 24 )
);
CPPUNIT_ASSERT_EQUAL((unsigned int)0x50490131, result);
}