From 0e8a1ef784c023e9a9e26132736b5b5b4e450a60 Mon Sep 17 00:00:00 2001 From: SODA Noriyuki Date: Fri, 30 Jun 2017 01:16:49 +0900 Subject: use #elif to make the nesting level of #if-#endif shallower --- lib/sha1.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/lib/sha1.c b/lib/sha1.c index 1e7e307..260a3f1 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -54,9 +54,8 @@ #define SHA1DC_BIGENDIAN #endif -#else /* Not under GCC-alike */ - -#if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) +/* Not under GCC-alike */ +#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) /* * Should detect Big Endian under glibc.git since 14245eb70e ("entered * into RCS", 1992-11-25). Defined in which will have been @@ -67,11 +66,10 @@ #define SHA1DC_BIGENDIAN #endif -#else /* Not under GCC-alike or glibc */ - -#if (defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ - defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \ - defined(__sparc)) +/* Not under GCC-alike or glibc */ +#elif (defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ + defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \ + defined(__sparc)) /* * Should define Big Endian for a whitelist of known processors. See * https://sourceforge.net/p/predef/wiki/Endianness/ and @@ -79,9 +77,8 @@ */ #define SHA1DC_BIGENDIAN -#else /* Not under GCC-alike or glibc or */ - -#if defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR) +/* Not under GCC-alike or glibc or */ +#elif defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR) /* * As a last resort before we do anything else we're not 100% sure * about below, we blacklist specific processors here. We could add @@ -92,10 +89,7 @@ /* We do nothing more here for now */ /*#error "Uncomment this to see if you fall through all the detection"*/ -#endif /* !SHA1DC_ON_INTEL_LIKE_PROCESSOR */ -#endif /* Big Endian under whitelist of processors */ -#endif /* Big Endian under glibc */ -#endif /* Big Endian under GCC-alike */ +#endif /* Big Endian detection */ #if (defined(SHA1DC_FORCE_LITTLEENDIAN) && defined(SHA1DC_BIGENDIAN)) #undef SHA1DC_BIGENDIAN -- cgit v1.2.3