Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSODA Noriyuki <soda@NetBSD.org>2017-06-29 19:16:49 +0300
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-07-01 09:44:36 +0300
commit0e8a1ef784c023e9a9e26132736b5b5b4e450a60 (patch)
tree74a56ff28e7b85d2e1f2b3de14370344067bcda1
parent3f14d1bbe2724610f25befff15c4899903182428 (diff)
use #elif to make the nesting level of #if-#endif shallower
-rw-r--r--lib/sha1.c24
1 files 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 <endian.h> 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 <processor whitelist> */
-
-#if defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR)
+/* Not under GCC-alike or glibc or <processor whitelist> */
+#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