loader:Fix build warnings
authorTobin Ehlis <tobine@google.com>
Tue, 17 Apr 2018 16:05:20 +0000 (10:05 -0600)
committerTobin Ehlis <tobine@google.com>
Wed, 18 Apr 2018 12:25:36 +0000 (06:25 -0600)
Add "fall through" comments on intentional fall through switch cases to
avoid compiler warnings.

loader/cJSON.c
loader/murmurhash.c

index a7671c4..8da6d83 100644 (file)
@@ -312,12 +312,15 @@ static const char *parse_string(cJSON *item, const char *str) {
                         case 4:
                             *--ptr2 = ((uc | 0x80) & 0xBF);
                             uc >>= 6;
+                            // fall through
                         case 3:
                             *--ptr2 = ((uc | 0x80) & 0xBF);
                             uc >>= 6;
+                            // fall through
                         case 2:
                             *--ptr2 = ((uc | 0x80) & 0xBF);
                             uc >>= 6;
+                            // fall through
                         case 1:
                             *--ptr2 = ((unsigned char)uc | firstByteMark[len]);
                     }
index db6276f..40f0d5e 100644 (file)
@@ -74,9 +74,10 @@ uint32_t murmurhash(const char *key, size_t len, uint32_t seed) {
     switch (len & 3) {  // `len % 4'
         case 3:
             k ^= (tail[2] << 16);
+            // fall through
         case 2:
             k ^= (tail[1] << 8);
-
+            // fall through
         case 1:
             k ^= tail[0];
             k *= c1;