mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-05-31 08:31:41 +05:30
fwrite_le.c: reformat
This commit is contained in:
@ -11,15 +11,15 @@ int detect_endianness(void) {
|
||||
volatile uint32_t i = 0x01234567;
|
||||
uint8_t* bytes = (uint8_t*)(&i);
|
||||
if (bytes[0] == 0x01 &&
|
||||
bytes[1] == 0x23 &&
|
||||
bytes[2] == 0x45 &&
|
||||
bytes[3] == 0x67)
|
||||
bytes[1] == 0x23 &&
|
||||
bytes[2] == 0x45 &&
|
||||
bytes[3] == 0x67)
|
||||
return DETECTED_BIG_ENDIAN;
|
||||
else if (
|
||||
bytes[0] == 0x67 &&
|
||||
bytes[1] == 0x45 &&
|
||||
bytes[2] == 0x23 &&
|
||||
bytes[3] == 0x01)
|
||||
bytes[0] == 0x67 &&
|
||||
bytes[1] == 0x45 &&
|
||||
bytes[2] == 0x23 &&
|
||||
bytes[3] == 0x01)
|
||||
return DETECTED_LITTLE_ENDIAN;
|
||||
return UNSUPPORTED_ENDIANNESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user