summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-07-24 09:35:58 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2017-07-24 09:35:58 +0000
commitbc58e5d7345217fa0fbfa0d9c577ee10c7bd94db (patch)
treee76c9d1daa7b18f9383200459afe40804af83dbf /vespalib
parent737979601f25ace7e5444dd3c925329c5a0a8b6d (diff)
Add [[falltrhough]] for gcc 7
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/data/slime/json_format.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/util/bobhash.h22
2 files changed, 12 insertions, 11 deletions
diff --git a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
index 856f9f654c2..88b99725302 100644
--- a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
+++ b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp
@@ -426,6 +426,7 @@ JsonDecoder::decodeNumber(Inserter &inserter)
switch (c) {
case '+': case '-': case '.': case 'e': case 'E':
isLong = false;
+ [[fallthrough]];
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
value.push_back(c);
diff --git a/vespalib/src/vespa/vespalib/util/bobhash.h b/vespalib/src/vespa/vespalib/util/bobhash.h
index 332e5b88cea..6c92896e538 100644
--- a/vespalib/src/vespa/vespalib/util/bobhash.h
+++ b/vespalib/src/vespa/vespalib/util/bobhash.h
@@ -135,18 +135,18 @@ public:
c += length;
switch(len) /* all the case statements fall through */
{
- case 11: c += (static_cast<uint32_t>(k[10]) << 24);
- case 10: c += (static_cast<uint32_t>(k[9]) << 16);
- case 9 : c += (static_cast<uint32_t>(k[8]) << 8);
+ case 11: c += (static_cast<uint32_t>(k[10]) << 24); [[fallthrough]];
+ case 10: c += (static_cast<uint32_t>(k[9]) << 16); [[fallthrough]];
+ case 9 : c += (static_cast<uint32_t>(k[8]) << 8); [[fallthrough]];
/* the first byte of c is reserved for the length */
- case 8 : b += (static_cast<uint32_t>(k[7]) << 24);
- case 7 : b += (static_cast<uint32_t>(k[6]) << 16);
- case 6 : b += (static_cast<uint32_t>(k[5]) << 8);
- case 5 : b += k[4];
- case 4 : a += (static_cast<uint32_t>(k[3]) << 24);
- case 3 : a += (static_cast<uint32_t>(k[2]) << 16);
- case 2 : a += (static_cast<uint32_t>(k[1]) << 8);
- case 1 : a += k[0];
+ case 8 : b += (static_cast<uint32_t>(k[7]) << 24); [[fallthrough]];
+ case 7 : b += (static_cast<uint32_t>(k[6]) << 16); [[fallthrough]];
+ case 6 : b += (static_cast<uint32_t>(k[5]) << 8); [[fallthrough]];
+ case 5 : b += k[4]; [[fallthrough]];
+ case 4 : a += (static_cast<uint32_t>(k[3]) << 24); [[fallthrough]];
+ case 3 : a += (static_cast<uint32_t>(k[2]) << 16); [[fallthrough]];
+ case 2 : a += (static_cast<uint32_t>(k[1]) << 8); [[fallthrough]];
+ case 1 : a += k[0]; [[fallthrough]];
/* case 0: nothing left to add */
}
bobhash_mix(a,b,c);