fix: add fallthrough annotations (-Wimplicit-fallthrough)
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 24 Mar 2021 23:28:52 +0000 (19:28 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Mar 2021 18:04:06 +0000 (14:04 -0400)
Change-Id: I7d6c1197d6ff126f2c6fe6fb6ad8a0f575fc661d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/jhash.h
liblttng-ust/lttng-bytecode-interpreter.c
liblttng-ust/lttng-hash-helper.h
liblttng-ust/string-utils.c

index 91993e8bf64ea6d5c6a45ae210a4bd1f4145b3ad..bd34cc5940d4a5a3b00b439ee653a82f87dd01a4 100644 (file)
@@ -196,17 +196,17 @@ uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
 
                /*-------------------------------- last block: affect all 32 bits of (c) */
                switch (length) {                /* all the case statements fall through */
-               case 12: c+=((uint32_t) k[11])<<24;
-               case 11: c+=((uint32_t) k[10])<<16;
-               case 10: c+=((uint32_t) k[9])<<8;
-               case 9 : c+=k[8];
-               case 8 : b+=((uint32_t) k[7])<<24;
-               case 7 : b+=((uint32_t) k[6])<<16;
-               case 6 : b+=((uint32_t) k[5])<<8;
-               case 5 : b+=k[4];
-               case 4 : a+=((uint32_t) k[3])<<24;
-               case 3 : a+=((uint32_t) k[2])<<16;
-               case 2 : a+=((uint32_t) k[1])<<8;
+               case 12: c+=((uint32_t) k[11])<<24;     /* fall through */
+               case 11: c+=((uint32_t) k[10])<<16;     /* fall through */
+               case 10: c+=((uint32_t) k[9])<<8;       /* fall through */
+               case 9 : c+=k[8];                       /* fall through */
+               case 8 : b+=((uint32_t) k[7])<<24;      /* fall through */
+               case 7 : b+=((uint32_t) k[6])<<16;      /* fall through */
+               case 6 : b+=((uint32_t) k[5])<<8;       /* fall through */
+               case 5 : b+=k[4];                       /* fall through */
+               case 4 : a+=((uint32_t) k[3])<<24;      /* fall through */
+               case 3 : a+=((uint32_t) k[2])<<16;      /* fall through */
+               case 2 : a+=((uint32_t) k[1])<<8;       /* fall through */
                case 1 : a+=k[0];
                         break;
                case 0 : return c;
index a384d61f068c92d2d2e4d0b54eb42ddc42f4fe36..4ca1338a1b431519d6a6b1c90f655528981f8a34 100644 (file)
@@ -2098,7 +2098,7 @@ int lttng_bytecode_interpret(struct lttng_ust_bytecode_runtime *ust_bytecode,
                                JUMP_TO(BYTECODE_OP_CAST_DOUBLE_TO_S64);
                        case REG_U64:
                                estack_ax_t = REG_S64;
-                               next_pc += sizeof(struct cast_op);
+                               next_pc += sizeof(struct cast_op); /* Fall-through */
                        case REG_STRING: /* Fall-through */
                        case REG_STAR_GLOB_STRING:
                                ret = -EINVAL;
index 6c8008a06fcf7fb1426ca85b13f5986fab62e52d..1978fbde6f55de4f39db5e628377ad563bf3e2f8 100644 (file)
@@ -102,10 +102,10 @@ void lttng_hashword2(
 
        /*----------------------------------- handle the last 3 uint32_t's */
        switch (length) {       /* all the case statements fall through */
-       case 3: c += k[2];
-       case 2: b += k[1];
+       case 3: c += k[2];      /* fall through */
+       case 2: b += k[1];      /* fall through */
        case 1: a += k[0];
-               final(a, b, c);
+               final(a, b, c); /* fall through */
        case 0:                 /* case 0: nothing left to add */
                break;
        }
index bf8b78e5f43577efb05c4930e89db119cf901442..dea2ae3bc239453d0728022b2ea38c8a6397c59a 100644 (file)
@@ -271,7 +271,7 @@ retry:
                        goto retry;
                case '\\':
                        /* Go to escaped character. */
-                       p++;
+                       p++;    /* Fallthrough */
 
                        /*
                         * Fall through the default case which will
This page took 0.03124 seconds and 4 git commands to generate.