Commit 150da2b0 authored by Kenton Varda's avatar Kenton Varda

Adjust fallthrough comments to satisfy GCC7's -Wimplicit-fallthrough.

If we were using C++17, we could use [[fallthrough]] instead... but we are not.
parent b299dcd7
......@@ -520,8 +520,7 @@ kj::Maybe<Compiler::Node::Content&> Compiler::Node::getContent(Content::State mi
}
content.advanceState(Content::EXPANDED);
// no break
}
} // fallthrough
case Content::EXPANDED: {
if (minimumState <= Content::EXPANDED) break;
......@@ -584,8 +583,7 @@ kj::Maybe<Compiler::Node::Content&> Compiler::Node::getContent(Content::State mi
}));
content.advanceState(Content::BOOTSTRAP);
// no break
}
} // fallthrough
case Content::BOOTSTRAP: {
if (minimumState <= Content::BOOTSTRAP) break;
......@@ -597,8 +595,7 @@ kj::Maybe<Compiler::Node::Content&> Compiler::Node::getContent(Content::State mi
content.sourceInfo = kj::mv(nodeSet.sourceInfo);
content.advanceState(Content::FINISHED);
// no break
}
} // fallthrough
case Content::FINISHED:
break;
......
......@@ -997,7 +997,7 @@ bool NodeTranslator::BrandedDecl::compileAsType(
addError(errorReporter,
"As of Cap'n Proto 0.4, 'Object' has been renamed to 'AnyPointer'. Sorry for the "
"inconvenience, and thanks for being an early adopter. :)");
// no break
// fallthrough
case Declaration::BUILTIN_ANY_POINTER:
target.initAnyPointer().initUnconstrained().setAnyKind();
return true;
......@@ -2741,8 +2741,7 @@ kj::Maybe<Orphan<DynamicValue>> ValueTranslator::compileValue(Expression::Reader
return kj::mv(result);
}
// No break -- value is positive, so we can just go on to the uint case below.
}
} // fallthrough -- value is positive, so we can just go on to the uint case below.
case DynamicValue::UINT: {
uint64_t maxValue = 0;
......
......@@ -740,6 +740,7 @@ DynamicValue::Builder DynamicStruct::Builder::init(StructSchema::Field field, ui
(uint)type.which());
break;
}
KJ_UNREACHABLE;
}
case schema::Field::GROUP:
......
......@@ -728,6 +728,7 @@ int base64_encode_block(const char* plaintext_in, int length_in,
result = (fragment & 0x0fc) >> 2;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x003) << 4;
// fallthrough
case step_B:
if (plainchar == plaintextend) {
state_in->result = result;
......@@ -738,6 +739,7 @@ int base64_encode_block(const char* plaintext_in, int length_in,
result |= (fragment & 0x0f0) >> 4;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x00f) << 2;
// fallthrough
case step_C:
if (plainchar == plaintextend) {
state_in->result = result;
......@@ -907,6 +909,7 @@ int base64_decode_block(const char* code_in, const int length_in,
ERROR_IF(fragment < -1);
} while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
// fallthrough
case step_b:
do {
if (codechar == code_in+length_in) {
......@@ -924,6 +927,7 @@ int base64_decode_block(const char* code_in, const int length_in,
} while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
// fallthrough
case step_c:
do {
if (codechar == code_in+length_in) {
......@@ -943,6 +947,7 @@ int base64_decode_block(const char* code_in, const int length_in,
ERROR_IF(state_in->nPaddingBytesSeen > 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
// fallthrough
case step_d:
do {
if (codechar == code_in+length_in) {
......
......@@ -936,6 +936,7 @@ public:
// Retry, but make sure we don't try to create the parent again.
return tryReplaceNode(path, mode - WriteMode::CREATE_PARENT, kj::mv(tryCreate));
}
// fallthrough
default:
KJ_FAIL_SYSCALL("create(path)", error, path) { return false; }
} else {
......
......@@ -47,8 +47,10 @@ uint HashCoder::operator*(ArrayPtr<const byte> s) const {
switch (len) {
case 3:
h ^= data[2] << 16;
// fallthrough
case 2:
h ^= data[1] << 8;
// fallthrough
case 1:
h ^= data[0];
h *= m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment