gmio_core: simplify if statements in gmio_host_endianness()
This commit is contained in:
parent
39c3692d21
commit
9b44fcf6dd
@ -32,11 +32,10 @@ gmio_endianness_t gmio_host_endianness()
|
|||||||
conv.integer = 0x01020408;
|
conv.integer = 0x01020408;
|
||||||
if (conv.bytes[0] == 0x08 && conv.bytes[3] == 0x01)
|
if (conv.bytes[0] == 0x08 && conv.bytes[3] == 0x01)
|
||||||
return GMIO_LITTLE_ENDIAN;
|
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;
|
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;
|
return GMIO_MIDDLE_ENDIAN;
|
||||||
else
|
|
||||||
return GMIO_OTHER_ENDIAN;
|
return GMIO_OTHER_ENDIAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user