summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hood <cgull@glup.org>2017-01-31 22:12:27 -0500
committerJohn Hood <cgull@glup.org>2017-01-31 22:12:27 -0500
commita993c8363243f592873762f99c2e1d138a2b17e9 (patch)
treebe05356682cca123d4de40f66c7eab92103e8266
parent86d5b10a2c943eb5cfdbe63562f7394d763ffbc1 (diff)
Handle GCC 7's new -Wimplicit-fallthrough.
-rw-r--r--src/crypto/ocb.cc19
-rw-r--r--src/frontend/terminaloverlay.cc2
2 files changed, 20 insertions, 1 deletions
diff --git a/src/crypto/ocb.cc b/src/crypto/ocb.cc
index 4e97d40..307734f 100644
--- a/src/crypto/ocb.cc
+++ b/src/crypto/ocb.cc
@@ -964,13 +964,20 @@ static void process_ad(ae_ctx *ctx, const void *ad, int ad_len, int final)
switch (k) {
#if (BPI == 8)
case 8: ad_checksum = xor_block(ad_checksum, ta[7]);
+ /* fallthrough */
case 7: ad_checksum = xor_block(ad_checksum, ta[6]);
+ /* fallthrough */
case 6: ad_checksum = xor_block(ad_checksum, ta[5]);
+ /* fallthrough */
case 5: ad_checksum = xor_block(ad_checksum, ta[4]);
+ /* fallthrough */
#endif
case 4: ad_checksum = xor_block(ad_checksum, ta[3]);
+ /* fallthrough */
case 3: ad_checksum = xor_block(ad_checksum, ta[2]);
+ /* fallthrough */
case 2: ad_checksum = xor_block(ad_checksum, ta[1]);
+ /* fallthrough */
case 1: ad_checksum = xor_block(ad_checksum, ta[0]);
}
ctx->ad_checksum = ad_checksum;
@@ -1132,12 +1139,18 @@ int ae_encrypt(ae_ctx * ctx,
switch (k) {
#if (BPI == 8)
case 7: ctp[6] = xor_block(ta[6], oa[6]);
+ /* fallthrough */
case 6: ctp[5] = xor_block(ta[5], oa[5]);
+ /* fallthrough */
case 5: ctp[4] = xor_block(ta[4], oa[4]);
+ /* fallthrough */
case 4: ctp[3] = xor_block(ta[3], oa[3]);
+ /* fallthrough */
#endif
case 3: ctp[2] = xor_block(ta[2], oa[2]);
+ /* fallthrough */
case 2: ctp[1] = xor_block(ta[1], oa[1]);
+ /* fallthrough */
case 1: ctp[0] = xor_block(ta[0], oa[0]);
}
@@ -1336,17 +1349,23 @@ int ae_decrypt(ae_ctx *ctx,
#if (BPI == 8)
case 7: ptp[6] = xor_block(ta[6], oa[6]);
checksum = xor_block(checksum, ptp[6]);
+ /* fallthrough */
case 6: ptp[5] = xor_block(ta[5], oa[5]);
checksum = xor_block(checksum, ptp[5]);
+ /* fallthrough */
case 5: ptp[4] = xor_block(ta[4], oa[4]);
checksum = xor_block(checksum, ptp[4]);
+ /* fallthrough */
case 4: ptp[3] = xor_block(ta[3], oa[3]);
checksum = xor_block(checksum, ptp[3]);
+ /* fallthrough */
#endif
case 3: ptp[2] = xor_block(ta[2], oa[2]);
checksum = xor_block(checksum, ptp[2]);
+ /* fallthrough */
case 2: ptp[1] = xor_block(ta[1], oa[1]);
checksum = xor_block(checksum, ptp[1]);
+ /* fallthrough */
case 1: ptp[0] = xor_block(ta[0], oa[0]);
checksum = xor_block(checksum, ptp[0]);
}
diff --git a/src/frontend/terminaloverlay.cc b/src/frontend/terminaloverlay.cc
index f550716..26d81cb 100644
--- a/src/frontend/terminaloverlay.cc
+++ b/src/frontend/terminaloverlay.cc
@@ -568,7 +568,7 @@ void PredictionEngine::cull( const Framebuffer &fb )
}
}
- /* no break */
+ /* fallthrough */
case CorrectNoCredit:
j->reset();