From 9b44fcf6dd6954ebc08928f50ba989356590ecb7 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 19 Mar 2015 16:36:02 +0100 Subject: [PATCH] gmio_core: simplify if statements in gmio_host_endianness() --- src/gmio_core/endian.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gmio_core/endian.c b/src/gmio_core/endian.c index 709afe0..295ef4b 100644 --- a/src/gmio_core/endian.c +++ b/src/gmio_core/endian.c @@ -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; }