From 72e714fdfe3fbc34b83f345ee77e4a5d7f853659 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Fri, 18 Oct 2019 11:40:53 +0200 Subject: [PATCH 1/2] use C++17 [[fallthrough]] --- arangod/Aql/AllRowsFetcher.cpp | 4 +- arangod/Aql/AqlValue.cpp | 86 +++++++++---------- arangod/Aql/Ast.cpp | 4 +- arangod/Aql/AstNode.cpp | 10 +-- arangod/Aql/Functions.cpp | 62 ++++++------- arangod/Aql/OptimizerRules.cpp | 32 +++---- arangod/Aql/Query.cpp | 4 +- arangod/Cluster/HeartbeatThread.cpp | 2 +- arangod/GeneralServer/CommTask.cpp | 6 +- arangod/GeneralServer/HttpCommTask.cpp | 66 +++++++------- arangod/IResearch/IResearchDocument.cpp | 6 +- arangod/MMFiles/MMFilesCleanupThread.cpp | 2 +- arangod/MMFiles/MMFilesCollection.cpp | 4 +- arangod/MMFiles/MMFilesDatafile.cpp | 2 +- arangod/MMFiles/MMFilesSkiplistIndex.cpp | 10 +-- arangod/MMFiles/MMFilesWalSlots.cpp | 2 +- .../RestHandler/RestReplicationHandler.cpp | 6 +- arangod/V8Server/v8-collection.cpp | 6 +- arangod/V8Server/v8-user-structures.cpp | 2 +- arangod/V8Server/v8-vocbase.cpp | 2 +- arangod/VocBase/Methods/Transactions.cpp | 14 +-- lib/Basics/StringUtils.cpp | 40 ++++----- lib/Basics/Utf8Helper.cpp | 2 +- lib/Basics/fasthash.cpp | 26 +++--- lib/Basics/tri-strings.cpp | 2 +- lib/V8/v8-buffer.cpp | 4 +- lib/V8/v8-buffer.h | 4 +- lib/V8/v8-vpack.cpp | 2 +- 28 files changed, 206 insertions(+), 206 deletions(-) diff --git a/arangod/Aql/AllRowsFetcher.cpp b/arangod/Aql/AllRowsFetcher.cpp index 4a14eb1cdb98..1a48f56cc5d2 100644 --- a/arangod/Aql/AllRowsFetcher.cpp +++ b/arangod/Aql/AllRowsFetcher.cpp @@ -83,7 +83,7 @@ std::pair AllRowsFetcher::fetchRow(size_t atMos _nextReturn = 0; _dataFetchedState = DATA_FETCH_ONGOING; } - // intentionally falls through + [[fallthrough]]; case DATA_FETCH_ONGOING: { TRI_ASSERT(_nextReturn < _rowIndexes.size()); TRI_ASSERT(_aqlItemMatrix != nullptr); @@ -258,4 +258,4 @@ std::pair AllRowsFetcher::fetchShadowRow(size_ } return {state, row}; -} \ No newline at end of file +} diff --git a/arangod/Aql/AqlValue.cpp b/arangod/Aql/AqlValue.cpp index 57e27f941bce..9d0d2a953367 100644 --- a/arangod/Aql/AqlValue.cpp +++ b/arangod/Aql/AqlValue.cpp @@ -241,11 +241,11 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isArray()) { @@ -263,7 +263,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { return AqlValue(s.at(position).begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: { @@ -289,7 +289,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { total += it->size(); } } - // intentionally falls through + // intentionally falls through if break; } case RANGE: { @@ -303,7 +303,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { // only look up the value if it is within array bounds return AqlValue(AqlValueHintInt(_data.range->at(static_cast(position)))); } - // intentionally falls through + // intentionally falls through if break; } } @@ -318,11 +318,11 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isArray()) { @@ -339,7 +339,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy return AqlValue(s.at(position).begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: { @@ -364,7 +364,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy total += it->size(); } } - // intentionally falls through + // intentionally falls through if break; } case RANGE: { @@ -377,7 +377,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy // only look up the value if it is within array bounds return AqlValue(AqlValueHintInt(_data.range->at(static_cast(position)))); } - // intentionally falls through + // intentionally falls through if break; } } @@ -392,11 +392,11 @@ AqlValue AqlValue::getKeyAttribute(bool& mustDestroy, bool doCopy) const { switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -410,7 +410,7 @@ AqlValue AqlValue::getKeyAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -431,11 +431,11 @@ AqlValue AqlValue::getIdAttribute(CollectionNameResolver const& resolver, switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -454,7 +454,7 @@ AqlValue AqlValue::getIdAttribute(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -474,11 +474,11 @@ AqlValue AqlValue::getFromAttribute(bool& mustDestroy, bool doCopy) const { switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -492,7 +492,7 @@ AqlValue AqlValue::getFromAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -512,11 +512,11 @@ AqlValue AqlValue::getToAttribute(bool& mustDestroy, bool doCopy) const { switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -530,7 +530,7 @@ AqlValue AqlValue::getToAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -551,11 +551,11 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -574,7 +574,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -596,11 +596,11 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -619,7 +619,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -645,11 +645,11 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, switch (type()) { case VPACK_SLICE_POINTER: doCopy = false; - // intentionally falls through + [[fallthrough]]; case VPACK_INLINE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_SLICE: - // intentionally falls through + [[fallthrough]]; case VPACK_MANAGED_BUFFER: { VPackSlice s(slice()); if (s.isObject()) { @@ -692,7 +692,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(s.begin()); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -762,7 +762,7 @@ double AqlValue::toDouble(bool& failed) const { return at(0, mustDestroy, false).toDouble(failed); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -815,7 +815,7 @@ int64_t AqlValue::toInt64() const { return at(0, mustDestroy, false).toInt64(); } } - // intentionally falls through + // intentionally falls through if break; } case DOCVEC: @@ -939,7 +939,7 @@ void AqlValue::toVelocyPack(transaction::Methods* trx, arangodb::velocypack::Bui if (!resolveExternals && isManagedDocument()) { builder.addExternal(_data.pointer); break; - } // intentionally falls through + } [[fallthrough]]; case VPACK_INLINE: case VPACK_MANAGED_SLICE: case VPACK_MANAGED_BUFFER: { diff --git a/arangod/Aql/Ast.cpp b/arangod/Aql/Ast.cpp index 63f9e7f6ed45..d3bb0e6fd490 100644 --- a/arangod/Aql/Ast.cpp +++ b/arangod/Aql/Ast.cpp @@ -1794,7 +1794,7 @@ AstNode* Ast::replaceVariables(AstNode* node, node->setData((*it).second); } } - // intentionally falls through + // intentionally falls through if } return node; @@ -2925,7 +2925,7 @@ AstNode* Ast::optimizeBinaryOperatorRelational(AstNode* node) { // and optimize ourselves... return optimizeBinaryOperatorRelational(node); } - // intentionally falls through + // intentionally falls through if } bool const rhsIsConst = rhs->isConstant(); diff --git a/arangod/Aql/AstNode.cpp b/arangod/Aql/AstNode.cpp index 215f68581e5b..677e70373655 100644 --- a/arangod/Aql/AstNode.cpp +++ b/arangod/Aql/AstNode.cpp @@ -1200,7 +1200,7 @@ AstNode const* AstNode::castToBool(Ast* ast) const { default: { } } - // intentionally falls through + // intentionally falls through if } else if (type == NODE_TYPE_ARRAY) { return ast->createNodeValueBool(true); } else if (type == NODE_TYPE_OBJECT) { @@ -1241,9 +1241,9 @@ AstNode const* AstNode::castToNumber(Ast* ast) const { } return ast->createNodeValueDouble(v); } - // intentionally falls through + // intentionally falls through if } - // intentionally falls through + // intentionally falls through if } else if (type == NODE_TYPE_ARRAY) { size_t const n = numMembers(); if (n == 0) { @@ -1254,9 +1254,9 @@ AstNode const* AstNode::castToNumber(Ast* ast) const { // convert only member to number return member->castToNumber(ast); } - // intentionally falls through + // intentionally falls through if } else if (type == NODE_TYPE_OBJECT) { - // intentionally falls through + // intentionally falls through if } return ast->createNodeValueInt(0); diff --git a/arangod/Aql/Functions.cpp b/arangod/Aql/Functions.cpp index c48ed1637289..452cfc31f2df 100644 --- a/arangod/Aql/Functions.cpp +++ b/arangod/Aql/Functions.cpp @@ -295,7 +295,7 @@ AqlValue timeAqlValue(ExpressionContext* expressionContext, year_month_day ymd{floor(tp)}; auto day_time = make_time(tp - sys_days(ymd)); - + auto y = static_cast(ymd.year()); // quick sanity check here for dates outside the allowed range if (y < 0 || y > 9999) { @@ -439,7 +439,7 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext, break; // We are done } durationUnits *= 12; - // intentionally falls through + [[fallthrough]]; case MONTH: durationUnits = std::modf(durationUnits, &intPart); if (isSubtract) { @@ -451,7 +451,7 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext, break; // We are done } durationUnits *= 30; // 1 Month ~= 30 Days - // intentionally falls through + [[fallthrough]]; // After this fall through the date may actually a bit off case DAY: // From here on we do not need leap-day handling @@ -499,19 +499,19 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext, AqlValue addOrSubtractIsoDurationFromTimestamp(ExpressionContext* expressionContext, tp_sys_clock_ms const& tp, - arangodb::velocypack::StringRef duration, + arangodb::velocypack::StringRef duration, char const* AFN, bool isSubtract) { year_month_day ymd{floor(tp)}; auto day_time = make_time(tp - sys_days(ymd)); - + std::match_results durationParts; if (!basics::regexIsoDuration(duration, durationParts)) { ::registerWarning(expressionContext, AFN, TRI_ERROR_QUERY_INVALID_DATE_VALUE); return AqlValue(AqlValueHintNull()); } - char const* begin; - + char const* begin; + begin = duration.data() + durationParts.position(2); int number = NumberUtils::atoi_unchecked(begin, begin + durationParts.length(2)); if (isSubtract) { @@ -2498,8 +2498,8 @@ void rtrimInternal(int32_t& startOffset, int32_t& endOffset, icu::UnicodeString& if (unicodeStr.length() == 0) { return; } - for (int32_t codePos = unicodeStr.moveIndex32(endOffset, -1); - startOffset <= codePos; + for (int32_t codePos = unicodeStr.moveIndex32(endOffset, -1); + startOffset <= codePos; codePos = unicodeStr.moveIndex32(codePos, -1)) { bool found = false; @@ -3648,7 +3648,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (ymd1.year() != ymd2.year()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case MONTH: if (rangeEnd > MONTH) { break; @@ -3656,7 +3656,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (ymd1.month() != ymd2.month()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case DAY: if (rangeEnd > DAY) { break; @@ -3664,7 +3664,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (ymd1.day() != ymd2.day()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case HOUR: if (rangeEnd > HOUR) { break; @@ -3672,7 +3672,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (time1.hours() != time2.hours()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case MINUTE: if (rangeEnd > MINUTE) { break; @@ -3680,7 +3680,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (time1.minutes() != time2.minutes()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case SECOND: if (rangeEnd > SECOND) { break; @@ -3688,7 +3688,7 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext, if (time1.seconds() != time2.seconds()) { return AqlValue(AqlValueHintBool(false)); } - // intentionally falls through + [[fallthrough]]; case MILLI: if (rangeEnd > MILLI) { break; @@ -3730,15 +3730,15 @@ AqlValue Functions::DateRound(ExpressionContext* expressionContext, ::registerInvalidArgumentWarning(expressionContext, AFN); return AqlValue(AqlValueHintNull()); } - - int64_t const m = durationUnit.toInt64(); + + int64_t const m = durationUnit.toInt64(); if (m <= 0) { ::registerInvalidArgumentWarning(expressionContext, AFN); return AqlValue(AqlValueHintNull()); } - + velocypack::StringRef s = durationType.slice().stringRef(); - + int64_t factor = 1; if (s == "milliseconds" || s == "millisecond" || s == "f") { factor = 1; @@ -3755,8 +3755,8 @@ AqlValue Functions::DateRound(ExpressionContext* expressionContext, return AqlValue(AqlValueHintNull()); } - int64_t const multiplier = factor * m; - + int64_t const multiplier = factor * m; + duration time = tp.time_since_epoch(); int64_t t = time.count(); // integer division! @@ -4186,7 +4186,7 @@ AqlValue Functions::Sleep(ExpressionContext* expressionContext, } auto& server = application_features::ApplicationServer::server(); - + double const sleepValue = value.toDouble(); auto now = std::chrono::steady_clock::now(); auto const endTime = now + std::chrono::milliseconds(static_cast(sleepValue * 1000.0)); @@ -4443,7 +4443,7 @@ AqlValue Functions::Unique(ExpressionContext* expressionContext, transaction::Me std::unordered_set values(512, arangodb::basics::VelocyPackHelper::VPackHash(), arangodb::basics::VelocyPackHelper::VPackEqual(options)); - + transaction::BuilderLeaser builder(trx); builder->openArray(); @@ -4458,7 +4458,7 @@ AqlValue Functions::Unique(ExpressionContext* expressionContext, transaction::Me builder->add(s); } } - + builder->close(); return AqlValue(builder.get()); } @@ -4845,7 +4845,7 @@ AqlValue Functions::GeoDistance(ExpressionContext* expressionContext, ::registerWarning(expressionContext, "GEO_DISTANCE", res); return AqlValue(AqlValueHintNull()); } - + if (parameters.size() > 2 && parameters[2].isString()) { VPackValueLength len; const char* ptr = parameters[2].slice().getStringUnchecked(len); @@ -4911,17 +4911,17 @@ AqlValue Functions::GeoArea(ExpressionContext* expressionContext, VPackFunctionParameters const& parameters) { AqlValue p1 = extractFunctionParameterValue(parameters, 0); AqlValue p2 = extractFunctionParameterValue(parameters, 1); - + AqlValueMaterializer mat(trx); - + geo::ShapeContainer shape; Result res = geo::geojson::parseRegion(mat.slice(p1, true), shape); - + if (res.fail()) { ::registerWarning(expressionContext, "GEO_AREA", res); return AqlValue(AqlValueHintNull()); } - + auto detEllipsoid = [](AqlValue const& p) { if (p.isString()) { VPackValueLength len; @@ -7038,7 +7038,7 @@ AqlValue Functions::DecodeRev(ExpressionContext* expressionContext, VPackValueLength l; char const* p = rev.slice().getString(l); uint64_t revInt = arangodb::basics::HybridLogicalClock::decodeTimeStamp(p, l); - + if (revInt == 0 || revInt == UINT64_MAX) { ::registerInvalidArgumentWarning(expressionContext, "DECODE_REV"); return AqlValue(AqlValueHintNull()); @@ -7050,7 +7050,7 @@ AqlValue Functions::DecodeRev(ExpressionContext* expressionContext, uint64_t millis = timeMilli % 1000; struct tm date; TRI_gmtime(timeSeconds, &date); - + char buffer[32]; strftime(buffer, 32, "%Y-%m-%dT%H:%M:%S.000Z", &date); // fill millisecond part not covered by strftime diff --git a/arangod/Aql/OptimizerRules.cpp b/arangod/Aql/OptimizerRules.cpp index 0fd8f0277ddb..d980a9351d4e 100644 --- a/arangod/Aql/OptimizerRules.cpp +++ b/arangod/Aql/OptimizerRules.cpp @@ -980,7 +980,7 @@ void arangodb::aql::sortInValuesRule(Optimizer* opt, std::unique_ptrvariables()->createTemporaryVariable(); auto expression = std::make_unique(plan.get(), ast, sorted); - ExecutionNode* calculationNode = + ExecutionNode* calculationNode = new CalculationNode(plan.get(), plan->nextId(), std::move(expression), outVar); plan->registerNode(calculationNode); @@ -1752,7 +1752,7 @@ void arangodb::aql::moveCalculationsDownRule(Optimizer* opt, } lastNode = current; - + } else if (currentType == EN::INDEX || currentType == EN::ENUMERATE_COLLECTION || currentType == EN::ENUMERATE_IRESEARCH_VIEW || currentType == EN::ENUMERATE_LIST || currentType == EN::TRAVERSAL || @@ -4407,7 +4407,7 @@ void arangodb::aql::distributeFilternCalcToClusterRule(Optimizer* opt, stopSearching = true; break; } - // intentionally falls through + // intentionally falls through if } #if 0 // TODO: this is already prepared to push subqueries on the DB servers. @@ -4420,7 +4420,7 @@ void arangodb::aql::distributeFilternCalcToClusterRule(Optimizer* opt, stopSearching = true; break; } - // intentionally falls through + // intentionally falls through if } #endif // no special handling for filters here @@ -4564,9 +4564,9 @@ void arangodb::aql::distributeSortToClusterRule(Optimizer* opt, break; } // late-materialization should be set only after sort nodes are distributed - // in cluster as it accounts this disctribution. So we should not encounter this + // in cluster as it accounts this disctribution. So we should not encounter this // kind of nodes for now - case EN::MATERIALIZE: + case EN::MATERIALIZE: case EN::SUBQUERY_START: case EN::SUBQUERY_END: case EN::DISTRIBUTE_CONSUMER: @@ -5253,7 +5253,7 @@ struct OrSimplifier { return true; } } - // intentionally falls through + // intentionally falls through if } else if (node->type == NODE_TYPE_OPERATOR_BINARY_IN) { auto lhs = node->getMember(0); auto rhs = node->getMember(1); @@ -5264,7 +5264,7 @@ struct OrSimplifier { return true; } } - // intentionally falls through + // intentionally falls through if } return false; @@ -5369,7 +5369,7 @@ struct OrSimplifier { return ast->createNodeBinaryOperator(node->type, lhsNew, rhsNew); } - // intentionally falls through + // intentionally falls through if } return const_cast(node); @@ -5538,7 +5538,7 @@ struct RemoveRedundantOr { } // if hasRedundantConditionWalker(lhs) and // hasRedundantConditionWalker(rhs), then one of the conditions in the OR - // statement is of the form x == x intentionally falls through + // statement is of the form x == x intentionally falls through if } else if (type == NODE_TYPE_REFERENCE || type == NODE_TYPE_ATTRIBUTE_ACCESS || type == NODE_TYPE_INDEXED_ACCESS) { // get a string representation of the node for comparisons @@ -7183,7 +7183,7 @@ void arangodb::aql::moveFiltersIntoEnumerateRule(Optimizer* opt, std::unique_ptr } Variable const* outVariable = en->outVariable(); - + if (!n->isVarUsedLater(outVariable)) { // e.g. FOR doc IN collection RETURN 1 continue; @@ -7197,14 +7197,14 @@ void arangodb::aql::moveFiltersIntoEnumerateRule(Optimizer* opt, std::unique_ptr if (current->getType() != EN::FILTER && current->getType() != EN::CALCULATION) { break; } - + if (current->getType() == EN::FILTER) { if (calculations.empty()) { break; } auto filterNode = ExecutionNode::castTo(current); Variable const* inVariable = filterNode->inVariable(); - + auto it = calculations.find(inVariable); if (it == calculations.end()) { break; @@ -7217,7 +7217,7 @@ void arangodb::aql::moveFiltersIntoEnumerateRule(Optimizer* opt, std::unique_ptr // node already has a filter, now AND-merge it with what we found! AstNode* merged = plan->getAst()->createNodeBinaryOperator( NODE_TYPE_OPERATOR_BINARY_AND, existingFilter->node(), expr->node()); - + en->setFilter(std::make_unique(plan.get(), plan->getAst(), merged)); } else { // node did not yet have a filter @@ -7248,11 +7248,11 @@ void arangodb::aql::moveFiltersIntoEnumerateRule(Optimizer* opt, std::unique_ptr found.clear(); Ast::getReferencedVariables(expr->node(), found); - if (found.size() == 1 && + if (found.size() == 1 && found.find(outVariable) != found.end()) { calculations.emplace(calculationNode->outVariable(), calculationNode); } - } + } current = current->getFirstParent(); } diff --git a/arangod/Aql/Query.cpp b/arangod/Aql/Query.cpp index 15945f57f52b..7247ccb06898 100644 --- a/arangod/Aql/Query.cpp +++ b/arangod/Aql/Query.cpp @@ -634,7 +634,7 @@ ExecutionState Query::execute(QueryRegistry* registry, QueryResult& queryResult) _resultBuilder->openArray(); _executionPhase = ExecutionPhase::EXECUTE; } - // intentionally falls through + [[fallthrough]]; case ExecutionPhase::EXECUTE: { TRI_ASSERT(_resultBuilder != nullptr); TRI_ASSERT(_resultBuilder->isOpenArray()); @@ -713,7 +713,7 @@ ExecutionState Query::execute(QueryRegistry* registry, QueryResult& queryResult) _executionPhase = ExecutionPhase::FINALIZE; } - // intentionally falls through + [[fallthrough]]; case ExecutionPhase::FINALIZE: { // will set warnings, stats, profile and cleanup plan and engine return finalize(queryResult); diff --git a/arangod/Cluster/HeartbeatThread.cpp b/arangod/Cluster/HeartbeatThread.cpp index 6f5420f0ef71..241686ac9b08 100644 --- a/arangod/Cluster/HeartbeatThread.cpp +++ b/arangod/Cluster/HeartbeatThread.cpp @@ -652,7 +652,7 @@ void HeartbeatThread::runSingleServer() { if (result.successful()) { // successful leadership takeover leader = myIdBuilder.slice(); - // intentionally falls through to case 2 + // intentionally falls through if to case 2 } else if (result.httpCode() == TRI_ERROR_HTTP_PRECONDITION_FAILED) { // we did not become leader, someone else is, response contains // current value in agency diff --git a/arangod/GeneralServer/CommTask.cpp b/arangod/GeneralServer/CommTask.cpp index eb76098d7fd7..60ea0783de51 100644 --- a/arangod/GeneralServer/CommTask.cpp +++ b/arangod/GeneralServer/CommTask.cpp @@ -201,7 +201,7 @@ CommTask::Flow CommTask::prepareExecution(GeneralRequest& req) { break; // continue with auth check } } - // intentionally falls through + [[fallthrough]]; case ServerState::Mode::TRYAGAIN: { if (!::startsWith(path, "/_admin/shutdown") && !::startsWith(path, "/_admin/cluster/health") && @@ -305,7 +305,7 @@ void CommTask::executeRequest(std::unique_ptr request, bool found; // check for an async request (before the handler steals the request) std::string const& asyncExec = request->header(StaticStrings::Async, found); - + // store the message id for error handling uint64_t messageId = 0UL; if (request) { @@ -476,7 +476,7 @@ void CommTask::addErrorResponse(rest::ResponseCode code, rest::ContentType respT bool CommTask::handleRequestSync(std::shared_ptr handler) { RequestStatistics::SET_QUEUE_START(handler->statistics(), SchedulerFeature::SCHEDULER->queueStatistics()._queued); - + RequestLane lane = handler->getRequestLane(); ContentType respType = handler->request()->contentTypeResponse(); uint64_t mid = handler->messageId(); diff --git a/arangod/GeneralServer/HttpCommTask.cpp b/arangod/GeneralServer/HttpCommTask.cpp index 3d1d5ef57158..8113d6843cec 100644 --- a/arangod/GeneralServer/HttpCommTask.cpp +++ b/arangod/GeneralServer/HttpCommTask.cpp @@ -85,11 +85,11 @@ int HttpCommTask::on_message_began(llhttp_t* p) { self->_lastHeaderWasValue = false; self->_shouldKeepAlive = false; self->_messageDone = false; - + // acquire a new statistics entry for the request RequestStatistics* stat = self->acquireStatistics(1UL); RequestStatistics::SET_READ_START(stat, TRI_microtime()); - + return HPE_OK; } @@ -103,10 +103,10 @@ int HttpCommTask::on_url(llhttp_t* p, const char* at, size_t len) { rest::ContentType::UNSET, 1, VPackBuffer()); return HPE_USER; } - + RequestStatistics* stat = self->statistics(1UL); RequestStatistics::SET_REQUEST_TYPE(stat, self->_request->requestType()); - + return HPE_OK; } @@ -201,12 +201,12 @@ int HttpCommTask::on_body(llhttp_t* p, const char* at, size_t len) { template int HttpCommTask::on_message_complete(llhttp_t* p) { HttpCommTask* self = static_cast*>(p->data); - + RequestStatistics* stat = self->statistics(1UL); RequestStatistics::SET_READ_END(stat); RequestStatistics::ADD_RECEIVED_BYTES(stat, self->_request->body().size()); self->_messageDone = true; - + return HPE_PAUSED; } @@ -279,11 +279,11 @@ bool HttpCommTask::readCallback(asio_ns::error_code ec) { err = HPE_INVALID_EOF_STATE; } } else { // Inspect the received data - + size_t parsedBytes = 0; for (auto const& buffer : this->_protocol->buffer.data()) { const char* data = reinterpret_cast(buffer.data()); - + err = llhttp_execute(&_parser, data, buffer.size()); if (err != HPE_OK) { parsedBytes += llhttp_get_error_pos(&_parser) - data; @@ -291,18 +291,18 @@ bool HttpCommTask::readCallback(asio_ns::error_code ec) { } parsedBytes += buffer.size(); } - + TRI_ASSERT(parsedBytes < std::numeric_limits::max()); // Remove consumed data from receive buffer. this->_protocol->buffer.consume(parsedBytes); - + if (err == HPE_PAUSED_UPGRADE) { this->addSimpleResponse(rest::ResponseCode::NOT_IMPLEMENTED, rest::ContentType::UNSET, 1, VPackBuffer()); return false; // stop read loop } } - + if (_messageDone) { TRI_ASSERT(err == HPE_PAUSED); _messageDone = false; @@ -339,10 +339,10 @@ void HttpCommTask::checkVSTPrefix() { return; } thisPtr->_protocol->buffer.commit(nread); - + auto bg = asio_ns::buffers_begin(thisPtr->_protocol->buffer.data()); if (std::equal(::vst10, ::vst10 + 11, bg, bg + 11)) { - + thisPtr->_protocol->buffer.consume(11); // remove VST/1.0 prefix auto commTask = std::make_unique>(thisPtr->_server, thisPtr->_connectionInfo, @@ -350,9 +350,9 @@ void HttpCommTask::checkVSTPrefix() { fuerte::vst::VST1_0); thisPtr->_server.registerTask(std::move(commTask)); return; // vst 1.0 - + } else if (std::equal(::vst11, ::vst11 + 11, bg, bg + 11)) { - + thisPtr->_protocol->buffer.consume(11); // remove VST/1.1 prefix auto commTask = std::make_unique>(thisPtr->_server, thisPtr->_connectionInfo, @@ -361,7 +361,7 @@ void HttpCommTask::checkVSTPrefix() { thisPtr->_server.registerTask(std::move(commTask)); return; // vst 1.1 } - + thisPtr->asyncReadSome(); // continue reading }; auto buffs = this->_protocol->buffer.prepare(GeneralCommTask::ReadBlockSize); @@ -378,13 +378,13 @@ bool HttpCommTask::checkHttpUpgrade() { template void HttpCommTask::processRequest() { TRI_ASSERT(_request); - + // ensure there is a null byte termination. RestHandlers use // C functions like strchr that except a C string as input _request->body().push_back('\0'); _request->body().resetTo(_request->body().size() - 1); this->_protocol->timer.cancel(); - + { LOG_TOPIC("6e770", DEBUG, Logger::REQUESTS) << "\"http-request-begin\",\"" << (void*)this << "\",\"" @@ -452,12 +452,12 @@ bool allowCredentials(std::string const& origin) { if (origin.empty()) { return allowCredentials; } // else handle origin headers - + // if the request asks to allow credentials, we'll check against the // configured whitelist of origins std::vector const& accessControlAllowOrigins = GeneralServerFeature::accessControlAllowOrigins(); - + if (!accessControlAllowOrigins.empty()) { if (accessControlAllowOrigins[0] == "*") { // special case: allow everything @@ -571,7 +571,7 @@ ResponseCode HttpCommTask::handleAuthHeader(HttpRequest& req) { return rest::ResponseCode::UNAUTHORIZED; } - // intentionally falls through + // intentionally falls through if } catch (arangodb::basics::Exception const& ex) { // translate error if (ex.code() == TRI_ERROR_USER_NOT_FOUND) { @@ -642,20 +642,20 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, // access-control-allow-origin header now LOG_TOPIC("ae603", DEBUG, arangodb::Logger::REQUESTS) << "handling CORS response"; - + // send back original value of "Origin" header response.setHeaderNCIfNotSet(StaticStrings::AccessControlAllowOrigin, _origin); - + // send back "Access-Control-Allow-Credentials" header response.setHeaderNCIfNotSet(StaticStrings::AccessControlAllowCredentials, (::allowCredentials(_origin) ? "true" : "false")); - + // use "IfNotSet" here because we should not override HTTP headers set // by Foxx applications response.setHeaderNCIfNotSet(StaticStrings::AccessControlExposeHeaders, StaticStrings::ExposedCorsHeaders); } - + if (!ServerState::instance()->isDBServer()) { // DB server is not user-facing, and does not need to set this header // use "IfNotSet" to not overwrite an existing response header @@ -721,7 +721,7 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, if (!seenServerHeader && !HttpResponse::HIDE_PRODUCT_HEADER) { header->append(TRI_CHAR_LENGTH_PAIR("Server: ArangoDB\r\n")); } - + // turn on the keepAlive timer double secs = GeneralServerFeature::keepAliveTimeout(); if (_shouldKeepAlive && secs > 0) { @@ -737,7 +737,7 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, << "keep alive timeout, closing stream!"; s->close(); }); - + header->append(TRI_CHAR_LENGTH_PAIR("Connection: Keep-Alive\r\n")); header->append(TRI_CHAR_LENGTH_PAIR("Keep-Alive: timeout=")); header->append(std::to_string(static_cast(secs))); @@ -745,7 +745,7 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, } else { header->append(TRI_CHAR_LENGTH_PAIR("Connection: Close\r\n")); } - + // add "Content-Type" header switch (response.contentType()) { case ContentType::UNSET: @@ -778,12 +778,12 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, header->append(it); header->append("\r\n", 2); } - + size_t len = response.bodySize(); header->append(TRI_CHAR_LENGTH_PAIR("Content-Length: ")); header->append(std::to_string(len)); header->append("\r\n\r\n", 4); - + std::unique_ptr body = response.stealBody(); // append write buffer and statistics double const totalTime = RequestStatistics::ELAPSED_SINCE_READ_START(stat); @@ -793,21 +793,21 @@ void HttpCommTask::sendResponse(std::unique_ptr baseRes, << "\"http-request-end\",\"" << (void*)this << "\",\"" << this->_connectionInfo.clientAddress << "\",\"" << GeneralRequest::translateMethod(::llhttpToRequestType(&_parser)) << "\",\"" << static_cast(response.responseCode()) << "\"," << Logger::FIXED(totalTime, 6); - + std::array buffers; buffers[0] = asio_ns::buffer(header->data(), header->size()); if (HTTP_HEAD != _parser.method) { buffers[1] = asio_ns::buffer(body->data(), body->size()); TRI_ASSERT(len == body->size()); } - + // FIXME measure performance w/o sync write auto cb = [self = CommTask::shared_from_this(), h = std::move(header), b = std::move(body)](asio_ns::error_code ec, size_t nwrite) { auto* thisPtr = static_cast*>(self.get()); - + llhttp_errno_t err = llhttp_get_errno(&thisPtr->_parser); if (ec || !thisPtr->_shouldKeepAlive || err != HPE_PAUSED) { if (ec) { diff --git a/arangod/IResearch/IResearchDocument.cpp b/arangod/IResearch/IResearchDocument.cpp index 0b103a6546df..8cc27e226e1b 100644 --- a/arangod/IResearch/IResearchDocument.cpp +++ b/arangod/IResearch/IResearchDocument.cpp @@ -181,7 +181,7 @@ inline bool canHandleValue(std::string const& key, VPackSlice const& value, return true; case VPackValueType::Custom: TRI_ASSERT(key == arangodb::StaticStrings::IdString); - // intentionally falls through + [[fallthrough]]; case VPackValueType::String: return !context._analyzers.empty(); default: @@ -556,7 +556,7 @@ bool FieldIterator::setAttributeValue(IResearchLinkMeta const& context) { return true; case VPackValueType::Custom: TRI_ASSERT(nameBuffer() == arangodb::StaticStrings::IdString); - // intentionally falls through + [[fallthrough]]; case VPackValueType::String: resetAnalyzers(context); // reset string analyzers return setStringValue(value, *_begin); @@ -651,4 +651,4 @@ void FieldIterator::next() { // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE -// ----------------------------------------------------------------------------- \ No newline at end of file +// ----------------------------------------------------------------------------- diff --git a/arangod/MMFiles/MMFilesCleanupThread.cpp b/arangod/MMFiles/MMFilesCleanupThread.cpp index 3a0a3d26281d..1f2b3cd27678 100644 --- a/arangod/MMFiles/MMFilesCleanupThread.cpp +++ b/arangod/MMFiles/MMFilesCleanupThread.cpp @@ -165,7 +165,7 @@ void MMFilesCleanupThread::cleanupCollection(arangodb::LogicalCollection* collec if (!unloadChecked && !isInShutdown) { return false; } - // intentionally falls through + // intentionally falls through if } else { // retry in next iteration unloadChecked = false; diff --git a/arangod/MMFiles/MMFilesCollection.cpp b/arangod/MMFiles/MMFilesCollection.cpp index b39836f45e06..28439fedcd77 100644 --- a/arangod/MMFiles/MMFilesCollection.cpp +++ b/arangod/MMFiles/MMFilesCollection.cpp @@ -2540,7 +2540,7 @@ int MMFilesCollection::lockRead(bool useDeadlockDetector, LOG_TOPIC("29637", TRACE, arangodb::Logger::ENGINES) << "waiting for read-lock on collection '" << _logicalCollection.name() << "'"; - // intentionally falls through + // intentionally falls through if } else if (++iterations >= 5) { // periodically check for deadlocks TRI_ASSERT(wasBlocked); @@ -2837,7 +2837,7 @@ LocalDocumentId MMFilesCollection::reuseOrCreateLocalDocumentId(OperationOptions if (marker->hasLocalDocumentId()) { return marker->getLocalDocumentId(); } - // falls through intentionally + // intentionally falls through if } // new operation, no recovery -> generate a new LocalDocumentId diff --git a/arangod/MMFiles/MMFilesDatafile.cpp b/arangod/MMFiles/MMFilesDatafile.cpp index ecb499958567..60e78ee5bab5 100644 --- a/arangod/MMFiles/MMFilesDatafile.cpp +++ b/arangod/MMFiles/MMFilesDatafile.cpp @@ -520,7 +520,7 @@ int MMFilesDatafile::reserveElement(uint32_t size, MMFilesMarker** position, return TRI_ERROR_ARANGO_DOCUMENT_TOO_LARGE; } - // intentionally falls through + // intentionally falls through if } // add the marker, leave enough room for the footer diff --git a/arangod/MMFiles/MMFilesSkiplistIndex.cpp b/arangod/MMFiles/MMFilesSkiplistIndex.cpp index 613363d8f3c1..17f89bf33e91 100644 --- a/arangod/MMFiles/MMFilesSkiplistIndex.cpp +++ b/arangod/MMFiles/MMFilesSkiplistIndex.cpp @@ -172,7 +172,7 @@ MMFilesSkiplistLookupBuilder::MMFilesSkiplistLookupBuilder( } else { _includeUpper = false; } - // intentionally falls through + [[fallthrough]]; case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LE: if (isReverseOrder) { value->toVelocyPackValue(*(_lowerBuilder.get())); @@ -186,7 +186,7 @@ MMFilesSkiplistLookupBuilder::MMFilesSkiplistLookupBuilder( } else { _includeLower = false; } - // intentionally falls through + [[fallthrough]]; case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GE: if (isReverseOrder) { value->toVelocyPackValue(*(_upperBuilder.get())); @@ -317,7 +317,7 @@ MMFilesSkiplistInLookupBuilder::MMFilesSkiplistInLookupBuilder( } else { _includeUpper = false; } - // intentionally falls through + [[fallthrough]]; case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LE: if (isReverseOrder) { TRI_ASSERT(lower == nullptr); @@ -333,7 +333,7 @@ MMFilesSkiplistInLookupBuilder::MMFilesSkiplistInLookupBuilder( } else { _includeLower = false; } - // intentionally falls through + [[fallthrough]]; case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GE: if (isReverseOrder) { TRI_ASSERT(upper == nullptr); @@ -1115,7 +1115,7 @@ bool MMFilesSkiplistIndex::findMatchingConditions( if (first->getMember(1)->isArray()) { usesIn = true; } - // intentionally falls through + [[fallthrough]]; case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_EQ: TRI_ASSERT(conditions.size() == 1); break; diff --git a/arangod/MMFiles/MMFilesWalSlots.cpp b/arangod/MMFiles/MMFilesWalSlots.cpp index cf5f34780299..b8b34ae40bf0 100644 --- a/arangod/MMFiles/MMFilesWalSlots.cpp +++ b/arangod/MMFiles/MMFilesWalSlots.cpp @@ -554,7 +554,7 @@ int MMFilesWalSlots::closeLogfile(MMFilesWalSlot::TickType& lastCommittedTick, b // new one _logfile = nullptr; - // intentionally falls through + // intentionally falls through if } TRI_IF_FAILURE("LogfileManagerGetWriteableLogfile") { diff --git a/arangod/RestHandler/RestReplicationHandler.cpp b/arangod/RestHandler/RestReplicationHandler.cpp index 9047412275db..41be72235a50 100644 --- a/arangod/RestHandler/RestReplicationHandler.cpp +++ b/arangod/RestHandler/RestReplicationHandler.cpp @@ -957,7 +957,7 @@ Result RestReplicationHandler::processRestoreCollection(VPackSlice const& collec std::string("unable to drop collection '") + name + "': " + res.errorMessage()); } - // intentionally falls through + // intentionally falls through if } else { return Result(TRI_ERROR_ARANGO_DUPLICATE_NAME, std::string("unable to create collection '") + name + @@ -1902,8 +1902,8 @@ void RestReplicationHandler::handleCommandRestoreView() { if (view) { if (!overwrite) { generateError(GeneralResponse::responseCode(TRI_ERROR_ARANGO_DUPLICATE_NAME), - TRI_ERROR_ARANGO_DUPLICATE_NAME, - std::string("unable to restore view '") + nameSlice.copyString() + ": " + + TRI_ERROR_ARANGO_DUPLICATE_NAME, + std::string("unable to restore view '") + nameSlice.copyString() + ": " + TRI_errno_string(TRI_ERROR_ARANGO_DUPLICATE_NAME)); return; } diff --git a/arangod/V8Server/v8-collection.cpp b/arangod/V8Server/v8-collection.cpp index a795869a587f..a27beae18bff 100644 --- a/arangod/V8Server/v8-collection.cpp +++ b/arangod/V8Server/v8-collection.cpp @@ -1005,7 +1005,7 @@ static void JS_GetResponsibleShardVocbaseCol(v8::FunctionCallbackInfo if (res != TRI_ERROR_NO_ERROR) { TRI_V8_THROW_EXCEPTION(res); } - } + } if (!builder.slice().isObject()) { TRI_V8_THROW_EXCEPTION_USAGE("getResponsibleShard()"); } @@ -2112,7 +2112,7 @@ static void JS_StatusVocbaseCol(v8::FunctionCallbackInfo const& args) TRI_V8_RETURN(v8::Number::New(isolate, (int)TRI_VOC_COL_STATUS_DELETED)); } } - // intentionally falls through + // intentionally falls through if auto status = collection->status(); @@ -2196,7 +2196,7 @@ static void JS_TypeVocbaseCol(v8::FunctionCallbackInfo const& args) { TRI_V8_RETURN(v8::Number::New(isolate, (int)(collection->type()))); } } - // intentionally falls through + // intentionally falls through if auto type = collection->type(); diff --git a/arangod/V8Server/v8-user-structures.cpp b/arangod/V8Server/v8-user-structures.cpp index 21df19bda64d..ae846b040c8b 100644 --- a/arangod/V8Server/v8-user-structures.cpp +++ b/arangod/V8Server/v8-user-structures.cpp @@ -737,7 +737,7 @@ static int ObjectToJson(v8::Isolate* isolate, TRI_json_t* result, } } - // intentionally falls through + // intentionally falls through if } int hashval = o->GetIdentityHash(); diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index adc6bf563255..1a4f637b8bce 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -892,7 +892,7 @@ static void JS_QueriesPropertiesAql(v8::FunctionCallbackInfo const& a obj->Get(TRI_V8_ASCII_STRING(isolate, "maxQueryStringLength"))))); } - // intentionally falls through + // intentionally falls through if } // return current settings diff --git a/arangod/VocBase/Methods/Transactions.cpp b/arangod/VocBase/Methods/Transactions.cpp index f3304e5b5033..f22cbd2ce1e8 100644 --- a/arangod/VocBase/Methods/Transactions.cpp +++ b/arangod/VocBase/Methods/Transactions.cpp @@ -179,7 +179,7 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a std::vector exclusiveCollections; if (TRI_HasProperty(context, isolate, collections, "allowImplicit")) { - trxOptions.allowImplicitCollections = TRI_ObjectToBoolean(isolate, + trxOptions.allowImplicitCollections = TRI_ObjectToBoolean(isolate, collections->Get(TRI_V8_ASCII_STRING(isolate, "allowImplicit"))); } @@ -203,14 +203,14 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a collections.emplace_back(TRI_ObjectToString(isolate, collection)); } } else if (obj->Get(TRI_V8_ASCII_STRING(isolate, attributeName))->IsString()) { - collections.emplace_back(TRI_ObjectToString(isolate, + collections.emplace_back(TRI_ObjectToString(isolate, obj->Get(TRI_V8_ASCII_STRING(isolate, attributeName)))); } else { collectionError += std::string(" There is no array in '") + attributeName + "'"; return false; } - // intentionally falls through + // intentionally falls through if } return true; }; @@ -278,7 +278,7 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a // Invoke Function constructor to create function with the given body and the // arguments - std::string body = TRI_ObjectToString(isolate, + std::string body = TRI_ObjectToString(isolate, TRI_GetProperty(context, isolate, object, "action")); body = "return (" + body + ")(params);"; v8::Handle args[2] = {TRI_V8_ASCII_STRING(isolate, "params"), @@ -322,9 +322,9 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a auto trx = std::make_unique(ctx, readCollections, writeCollections, exclusiveCollections, trxOptions); trx->addHint(transaction::Hints::Hint::GLOBAL_MANAGED); - + rv = trx->begin(); - + if (rv.fail()) { return rv; } @@ -357,7 +357,7 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a } catch (...) { rv.reset(TRI_ERROR_INTERNAL, "caught unknown exception during transaction"); } - + rv = trx->finish(rv); // if we do not remove unused V8Cursors, V8Context might not reset global diff --git a/lib/Basics/StringUtils.cpp b/lib/Basics/StringUtils.cpp index 5bc29b098556..210bb612ea0c 100644 --- a/lib/Basics/StringUtils.cpp +++ b/lib/Basics/StringUtils.cpp @@ -855,7 +855,7 @@ std::string urlEncode(char const* src, size_t const len) { '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; char const* end = src + len; - + // cppcheck-suppress unsignedPositive if (len >= (SIZE_MAX - 1) / 3) { THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY); @@ -1434,61 +1434,61 @@ uint64_t uint64_trusted(char const* value, size_t length) { switch (length) { case 20: result += (value[length - 20] - '0') * 10000000000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 19: result += (value[length - 19] - '0') * 1000000000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 18: result += (value[length - 18] - '0') * 100000000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 17: result += (value[length - 17] - '0') * 10000000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 16: result += (value[length - 16] - '0') * 1000000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 15: result += (value[length - 15] - '0') * 100000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 14: result += (value[length - 14] - '0') * 10000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 13: result += (value[length - 13] - '0') * 1000000000000ULL; - // intentionally falls through + [[fallthrough]]; case 12: result += (value[length - 12] - '0') * 100000000000ULL; - // intentionally falls through + [[fallthrough]]; case 11: result += (value[length - 11] - '0') * 10000000000ULL; - // intentionally falls through + [[fallthrough]]; case 10: result += (value[length - 10] - '0') * 1000000000ULL; - // intentionally falls through + [[fallthrough]]; case 9: result += (value[length - 9] - '0') * 100000000ULL; - // intentionally falls through + [[fallthrough]]; case 8: result += (value[length - 8] - '0') * 10000000ULL; - // intentionally falls through + [[fallthrough]]; case 7: result += (value[length - 7] - '0') * 1000000ULL; - // intentionally falls through + [[fallthrough]]; case 6: result += (value[length - 6] - '0') * 100000ULL; - // intentionally falls through + [[fallthrough]]; case 5: result += (value[length - 5] - '0') * 10000ULL; - // intentionally falls through + [[fallthrough]]; case 4: result += (value[length - 4] - '0') * 1000ULL; - // intentionally falls through + [[fallthrough]]; case 3: result += (value[length - 3] - '0') * 100ULL; - // intentionally falls through + [[fallthrough]]; case 2: result += (value[length - 2] - '0') * 10ULL; - // intentionally falls through + [[fallthrough]]; case 1: result += (value[length - 1] - '0'); } diff --git a/lib/Basics/Utf8Helper.cpp b/lib/Basics/Utf8Helper.cpp index 8fb1ad0eef29..9608dd05e82d 100644 --- a/lib/Basics/Utf8Helper.cpp +++ b/lib/Basics/Utf8Helper.cpp @@ -825,7 +825,7 @@ char* TRI_normalize_utf16_to_NFC(uint16_t const* utf16, size_t inLength, size_t* mustFree = true; continue; } - // intentionally falls through + // intentionally falls through if } if (mustFree) { diff --git a/lib/Basics/fasthash.cpp b/lib/Basics/fasthash.cpp index 84d9dbbbfd3b..89d0846887d0 100644 --- a/lib/Basics/fasthash.cpp +++ b/lib/Basics/fasthash.cpp @@ -44,25 +44,25 @@ uint64_t fasthash64(const void* buf, size_t len, uint64_t seed) { switch (len) { case 8: v ^= (uint64_t)pos[7] << 56; - // intentionally falls through + [[fallthrough]]; case 7: v ^= (uint64_t)pos[6] << 48; - // intentionally falls through + [[fallthrough]]; case 6: v ^= (uint64_t)pos[5] << 40; - // intentionally falls through + [[fallthrough]]; case 5: v ^= (uint64_t)pos[4] << 32; - // intentionally falls through + [[fallthrough]]; case 4: v ^= (uint64_t)pos[3] << 24; - // intentionally falls through + [[fallthrough]]; case 3: v ^= (uint64_t)pos[2] << 16; - // intentionally falls through + [[fallthrough]]; case 2: v ^= (uint64_t)pos[1] << 8; - // intentionally falls through + [[fallthrough]]; case 1: v ^= (uint64_t)pos[0]; h ^= fasthash_mix(v); @@ -95,22 +95,22 @@ uint64_t fasthash64(const void* buf, size_t len, uint64_t seed) { switch (len & 7) { case 7: v ^= (uint64_t)pos2[6] << 48; - // intentionally falls through + [[fallthrough]]; case 6: v ^= (uint64_t)pos2[5] << 40; - // intentionally falls through + [[fallthrough]]; case 5: v ^= (uint64_t)pos2[4] << 32; - // intentionally falls through + [[fallthrough]]; case 4: v ^= (uint64_t)pos2[3] << 24; - // intentionally falls through + [[fallthrough]]; case 3: v ^= (uint64_t)pos2[2] << 16; - // intentionally falls through + [[fallthrough]]; case 2: v ^= (uint64_t)pos2[1] << 8; - // intentionally falls through + [[fallthrough]]; case 1: v ^= (uint64_t)pos2[0]; h ^= fasthash_mix(v); diff --git a/lib/Basics/tri-strings.cpp b/lib/Basics/tri-strings.cpp index 225f491c009d..9e2a96be6762 100644 --- a/lib/Basics/tri-strings.cpp +++ b/lib/Basics/tri-strings.cpp @@ -768,7 +768,7 @@ char* TRI_UnescapeUtf8String(char const* in, size_t inLength, size_t* outLength, TRI_Free(buffer); buffer = utf8_nfc; } - // intentionally falls through + // intentionally falls through if } return buffer; diff --git a/lib/V8/v8-buffer.cpp b/lib/V8/v8-buffer.cpp index 0535d1711a09..8eb3585b880f 100644 --- a/lib/V8/v8-buffer.cpp +++ b/lib/V8/v8-buffer.cpp @@ -1569,7 +1569,7 @@ static void MapGetIndexedBuffer(uint32_t idx, TRI_V8_RETURN(v8::Handle()); } self = TRI_GetObject(context, parent); - // intentionally falls through + // intentionally falls through if } } @@ -1603,7 +1603,7 @@ static void MapSetIndexedBuffer(uint32_t idx, v8::Local value, TRI_V8_RETURN(v8::Handle()); } self = TRI_GetObject(context, parent); - // intentionally falls through + // intentionally falls through if } } diff --git a/lib/V8/v8-buffer.h b/lib/V8/v8-buffer.h index 2c9086464e35..e5f121f41f6e 100644 --- a/lib/V8/v8-buffer.h +++ b/lib/V8/v8-buffer.h @@ -125,7 +125,7 @@ class V8Buffer : public V8Wrapper { return nullptr; } o = TRI_ToObject(context, parent); - // intentionally falls through + // intentionally falls through if } } @@ -180,7 +180,7 @@ class V8Buffer : public V8Wrapper { return 0; } o = TRI_ToObject(context, parent); - // intentionally falls through + // intentionally falls through if } } diff --git a/lib/V8/v8-vpack.cpp b/lib/V8/v8-vpack.cpp index f1b8c85c3390..a06795bfd72a 100644 --- a/lib/V8/v8-vpack.cpp +++ b/lib/V8/v8-vpack.cpp @@ -428,7 +428,7 @@ static int V8ToVPack(BuilderContext& context, v8::Handle const parame } } - // intentionally falls through + // intentionally falls through if } } From 553625ab7bf348ee787cc59d5f333b3057c09c4b Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Fri, 18 Oct 2019 21:07:23 +0200 Subject: [PATCH 2/2] remove the extra if as it requires -Wimplicit-fallthrough=2 or 1 --- arangod/Aql/AqlValue.cpp | 30 +++++++++---------- arangod/Aql/Ast.cpp | 4 +-- arangod/Aql/AstNode.cpp | 10 +++---- arangod/Aql/OptimizerRules.cpp | 10 +++---- arangod/Cluster/HeartbeatThread.cpp | 2 +- arangod/GeneralServer/HttpCommTask.cpp | 2 +- arangod/MMFiles/MMFilesCleanupThread.cpp | 2 +- arangod/MMFiles/MMFilesCollection.cpp | 4 +-- arangod/MMFiles/MMFilesDatafile.cpp | 2 +- arangod/MMFiles/MMFilesWalSlots.cpp | 2 +- .../RestHandler/RestReplicationHandler.cpp | 2 +- arangod/V8Server/v8-collection.cpp | 4 +-- arangod/V8Server/v8-user-structures.cpp | 2 +- arangod/V8Server/v8-vocbase.cpp | 2 +- arangod/VocBase/Methods/Transactions.cpp | 2 +- lib/Basics/Utf8Helper.cpp | 2 +- lib/Basics/tri-strings.cpp | 2 +- lib/V8/v8-buffer.cpp | 4 +-- lib/V8/v8-buffer.h | 4 +-- lib/V8/v8-vpack.cpp | 2 +- 20 files changed, 47 insertions(+), 47 deletions(-) diff --git a/arangod/Aql/AqlValue.cpp b/arangod/Aql/AqlValue.cpp index 9d0d2a953367..c923a0a82e81 100644 --- a/arangod/Aql/AqlValue.cpp +++ b/arangod/Aql/AqlValue.cpp @@ -263,7 +263,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { return AqlValue(s.at(position).begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: { @@ -289,7 +289,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { total += it->size(); } } - // intentionally falls through if + // intentionally falls through break; } case RANGE: { @@ -303,7 +303,7 @@ AqlValue AqlValue::at(int64_t position, bool& mustDestroy, bool doCopy) const { // only look up the value if it is within array bounds return AqlValue(AqlValueHintInt(_data.range->at(static_cast(position)))); } - // intentionally falls through if + // intentionally falls through break; } } @@ -339,7 +339,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy return AqlValue(s.at(position).begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: { @@ -364,7 +364,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy total += it->size(); } } - // intentionally falls through if + // intentionally falls through break; } case RANGE: { @@ -377,7 +377,7 @@ AqlValue AqlValue::at(int64_t position, size_t n, bool& mustDestroy, bool doCopy // only look up the value if it is within array bounds return AqlValue(AqlValueHintInt(_data.range->at(static_cast(position)))); } - // intentionally falls through if + // intentionally falls through break; } } @@ -410,7 +410,7 @@ AqlValue AqlValue::getKeyAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -454,7 +454,7 @@ AqlValue AqlValue::getIdAttribute(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -492,7 +492,7 @@ AqlValue AqlValue::getFromAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -530,7 +530,7 @@ AqlValue AqlValue::getToAttribute(bool& mustDestroy, bool doCopy) const { return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -574,7 +574,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -619,7 +619,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(found.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -692,7 +692,7 @@ AqlValue AqlValue::get(CollectionNameResolver const& resolver, return AqlValue(s.begin()); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -762,7 +762,7 @@ double AqlValue::toDouble(bool& failed) const { return at(0, mustDestroy, false).toDouble(failed); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: @@ -815,7 +815,7 @@ int64_t AqlValue::toInt64() const { return at(0, mustDestroy, false).toInt64(); } } - // intentionally falls through if + // intentionally falls through break; } case DOCVEC: diff --git a/arangod/Aql/Ast.cpp b/arangod/Aql/Ast.cpp index d3bb0e6fd490..63f9e7f6ed45 100644 --- a/arangod/Aql/Ast.cpp +++ b/arangod/Aql/Ast.cpp @@ -1794,7 +1794,7 @@ AstNode* Ast::replaceVariables(AstNode* node, node->setData((*it).second); } } - // intentionally falls through if + // intentionally falls through } return node; @@ -2925,7 +2925,7 @@ AstNode* Ast::optimizeBinaryOperatorRelational(AstNode* node) { // and optimize ourselves... return optimizeBinaryOperatorRelational(node); } - // intentionally falls through if + // intentionally falls through } bool const rhsIsConst = rhs->isConstant(); diff --git a/arangod/Aql/AstNode.cpp b/arangod/Aql/AstNode.cpp index 677e70373655..215f68581e5b 100644 --- a/arangod/Aql/AstNode.cpp +++ b/arangod/Aql/AstNode.cpp @@ -1200,7 +1200,7 @@ AstNode const* AstNode::castToBool(Ast* ast) const { default: { } } - // intentionally falls through if + // intentionally falls through } else if (type == NODE_TYPE_ARRAY) { return ast->createNodeValueBool(true); } else if (type == NODE_TYPE_OBJECT) { @@ -1241,9 +1241,9 @@ AstNode const* AstNode::castToNumber(Ast* ast) const { } return ast->createNodeValueDouble(v); } - // intentionally falls through if + // intentionally falls through } - // intentionally falls through if + // intentionally falls through } else if (type == NODE_TYPE_ARRAY) { size_t const n = numMembers(); if (n == 0) { @@ -1254,9 +1254,9 @@ AstNode const* AstNode::castToNumber(Ast* ast) const { // convert only member to number return member->castToNumber(ast); } - // intentionally falls through if + // intentionally falls through } else if (type == NODE_TYPE_OBJECT) { - // intentionally falls through if + // intentionally falls through } return ast->createNodeValueInt(0); diff --git a/arangod/Aql/OptimizerRules.cpp b/arangod/Aql/OptimizerRules.cpp index d980a9351d4e..eff2aeebb99c 100644 --- a/arangod/Aql/OptimizerRules.cpp +++ b/arangod/Aql/OptimizerRules.cpp @@ -4407,7 +4407,7 @@ void arangodb::aql::distributeFilternCalcToClusterRule(Optimizer* opt, stopSearching = true; break; } - // intentionally falls through if + // intentionally falls through } #if 0 // TODO: this is already prepared to push subqueries on the DB servers. @@ -4420,7 +4420,7 @@ void arangodb::aql::distributeFilternCalcToClusterRule(Optimizer* opt, stopSearching = true; break; } - // intentionally falls through if + // intentionally falls through } #endif // no special handling for filters here @@ -5253,7 +5253,7 @@ struct OrSimplifier { return true; } } - // intentionally falls through if + // intentionally falls through } else if (node->type == NODE_TYPE_OPERATOR_BINARY_IN) { auto lhs = node->getMember(0); auto rhs = node->getMember(1); @@ -5264,7 +5264,7 @@ struct OrSimplifier { return true; } } - // intentionally falls through if + // intentionally falls through } return false; @@ -5369,7 +5369,7 @@ struct OrSimplifier { return ast->createNodeBinaryOperator(node->type, lhsNew, rhsNew); } - // intentionally falls through if + // intentionally falls through } return const_cast(node); diff --git a/arangod/Cluster/HeartbeatThread.cpp b/arangod/Cluster/HeartbeatThread.cpp index 241686ac9b08..6f5420f0ef71 100644 --- a/arangod/Cluster/HeartbeatThread.cpp +++ b/arangod/Cluster/HeartbeatThread.cpp @@ -652,7 +652,7 @@ void HeartbeatThread::runSingleServer() { if (result.successful()) { // successful leadership takeover leader = myIdBuilder.slice(); - // intentionally falls through if to case 2 + // intentionally falls through to case 2 } else if (result.httpCode() == TRI_ERROR_HTTP_PRECONDITION_FAILED) { // we did not become leader, someone else is, response contains // current value in agency diff --git a/arangod/GeneralServer/HttpCommTask.cpp b/arangod/GeneralServer/HttpCommTask.cpp index 8113d6843cec..17e16efb0933 100644 --- a/arangod/GeneralServer/HttpCommTask.cpp +++ b/arangod/GeneralServer/HttpCommTask.cpp @@ -571,7 +571,7 @@ ResponseCode HttpCommTask::handleAuthHeader(HttpRequest& req) { return rest::ResponseCode::UNAUTHORIZED; } - // intentionally falls through if + // intentionally falls through } catch (arangodb::basics::Exception const& ex) { // translate error if (ex.code() == TRI_ERROR_USER_NOT_FOUND) { diff --git a/arangod/MMFiles/MMFilesCleanupThread.cpp b/arangod/MMFiles/MMFilesCleanupThread.cpp index 1f2b3cd27678..3a0a3d26281d 100644 --- a/arangod/MMFiles/MMFilesCleanupThread.cpp +++ b/arangod/MMFiles/MMFilesCleanupThread.cpp @@ -165,7 +165,7 @@ void MMFilesCleanupThread::cleanupCollection(arangodb::LogicalCollection* collec if (!unloadChecked && !isInShutdown) { return false; } - // intentionally falls through if + // intentionally falls through } else { // retry in next iteration unloadChecked = false; diff --git a/arangod/MMFiles/MMFilesCollection.cpp b/arangod/MMFiles/MMFilesCollection.cpp index 28439fedcd77..65df3128dff2 100644 --- a/arangod/MMFiles/MMFilesCollection.cpp +++ b/arangod/MMFiles/MMFilesCollection.cpp @@ -2540,7 +2540,7 @@ int MMFilesCollection::lockRead(bool useDeadlockDetector, LOG_TOPIC("29637", TRACE, arangodb::Logger::ENGINES) << "waiting for read-lock on collection '" << _logicalCollection.name() << "'"; - // intentionally falls through if + // intentionally falls through } else if (++iterations >= 5) { // periodically check for deadlocks TRI_ASSERT(wasBlocked); @@ -2837,7 +2837,7 @@ LocalDocumentId MMFilesCollection::reuseOrCreateLocalDocumentId(OperationOptions if (marker->hasLocalDocumentId()) { return marker->getLocalDocumentId(); } - // intentionally falls through if + // intentionally falls through } // new operation, no recovery -> generate a new LocalDocumentId diff --git a/arangod/MMFiles/MMFilesDatafile.cpp b/arangod/MMFiles/MMFilesDatafile.cpp index 60e78ee5bab5..ecb499958567 100644 --- a/arangod/MMFiles/MMFilesDatafile.cpp +++ b/arangod/MMFiles/MMFilesDatafile.cpp @@ -520,7 +520,7 @@ int MMFilesDatafile::reserveElement(uint32_t size, MMFilesMarker** position, return TRI_ERROR_ARANGO_DOCUMENT_TOO_LARGE; } - // intentionally falls through if + // intentionally falls through } // add the marker, leave enough room for the footer diff --git a/arangod/MMFiles/MMFilesWalSlots.cpp b/arangod/MMFiles/MMFilesWalSlots.cpp index b8b34ae40bf0..cf5f34780299 100644 --- a/arangod/MMFiles/MMFilesWalSlots.cpp +++ b/arangod/MMFiles/MMFilesWalSlots.cpp @@ -554,7 +554,7 @@ int MMFilesWalSlots::closeLogfile(MMFilesWalSlot::TickType& lastCommittedTick, b // new one _logfile = nullptr; - // intentionally falls through if + // intentionally falls through } TRI_IF_FAILURE("LogfileManagerGetWriteableLogfile") { diff --git a/arangod/RestHandler/RestReplicationHandler.cpp b/arangod/RestHandler/RestReplicationHandler.cpp index 41be72235a50..076101071b85 100644 --- a/arangod/RestHandler/RestReplicationHandler.cpp +++ b/arangod/RestHandler/RestReplicationHandler.cpp @@ -957,7 +957,7 @@ Result RestReplicationHandler::processRestoreCollection(VPackSlice const& collec std::string("unable to drop collection '") + name + "': " + res.errorMessage()); } - // intentionally falls through if + // intentionally falls through } else { return Result(TRI_ERROR_ARANGO_DUPLICATE_NAME, std::string("unable to create collection '") + name + diff --git a/arangod/V8Server/v8-collection.cpp b/arangod/V8Server/v8-collection.cpp index a27beae18bff..c78ad87bb76e 100644 --- a/arangod/V8Server/v8-collection.cpp +++ b/arangod/V8Server/v8-collection.cpp @@ -2112,7 +2112,7 @@ static void JS_StatusVocbaseCol(v8::FunctionCallbackInfo const& args) TRI_V8_RETURN(v8::Number::New(isolate, (int)TRI_VOC_COL_STATUS_DELETED)); } } - // intentionally falls through if + // intentionally falls through auto status = collection->status(); @@ -2196,7 +2196,7 @@ static void JS_TypeVocbaseCol(v8::FunctionCallbackInfo const& args) { TRI_V8_RETURN(v8::Number::New(isolate, (int)(collection->type()))); } } - // intentionally falls through if + // intentionally falls through auto type = collection->type(); diff --git a/arangod/V8Server/v8-user-structures.cpp b/arangod/V8Server/v8-user-structures.cpp index ae846b040c8b..21df19bda64d 100644 --- a/arangod/V8Server/v8-user-structures.cpp +++ b/arangod/V8Server/v8-user-structures.cpp @@ -737,7 +737,7 @@ static int ObjectToJson(v8::Isolate* isolate, TRI_json_t* result, } } - // intentionally falls through if + // intentionally falls through } int hashval = o->GetIdentityHash(); diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 1a4f637b8bce..adc6bf563255 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -892,7 +892,7 @@ static void JS_QueriesPropertiesAql(v8::FunctionCallbackInfo const& a obj->Get(TRI_V8_ASCII_STRING(isolate, "maxQueryStringLength"))))); } - // intentionally falls through if + // intentionally falls through } // return current settings diff --git a/arangod/VocBase/Methods/Transactions.cpp b/arangod/VocBase/Methods/Transactions.cpp index f22cbd2ce1e8..8ce03d2c21b6 100644 --- a/arangod/VocBase/Methods/Transactions.cpp +++ b/arangod/VocBase/Methods/Transactions.cpp @@ -210,7 +210,7 @@ Result executeTransactionJS(v8::Isolate* isolate, v8::Handle const& a std::string(" There is no array in '") + attributeName + "'"; return false; } - // intentionally falls through if + // intentionally falls through } return true; }; diff --git a/lib/Basics/Utf8Helper.cpp b/lib/Basics/Utf8Helper.cpp index 9608dd05e82d..8fb1ad0eef29 100644 --- a/lib/Basics/Utf8Helper.cpp +++ b/lib/Basics/Utf8Helper.cpp @@ -825,7 +825,7 @@ char* TRI_normalize_utf16_to_NFC(uint16_t const* utf16, size_t inLength, size_t* mustFree = true; continue; } - // intentionally falls through if + // intentionally falls through } if (mustFree) { diff --git a/lib/Basics/tri-strings.cpp b/lib/Basics/tri-strings.cpp index 9e2a96be6762..225f491c009d 100644 --- a/lib/Basics/tri-strings.cpp +++ b/lib/Basics/tri-strings.cpp @@ -768,7 +768,7 @@ char* TRI_UnescapeUtf8String(char const* in, size_t inLength, size_t* outLength, TRI_Free(buffer); buffer = utf8_nfc; } - // intentionally falls through if + // intentionally falls through } return buffer; diff --git a/lib/V8/v8-buffer.cpp b/lib/V8/v8-buffer.cpp index 8eb3585b880f..0535d1711a09 100644 --- a/lib/V8/v8-buffer.cpp +++ b/lib/V8/v8-buffer.cpp @@ -1569,7 +1569,7 @@ static void MapGetIndexedBuffer(uint32_t idx, TRI_V8_RETURN(v8::Handle()); } self = TRI_GetObject(context, parent); - // intentionally falls through if + // intentionally falls through } } @@ -1603,7 +1603,7 @@ static void MapSetIndexedBuffer(uint32_t idx, v8::Local value, TRI_V8_RETURN(v8::Handle()); } self = TRI_GetObject(context, parent); - // intentionally falls through if + // intentionally falls through } } diff --git a/lib/V8/v8-buffer.h b/lib/V8/v8-buffer.h index e5f121f41f6e..2c9086464e35 100644 --- a/lib/V8/v8-buffer.h +++ b/lib/V8/v8-buffer.h @@ -125,7 +125,7 @@ class V8Buffer : public V8Wrapper { return nullptr; } o = TRI_ToObject(context, parent); - // intentionally falls through if + // intentionally falls through } } @@ -180,7 +180,7 @@ class V8Buffer : public V8Wrapper { return 0; } o = TRI_ToObject(context, parent); - // intentionally falls through if + // intentionally falls through } } diff --git a/lib/V8/v8-vpack.cpp b/lib/V8/v8-vpack.cpp index a06795bfd72a..f1b8c85c3390 100644 --- a/lib/V8/v8-vpack.cpp +++ b/lib/V8/v8-vpack.cpp @@ -428,7 +428,7 @@ static int V8ToVPack(BuilderContext& context, v8::Handle const parame } } - // intentionally falls through if + // intentionally falls through } }