[njs] Fixed building by GCC 7 with -Wimplicit-fallthrough.

Sergey Kandaurov pluknet at nginx.com
Thu Aug 24 13:21:09 UTC 2017


details:   http://hg.nginx.org/njs/rev/746c49e6c195
branches:  
changeset: 399:746c49e6c195
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Thu Aug 24 16:16:37 2017 +0300
description:
Fixed building by GCC 7 with -Wimplicit-fallthrough.

diffstat:

 nxt/nxt_murmur_hash.c       |  2 ++
 nxt/test/lvlhsh_unit_test.c |  1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 4b11d945ce7d -r 746c49e6c195 nxt/nxt_murmur_hash.c
--- a/nxt/nxt_murmur_hash.c	Fri Aug 18 18:40:39 2017 +0300
+++ b/nxt/nxt_murmur_hash.c	Thu Aug 24 16:16:37 2017 +0300
@@ -40,8 +40,10 @@ nxt_murmur_hash2(const void *data, size_
     switch (len) {
     case 3:
         h ^= p[2] << 16;
+        /* Fall through. */
     case 2:
         h ^= p[1] << 8;
+        /* Fall through. */
     case 1:
         h ^= p[0];
         h *= m;
diff -r 4b11d945ce7d -r 746c49e6c195 nxt/test/lvlhsh_unit_test.c
--- a/nxt/test/lvlhsh_unit_test.c	Fri Aug 18 18:40:39 2017 +0300
+++ b/nxt/test/lvlhsh_unit_test.c	Thu Aug 24 16:16:37 2017 +0300
@@ -74,6 +74,7 @@ lvlhsh_unit_test_add(nxt_lvlhsh_t *lh, c
     case NXT_DECLINED:
         printf("lvlhsh unit test failed: key %08lX is already in hash\n",
                (long) key);
+        /* Fall through. */
 
     default:
         return NXT_ERROR;


More information about the nginx-devel mailing list