lib/gis/endian.c uses:
int G_is_little_endian (void)
{
union
{
int testWord;
char testByte[4];
} endianTest;
int swapFlag;
endianTest.testWord = 1;
if (endianTest.testByte[0] == 1)
{
swapFlag = 1; /*true: little endian */
}
else
{
swapFlag = 0; /* false: big endian */
}
return swapFlag;
}
should that be:
- char testByte[4];
+ char testByte[sizeof(int)];
??
Hamish