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 | |
parent | 2b33daa972f399b7734215ac03d8102cb68d7c1b (diff) |
Use fallthrough attributes.
-rw-r--r-- | config/src/apps/vespa-get-config/getconfig.cpp | 2 | ||||
-rw-r--r-- | config/src/apps/vespa-ping-configproxy/pingproxy.cpp | 2 | ||||
-rw-r--r-- | document/src/vespa/document/select/valuenodes.cpp | 4 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/base64.cpp | 2 | ||||
-rw-r--r-- | fbench/src/filterfile/filterfile.cpp | 2 | ||||
-rw-r--r-- | fsa/src/vespa/fsa/segmenter.cpp | 8 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/common/sortresults.cpp | 8 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/predicate/predicate_hash.h | 46 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/util/jsonwriter.cpp | 2 | ||||
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp | 4 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/data/slime/json_format.cpp | 2 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/bobhash.h | 22 | ||||
-rw-r--r-- | vespalog/src/logctl/logctl.cpp | 4 | ||||
-rw-r--r-- | vsm/src/vespa/vsm/vsm/docsumfilter.cpp | 2 | ||||
-rw-r--r-- | vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp | 2 |
15 files changed, 56 insertions, 56 deletions
diff --git a/config/src/apps/vespa-get-config/getconfig.cpp b/config/src/apps/vespa-get-config/getconfig.cpp index 342b2b497bb..24e4623372e 100644 --- a/config/src/apps/vespa-get-config/getconfig.cpp +++ b/config/src/apps/vespa-get-config/getconfig.cpp @@ -164,7 +164,7 @@ GetConfig::Main() break; case 'h': retval = 0; - //@fallthrough@ + [[fallthrough]]; case '?': default: usage(); diff --git a/config/src/apps/vespa-ping-configproxy/pingproxy.cpp b/config/src/apps/vespa-ping-configproxy/pingproxy.cpp index 86b5a4a13ba..a88d7deb79a 100644 --- a/config/src/apps/vespa-ping-configproxy/pingproxy.cpp +++ b/config/src/apps/vespa-ping-configproxy/pingproxy.cpp @@ -99,7 +99,7 @@ PingProxy::Main() case '?': default: retval = 1; - // fallthrough + [[fallthrough]]; case 'h': usage(); return retval; diff --git a/document/src/vespa/document/select/valuenodes.cpp b/document/src/vespa/document/select/valuenodes.cpp index 837ebd873e3..f9cf3472110 100644 --- a/document/src/vespa/document/select/valuenodes.cpp +++ b/document/src/vespa/document/select/valuenodes.cpp @@ -905,7 +905,7 @@ ArithmeticValueNode::getValue(std::unique_ptr<Value> lval, slval.getValue() + srval.getValue())); } } - //@fallthrough@ + [[fallthrough]]; case SUB: case MUL: case DIV: @@ -995,7 +995,7 @@ ArithmeticValueNode::traceValue(std::unique_ptr<Value> lval, return result; } } - //@fallthrough@ + [[fallthrough]]; case SUB: case MUL: case DIV: diff --git a/fastlib/src/vespa/fastlib/util/base64.cpp b/fastlib/src/vespa/fastlib/util/base64.cpp index 1b7889d8c47..8b9ac45e698 100644 --- a/fastlib/src/vespa/fastlib/util/base64.cpp +++ b/fastlib/src/vespa/fastlib/util/base64.cpp @@ -90,7 +90,7 @@ Fast_Base64::Decode(const char *source, unsigned int length, char *destination) if (symbol != '=' || i == length) return -1; symbol = source[++i]; - //@fallthrough@ + [[fallthrough]]; case 3: for (; i < length; ++i) { symbol = source[i]; if (symbol == '\0') diff --git a/fbench/src/filterfile/filterfile.cpp b/fbench/src/filterfile/filterfile.cpp index ca93b70a046..e9b35de97e0 100644 --- a/fbench/src/filterfile/filterfile.cpp +++ b/fbench/src/filterfile/filterfile.cpp @@ -133,7 +133,7 @@ main(int argc, char** argv) break; case 1: buf[outIdx++] = line[idx]; - //@fallthrough@ + [[fallthrough]]; case 2: if (line[idx++] == '&') state = 0; diff --git a/fsa/src/vespa/fsa/segmenter.cpp b/fsa/src/vespa/fsa/segmenter.cpp index d13249a5ce8..3bcb3f1b489 100644 --- a/fsa/src/vespa/fsa/segmenter.cpp +++ b/fsa/src/vespa/fsa/segmenter.cpp @@ -77,16 +77,16 @@ void Segmenter::Segments::buildSegmentation(Segmenter::SegmentationMethod method switch(method){ case SEGMENTATION_WEIGHTED_BIAS100: bias+=50; - //@fallthrough@ + [[fallthrough]]; case SEGMENTATION_WEIGHTED_BIAS50: bias+=30; - //@fallthrough@ + [[fallthrough]]; case SEGMENTATION_WEIGHTED_BIAS20: bias+=10; - //@fallthrough@ + [[fallthrough]]; case SEGMENTATION_WEIGHTED_BIAS10: bias+=10; - //@fallthrough@ + [[fallthrough]]; case SEGMENTATION_WEIGHTED: bestid=-1; for(i=n_txt;i>=0;i--){ diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp index ed86014f7b3..e39f11f56b2 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.cpp +++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp @@ -459,16 +459,16 @@ public: default: case 4: r |= _data[a._idx + a._pos + 3] << 0; - //@fallthrough@ + [[fallthrough]]; case 3: r |= _data[a._idx + a._pos + 2] << 8; - //@fallthrough@ + [[fallthrough]]; case 2: r |= _data[a._idx + a._pos + 1] << 16; - //@fallthrough@ + [[fallthrough]]; case 1: r |= _data[a._idx + a._pos + 0] << 24; - //@fallthrough@ + [[fallthrough]]; case 0:; } a._pos += std::min(4u, left); diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_hash.h b/searchlib/src/vespa/searchlib/predicate/predicate_hash.h index 938b1bc5542..861a94d1990 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_hash.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_hash.h @@ -75,30 +75,30 @@ struct PredicateHash { // handle the last 23 bytes c += origLen; switch(len) { // all the case statements fall through - case 23: c+=((0xffLL & aKey[offset+22])<<56); //@fallthrough@ - case 22: c+=((0xffLL & aKey[offset+21])<<48); //@fallthrough@ - case 21: c+=((0xffLL & aKey[offset+20])<<40); //@fallthrough@ - case 20: c+=((0xffLL & aKey[offset+19])<<32); //@fallthrough@ - case 19: c+=((0xffLL & aKey[offset+18])<<24); //@fallthrough@ - case 18: c+=((0xffLL & aKey[offset+17])<<16); //@fallthrough@ - case 17: c+=((0xffLL & aKey[offset+16])<<8); //@fallthrough@ + case 23: c+=((0xffLL & aKey[offset+22])<<56); [[fallthrough]]; + case 22: c+=((0xffLL & aKey[offset+21])<<48); [[fallthrough]]; + case 21: c+=((0xffLL & aKey[offset+20])<<40); [[fallthrough]]; + case 20: c+=((0xffLL & aKey[offset+19])<<32); [[fallthrough]]; + case 19: c+=((0xffLL & aKey[offset+18])<<24); [[fallthrough]]; + case 18: c+=((0xffLL & aKey[offset+17])<<16); [[fallthrough]]; + case 17: c+=((0xffLL & aKey[offset+16])<<8); [[fallthrough]]; // the first byte of c is reserved for the length - case 16: b+=((0xffLL & aKey[offset+15])<<56); //@fallthrough@ - case 15: b+=((0xffLL & aKey[offset+14])<<48); //@fallthrough@ - case 14: b+=((0xffLL & aKey[offset+13])<<40); //@fallthrough@ - case 13: b+=((0xffLL & aKey[offset+12])<<32); //@fallthrough@ - case 12: b+=((0xffLL & aKey[offset+11])<<24); //@fallthrough@ - case 11: b+=((0xffLL & aKey[offset+10])<<16); //@fallthrough@ - case 10: b+=((0xffLL & aKey[offset+ 9])<<8); //@fallthrough@ - case 9: b+=( 0xffLL & aKey[offset+ 8]); //@fallthrough@ - case 8: a+=((0xffLL & aKey[offset+ 7])<<56); //@fallthrough@ - case 7: a+=((0xffLL & aKey[offset+ 6])<<48); //@fallthrough@ - case 6: a+=((0xffLL & aKey[offset+ 5])<<40); //@fallthrough@ - case 5: a+=((0xffLL & aKey[offset+ 4])<<32); //@fallthrough@ - case 4: a+=((0xffLL & aKey[offset+ 3])<<24); //@fallthrough@ - case 3: a+=((0xffLL & aKey[offset+ 2])<<16); //@fallthrough@ - case 2: a+=((0xffLL & aKey[offset+ 1])<<8); //@fallthrough@ - case 1: a+=( 0xffLL & aKey[offset+ 0]); //@fallthrough@ + case 16: b+=((0xffLL & aKey[offset+15])<<56); [[fallthrough]]; + case 15: b+=((0xffLL & aKey[offset+14])<<48); [[fallthrough]]; + case 14: b+=((0xffLL & aKey[offset+13])<<40); [[fallthrough]]; + case 13: b+=((0xffLL & aKey[offset+12])<<32); [[fallthrough]]; + case 12: b+=((0xffLL & aKey[offset+11])<<24); [[fallthrough]]; + case 11: b+=((0xffLL & aKey[offset+10])<<16); [[fallthrough]]; + case 10: b+=((0xffLL & aKey[offset+ 9])<<8); [[fallthrough]]; + case 9: b+=( 0xffLL & aKey[offset+ 8]); [[fallthrough]]; + case 8: a+=((0xffLL & aKey[offset+ 7])<<56); [[fallthrough]]; + case 7: a+=((0xffLL & aKey[offset+ 6])<<48); [[fallthrough]]; + case 6: a+=((0xffLL & aKey[offset+ 5])<<40); [[fallthrough]]; + case 5: a+=((0xffLL & aKey[offset+ 4])<<32); [[fallthrough]]; + case 4: a+=((0xffLL & aKey[offset+ 3])<<24); [[fallthrough]]; + case 3: a+=((0xffLL & aKey[offset+ 2])<<16); [[fallthrough]]; + case 2: a+=((0xffLL & aKey[offset+ 1])<<8); [[fallthrough]]; + case 1: a+=( 0xffLL & aKey[offset+ 0]); // case 0: nothing left to add } diff --git a/staging_vespalib/src/vespa/vespalib/util/jsonwriter.cpp b/staging_vespalib/src/vespa/vespalib/util/jsonwriter.cpp index 8fd96153dd7..ebeda4f1b8b 100644 --- a/staging_vespalib/src/vespa/vespalib/util/jsonwriter.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/jsonwriter.cpp @@ -56,7 +56,7 @@ JSONWriter::quote(const char * str, size_t len) case '\"': case '\\': v[j++] = '\\'; - //@fallthrough@ + [[fallthrough]]; default: v[j++] = str[i]; break; diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index e87eabd19df..06dfc073f61 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -569,7 +569,7 @@ FileStorHandlerImpl::remapMessage(api::StorageMessage& msg, const document::Buck } // Follow onto next to move queue or fail } - //@fallthrough@ + [[fallthrough]]; case api::MessageType::SPLITBUCKET_ID: // Move to correct queue if op == MOVE // Fail with bucket not found if op is JOIN @@ -640,7 +640,7 @@ FileStorHandlerImpl::remapMessage(api::StorageMessage& msg, const document::Buck break; case GetIterCommand::ID: bucket = static_cast<GetIterCommand&>(msg).getBucket(); - //@fallthrough@ + [[fallthrough]]; case RepairBucketCommand::ID: if (bucket.getBucketId().getRawId() == 0) { bucket = static_cast<RepairBucketCommand&>(msg).getBucket(); 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); diff --git a/vespalog/src/logctl/logctl.cpp b/vespalog/src/logctl/logctl.cpp index 111dfa071bb..a0963b43c34 100644 --- a/vespalog/src/logctl/logctl.cpp +++ b/vespalog/src/logctl/logctl.cpp @@ -116,10 +116,10 @@ main(int argc, char **argv) break; case 'r': doResetLevels = true; - //@fallthrough@ + [[fallthrough]]; case 'c': shouldCreateFile = true; - //@fallthrough@ + [[fallthrough]]; case 'n': shouldCreateEntry = true; break; diff --git a/vsm/src/vespa/vsm/vsm/docsumfilter.cpp b/vsm/src/vespa/vsm/vsm/docsumfilter.cpp index bd57c05f8ac..21fa1d9ed02 100644 --- a/vsm/src/vespa/vsm/vsm/docsumfilter.cpp +++ b/vsm/src/vespa/vsm/vsm/docsumfilter.cpp @@ -197,7 +197,7 @@ DocsumFilter::getFieldValue(const DocsumFieldSpec::FieldIdentifier & fieldId, return _cachedValue.get(); } } - //@fallthrough@ + [[fallthrough]]; default: return fv; } diff --git a/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp b/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp index 8855923610c..b21177a6810 100644 --- a/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp +++ b/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp @@ -65,7 +65,7 @@ FieldSearchSpec::FieldSearchSpec(const FieldIdT & fid, const vespalib::string & switch(searchDef) { default: LOG(warning, "Unknown searchdef = %d. Defaulting to AUTOUTF8", searchDef); - //@fallthrough@ + [[fallthrough]]; case VsmfieldsConfig::Fieldspec::AUTOUTF8: case VsmfieldsConfig::Fieldspec::NONE: case VsmfieldsConfig::Fieldspec::SSE2UTF8: |