diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2018-05-27 02:35:33 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2018-05-27 18:22:20 +0000 |
commit | dc3b5a57b6706bb13a685e5f97d2517dd87b34e3 (patch) | |
tree | 098a7d1220d798edf23bc56847a4b2903a0bba2a /vespalib | |
parent | 2b33daa972f399b7734215ac03d8102cb68d7c1b (diff) |
Use fallthrough attributes.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/data/slime/json_format.cpp | 2 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/bobhash.h | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp index 18bf5289f0d..72b494e2479 100644 --- a/vespalib/src/vespa/vespalib/data/slime/json_format.cpp +++ b/vespalib/src/vespa/vespalib/data/slime/json_format.cpp @@ -422,7 +422,7 @@ JsonDecoder::decodeNumber(Inserter &inserter) switch (c) { case '+': case '-': case '.': case 'e': case 'E': isLong = false; - //@fallthrough@ + [[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 2aff09929b2..60cbe2cbca3 100644 --- a/vespalib/src/vespa/vespalib/util/bobhash.h +++ b/vespalib/src/vespa/vespalib/util/bobhash.h @@ -128,18 +128,18 @@ public: c += length; switch(len) /* all the case statements fall through */ { - 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@ + 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); //@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 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]; /* case 0: nothing left to add */ } bobhash_mix(a,b,c); |