Browse Source

the comment FALLTHROUGH is common for several lint tool

Francois Perrad 9 years ago
parent
commit
9749958fe5
3 changed files with 10 additions and 7 deletions
  1. 3 3
      src/ciphers/multi2.c
  2. 3 0
      src/ciphers/twofish/twofish.c
  3. 4 4
      src/misc/adler32.c

+ 3 - 3
src/ciphers/multi2.c

@@ -96,9 +96,9 @@ static void decrypt(ulong32 *p, int N, ulong32 *uk)
    int n, t;
    for (t = 4*(((N-1)>>2)&1), n = N; ;  ) {
       switch (n<=4 ? n : ((n-1)%4)+1) {
-         case 4: pi4(p, uk+t); --n;
-         case 3: pi3(p, uk+t); --n;
-         case 2: pi2(p, uk+t); --n;
+         case 4: pi4(p, uk+t); --n; /* FALLTHROUGH */
+         case 3: pi3(p, uk+t); --n; /* FALLTHROUGH */
+         case 2: pi2(p, uk+t); --n; /* FALLTHROUGH */
          case 1: pi1(p); --n; break;
          case 0: return;
       }

+ 3 - 0
src/ciphers/twofish/twofish.c

@@ -252,16 +252,19 @@ static void h_func(const unsigned char *in, unsigned char *out, unsigned char *M
             y[1] = (unsigned char)(sbox(0, (ulong32)y[1]) ^ M[4 * (6 + offset) + 1]);
             y[2] = (unsigned char)(sbox(0, (ulong32)y[2]) ^ M[4 * (6 + offset) + 2]);
             y[3] = (unsigned char)(sbox(1, (ulong32)y[3]) ^ M[4 * (6 + offset) + 3]);
+            /* FALLTHROUGH */
      case 3:
             y[0] = (unsigned char)(sbox(1, (ulong32)y[0]) ^ M[4 * (4 + offset) + 0]);
             y[1] = (unsigned char)(sbox(1, (ulong32)y[1]) ^ M[4 * (4 + offset) + 1]);
             y[2] = (unsigned char)(sbox(0, (ulong32)y[2]) ^ M[4 * (4 + offset) + 2]);
             y[3] = (unsigned char)(sbox(0, (ulong32)y[3]) ^ M[4 * (4 + offset) + 3]);
+            /* FALLTHROUGH */
      case 2:
             y[0] = (unsigned char)(sbox(1, sbox(0, sbox(0, (ulong32)y[0]) ^ M[4 * (2 + offset) + 0]) ^ M[4 * (0 + offset) + 0]));
             y[1] = (unsigned char)(sbox(0, sbox(0, sbox(1, (ulong32)y[1]) ^ M[4 * (2 + offset) + 1]) ^ M[4 * (0 + offset) + 1]));
             y[2] = (unsigned char)(sbox(1, sbox(1, sbox(0, (ulong32)y[2]) ^ M[4 * (2 + offset) + 2]) ^ M[4 * (0 + offset) + 2]));
             y[3] = (unsigned char)(sbox(0, sbox(1, sbox(1, (ulong32)y[3]) ^ M[4 * (2 + offset) + 3]) ^ M[4 * (0 + offset) + 3]));
+            /* FALLTHROUGH */
   }
   mds_mult(y, out);
 }

+ 4 - 4
src/misc/adler32.c

@@ -89,16 +89,16 @@ void adler32_finish(adler32_state *ctx, void *hash, unsigned long size)
    switch (size) {
       default:
          h[3] = ctx->s[0] & 0x0ff;
-         /* no break */
+         /* FALLTHROUGH */
       case 3:
          h[2] = (ctx->s[0] >> 8) & 0x0ff;
-         /* no break */
+         /* FALLTHROUGH */
       case 2:
          h[1] = ctx->s[1] & 0x0ff;
-         /* no break */
+         /* FALLTHROUGH */
       case 1:
          h[0] = (ctx->s[1] >> 8) & 0x0ff;
-         /* no break */
+         /* FALLTHROUGH */
       case 0:
          ;
    }