gmio_core: simplify if statements in gmio_host_endianness()

This commit is contained in:
Hugues Delorme 2015-03-19 16:36:02 +01:00
parent 39c3692d21
commit 9b44fcf6dd

View File

@ -32,11 +32,10 @@ gmio_endianness_t gmio_host_endianness()
conv.integer = 0x01020408;
if (conv.bytes[0] == 0x08 && conv.bytes[3] == 0x01)
return GMIO_LITTLE_ENDIAN;
else if (conv.bytes[0] == 0x01 && conv.bytes[3] == 0x08)
if (conv.bytes[0] == 0x01 && conv.bytes[3] == 0x08)
return GMIO_BIG_ENDIAN;
else if (conv.bytes[1] == 0x08 && conv.bytes[2] == 0x01)
if (conv.bytes[1] == 0x08 && conv.bytes[2] == 0x01)
return GMIO_MIDDLE_ENDIAN;
else
return GMIO_OTHER_ENDIAN;
return GMIO_OTHER_ENDIAN;
}