From a07a89a421e1caaeb8b7be0108a20826024cc0fd Mon Sep 17 00:00:00 2001 From: Saleem Rashid Date: Mon, 5 Jun 2017 18:14:43 +0100 Subject: [PATCH] GCC 7.1.1 -Wimplicit-fallthrough comments Use //-fallthrough rather than __attribute__((fallthrough)) --- aes/aescrypt.c | 6 ++++++ base58.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/aes/aescrypt.c b/aes/aescrypt.c index 83c77f0b66..8c7c7f24cf 100644 --- a/aes/aescrypt.c +++ b/aes/aescrypt.c @@ -115,10 +115,12 @@ AES_RETURN aes_xi(encrypt)(const unsigned char *in, unsigned char *out, const ae round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS); kp += 2 * N_COLS; + //-fallthrough case 12 * 16: round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS); kp += 2 * N_COLS; + //-fallthrough case 10 * 16: round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS); @@ -130,6 +132,7 @@ AES_RETURN aes_xi(encrypt)(const unsigned char *in, unsigned char *out, const ae round(fwd_rnd, b0, b1, kp + 8 * N_COLS); round(fwd_rnd, b1, b0, kp + 9 * N_COLS); round(fwd_lrnd, b0, b1, kp +10 * N_COLS); + //-fallthrough } #else @@ -247,9 +250,11 @@ AES_RETURN aes_xi(decrypt)(const unsigned char *in, unsigned char *out, const ae case 14 * 16: round(inv_rnd, b1, b0, rnd_key(-13)); round(inv_rnd, b0, b1, rnd_key(-12)); + //-fallthrough case 12 * 16: round(inv_rnd, b1, b0, rnd_key(-11)); round(inv_rnd, b0, b1, rnd_key(-10)); + //-fallthrough case 10 * 16: round(inv_rnd, b1, b0, rnd_key(-9)); round(inv_rnd, b0, b1, rnd_key(-8)); @@ -261,6 +266,7 @@ AES_RETURN aes_xi(decrypt)(const unsigned char *in, unsigned char *out, const ae round(inv_rnd, b0, b1, rnd_key(-2)); round(inv_rnd, b1, b0, rnd_key(-1)); round(inv_lrnd, b0, b1, rnd_key( 0)); + //-fallthrough } #else diff --git a/base58.c b/base58.c index 2c44d39853..0c26943cad 100644 --- a/base58.c +++ b/base58.c @@ -90,11 +90,14 @@ bool b58tobin(void *bin, size_t *binszp, const char *b58) switch (bytesleft) { case 3: *(binu++) = (outi[0] & 0xff0000) >> 16; + //-fallthrough case 2: *(binu++) = (outi[0] & 0xff00) >> 8; + //-fallthrough case 1: *(binu++) = (outi[0] & 0xff); ++j; + //-fallthrough default: break; }