diff --git a/src/compiler/asserts.cpp b/src/compiler/asserts.cpp index 51a052b0..b3e89a3a 100644 --- a/src/compiler/asserts.cpp +++ b/src/compiler/asserts.cpp @@ -251,6 +251,7 @@ void checkForMultilineStart(ReportManager &rm, NGHolder &g, static bool hasAssertVertices(const NGHolder &g) { + // cppcheck-suppress useStlAlgorithm for (auto v : vertices_range(g)) { int flags = g[v].assert_flags; if (flags & WORDBOUNDARY_FLAGS) { diff --git a/src/fdr/fdr_compile.cpp b/src/fdr/fdr_compile.cpp index d15e4537..f087e958 100644 --- a/src/fdr/fdr_compile.cpp +++ b/src/fdr/fdr_compile.cpp @@ -136,6 +136,7 @@ void FDRCompiler::createInitialState(FDR *fdr) { const vector &bucket_lits = bucketToLits[b]; u32 min_len = ~0U; for (const LiteralIndex &lit_idx : bucket_lits) { + // cppcheck-suppress useStlAlgorithm min_len = min(min_len, verify_u32(lits[lit_idx].s.length())); } diff --git a/src/fdr/fdr_confirm_compile.cpp b/src/fdr/fdr_confirm_compile.cpp index 75b237b0..edd68e0b 100644 --- a/src/fdr/fdr_confirm_compile.cpp +++ b/src/fdr/fdr_confirm_compile.cpp @@ -303,6 +303,7 @@ setupFullConfs(const vector &lits, if (contains(bucketToLits, b)) { vector vl; for (const LiteralIndex &lit_idx : bucketToLits.at(b)) { + // cppcheck-suppress useStlAlgorithm vl.emplace_back(lits[lit_idx]); } diff --git a/src/fdr/teddy_engine_description.cpp b/src/fdr/teddy_engine_description.cpp index 7cd33ab2..47c79ef4 100644 --- a/src/fdr/teddy_engine_description.cpp +++ b/src/fdr/teddy_engine_description.cpp @@ -71,6 +71,7 @@ void getTeddyDescriptions(vector *out) { }; out->clear(); for (const auto &def : defns) { + // cppcheck-suppress useStlAlgorithm out->emplace_back(def); } } @@ -123,6 +124,7 @@ bool isAllowed(const vector &vl, const TeddyEngineDescription &eng, u32 n_small_lits = 0; for (const auto &lit : vl) { if (lit.s.length() < eng.numMasks) { + // cppcheck-suppress useStlAlgorithm n_small_lits++; } } @@ -204,6 +206,7 @@ unique_ptr getTeddyDescription(u32 engineID) { getTeddyDescriptions(&descs); for (const auto &desc : descs) { + // cppcheck-suppress useStlAlgorithm if (desc.getID() == engineID) { return std::make_unique(desc); } diff --git a/src/nfa/accel_dfa_build_strat.cpp b/src/nfa/accel_dfa_build_strat.cpp index 7139d5be..6a848812 100644 --- a/src/nfa/accel_dfa_build_strat.cpp +++ b/src/nfa/accel_dfa_build_strat.cpp @@ -182,6 +182,7 @@ vector> generate_paths(const raw_dfa &rdfa, vector> rv; rv.reserve(paths.size()); for (auto &p : paths) { + // cppcheck-suppress useStlAlgorithm rv.emplace_back(vector(std::make_move_iterator(p.reach.begin()), std::make_move_iterator(p.reach.end()))); } diff --git a/src/nfa/castlecompile.cpp b/src/nfa/castlecompile.cpp index 56b12700..2b157d1c 100644 --- a/src/nfa/castlecompile.cpp +++ b/src/nfa/castlecompile.cpp @@ -672,6 +672,7 @@ set all_reports(const CastleProto &proto) { depth findMinWidth(const CastleProto &proto) { depth min_width(depth::infinity()); for (const PureRepeat &pr : proto.repeats | map_values) { + // cppcheck-suppress useStlAlgorithm min_width = min(min_width, pr.bounds.min); } return min_width; @@ -680,6 +681,7 @@ depth findMinWidth(const CastleProto &proto) { depth findMaxWidth(const CastleProto &proto) { depth max_width(0); for (const PureRepeat &pr : proto.repeats | map_values) { + // cppcheck-suppress useStlAlgorithm max_width = max(max_width, pr.bounds.max); } return max_width; @@ -746,6 +748,7 @@ u32 CastleProto::merge(const PureRepeat &pr) { // First, see if this repeat is already in this castle. for (const auto &m : repeats) { + // cppcheck-suppress useStlAlgorithm if (m.second == pr) { DEBUG_PRINTF("repeat already present, with top %u\n", m.first); return m.first; @@ -970,6 +973,7 @@ void addToHolder(NGHolder &g, u32 top, const PureRepeat &pr) { static bool hasZeroMinBound(const CastleProto &proto) { const depth zero(0); + // cppcheck-suppress useStlAlgorithm for (const PureRepeat &pr : proto.repeats | map_values) { if (pr.bounds.min == zero) { return true; diff --git a/src/nfa/dfa_min.cpp b/src/nfa/dfa_min.cpp index 757fffbe..2d251a89 100644 --- a/src/nfa/dfa_min.cpp +++ b/src/nfa/dfa_min.cpp @@ -263,6 +263,7 @@ void mapping_new_states(const HopcroftInfo &info, new_states.reserve(num_partitions); for (const auto &m : ordering) { + // cppcheck-suppress useStlAlgorithm new_states.emplace_back(rdfa.states[m.first]); } rdfa.states = std::move(new_states); diff --git a/src/nfa/goughcompile.cpp b/src/nfa/goughcompile.cpp index 59ef052f..e3f0a710 100644 --- a/src/nfa/goughcompile.cpp +++ b/src/nfa/goughcompile.cpp @@ -650,6 +650,7 @@ void GoughSSAVarJoin::generate(UNUSED vector *out) const { GoughSSAVar *GoughSSAVarJoin::get_input(const GoughEdge &prev) const { for (const auto &var_edge : input_map) { + // cppcheck-suppress useStlAlgorithm if (contains(var_edge.second, prev)) { return var_edge.first; } @@ -992,6 +993,7 @@ void copy_in_blocks(raw_som_dfa &raw, u8 alphaShift, const GoughGraph &cfg, } bool find_normal_self_loop(GoughVertex v, const GoughGraph &g, GoughEdge *out) { + // cppcheck-suppress useStlAlgorithm for (const auto &e : out_edges_range(v, g)) { if (target(e, g) != v) { continue; diff --git a/src/nfa/goughcompile_accel.cpp b/src/nfa/goughcompile_accel.cpp index 849202a1..2a1dba66 100644 --- a/src/nfa/goughcompile_accel.cpp +++ b/src/nfa/goughcompile_accel.cpp @@ -146,6 +146,7 @@ bool verify_neighbour(const GoughGraph &g, GoughVertex u, const map > &blocks, const set &succs, const vector &block_sl) { + // cppcheck-suppress useStlAlgorithm for (const auto &e : out_edges_range(u, g)) { if (!g[e].reach.any()) { /* ignore top edges */ continue; @@ -172,6 +173,7 @@ static bool verify_neighbour_no_block(const GoughGraph &g, GoughVertex u, const map > &blocks, const set &succs) { + // cppcheck-suppress useStlAlgorithm for (const auto &e : out_edges_range(u, g)) { if (!g[e].reach.any()) { /* ignore top edges */ continue; @@ -229,6 +231,7 @@ bool allow_two_byte_accel(const GoughGraph &g, succs.insert(target(e, g)); } + // cppcheck-suppress useStlAlgorithm for (auto w : adjacent_vertices_range(v, g)) { if (w != v && !verify_neighbour(g, w, blocks, succs, block_sl)) { return false; @@ -249,6 +252,7 @@ bool allow_two_byte_accel(const GoughGraph &g, } succs.insert(target(e, g)); + // cppcheck-suppress useStlAlgorithm for (auto w : adjacent_vertices_range(v, g)) { if (w != v && !verify_neighbour_no_block(g, w, blocks, succs)) { return false; diff --git a/src/nfa/goughcompile_reg.cpp b/src/nfa/goughcompile_reg.cpp index d088e1c0..6096d9f7 100644 --- a/src/nfa/goughcompile_reg.cpp +++ b/src/nfa/goughcompile_reg.cpp @@ -50,6 +50,7 @@ namespace ue2 { template void emplace_back_all_raw(vector *out, const vector &in) { + // cppcheck-suppress useStlAlgorithm for (const auto &var : in) { out->emplace_back(var.get()); } @@ -380,6 +381,7 @@ template void add_to_dom_ordering(const vector &vars, vector *out) { for (const auto &var : vars) { + // cppcheck-suppress useStlAlgorithm out->emplace_back(var.get()); } } diff --git a/src/nfa/limex_compile.cpp b/src/nfa/limex_compile.cpp index f84cdc32..54859f6a 100644 --- a/src/nfa/limex_compile.cpp +++ b/src/nfa/limex_compile.cpp @@ -482,6 +482,7 @@ bool allow_wide_accel(NFAVertex v, const NGHolder &g, NFAVertex sds_or_proxy) { static bool allow_wide_accel(const vector &vv, const NGHolder &g, NFAVertex sds_or_proxy) { + // cppcheck-suppress useStlAlgorithm for (auto v : vv) { if (allow_wide_accel(v, g, sds_or_proxy)) { return true; @@ -623,6 +624,7 @@ void fillAccelInfo(build_info &bi) { vector astates; for (const auto &m : accel_map) { + // cppcheck-suppress useStlAlgorithm astates.emplace_back(m.first); } @@ -799,12 +801,14 @@ u32 getEffectiveAccelStates(const build_info &args, continue; } for (const auto &s_mask : args.squashMap | map_values) { + // cppcheck-suppress useStlAlgorithm if (!s_mask.test(state_id)) { may_turn_off |= 1U << accel_id; break; } } for (const auto &s_mask : args.reportSquashMap | map_values) { + // cppcheck-suppress useStlAlgorithm if (!s_mask.test(state_id)) { may_turn_off |= 1U << accel_id; break; diff --git a/src/nfa/mcclellancompile.cpp b/src/nfa/mcclellancompile.cpp index 36545e98..c731e3f0 100644 --- a/src/nfa/mcclellancompile.cpp +++ b/src/nfa/mcclellancompile.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -529,10 +530,15 @@ size_t calcWideRegionSize(const dfa_info &info) { size_t rv = info.wide_symbol_chain.size() * sizeof(u32) + 4; // wide info body - for (const auto &chain : info.wide_symbol_chain) { - rv += ROUNDUP_N(chain.size(), 2) + - (info.impl_alpha_size + 1) * sizeof(u16) + 2; - } + auto chainz = [info=info](size_t z, const vector &chain) { + return z + (size_t)(ROUNDUP_N(chain.size(), 2) + + (info.impl_alpha_size + 1) * sizeof(u16) + 2); + }; + rv += std::accumulate(info.wide_symbol_chain.begin(), info.wide_symbol_chain.end(), 0, chainz); + // for (const auto &chain : info.wide_symbol_chain) { + // rv += ROUNDUP_N(chain.size(), 2) + + // (info.impl_alpha_size + 1) * sizeof(u16) + 2; + // } return ROUNDUP_16(rv); } diff --git a/src/nfa/mcclellancompile_util.cpp b/src/nfa/mcclellancompile_util.cpp index d0df0319..44831b3d 100644 --- a/src/nfa/mcclellancompile_util.cpp +++ b/src/nfa/mcclellancompile_util.cpp @@ -265,6 +265,7 @@ bool can_die_early(const raw_dfa &raw, dstate_id_t s, } for (const auto &next : raw.states[s].next) { + // cppcheck-suppress useStlAlgorithm if (can_die_early(raw, next, visited, age_limit - 1)) { return true; } diff --git a/src/nfa/shufticompile.cpp b/src/nfa/shufticompile.cpp index 5385a8ce..58201a87 100644 --- a/src/nfa/shufticompile.cpp +++ b/src/nfa/shufticompile.cpp @@ -182,6 +182,7 @@ bool shuftiBuildDoubleMasks(const CharReach &onechar, } nibble_masks.clear(); for (const auto &e : new_masks) { + // cppcheck-suppress useStlAlgorithm nibble_masks.emplace_back(e.second); } } diff --git a/src/nfa/tamaramacompile.cpp b/src/nfa/tamaramacompile.cpp index 6f8c3dbe..d4dd4ab0 100644 --- a/src/nfa/tamaramacompile.cpp +++ b/src/nfa/tamaramacompile.cpp @@ -42,6 +42,8 @@ #include "util/container.h" #include "util/verify_types.h" +#include + using namespace std; namespace ue2 { @@ -127,9 +129,14 @@ buildTamarama(const TamaInfo &tamaInfo, const u32 queue, sizeof(u32) * subSize + 64; // offsets to subengines in bytecode and // padding for subengines - for (const auto &sub : tamaInfo.subengines) { - total_size += ROUNDUP_CL(sub->length); - } + + auto subl = [](size_t z, NFA *sub) { + return z + (size_t)(ROUNDUP_CL(sub->length)); + }; + total_size += std::accumulate(tamaInfo.subengines.begin(), tamaInfo.subengines.end(), 0, subl); + // for (const auto &sub : tamaInfo.subengines) { + // total_size += ROUNDUP_CL(sub->length); + // } // use subSize as a sentinel value for no active subengines, // so add one to subSize here diff --git a/src/nfagraph/ng_anchored_dots.cpp b/src/nfagraph/ng_anchored_dots.cpp index 9a13376d..a2aaeb36 100644 --- a/src/nfagraph/ng_anchored_dots.cpp +++ b/src/nfagraph/ng_anchored_dots.cpp @@ -137,6 +137,7 @@ NFAVertex findReformable(const NGHolder &g, const set &starts, static bool isStartNode(NFAVertex v, NFAVertex start, const NGHolder &g, bool selfLoopIsAcceptable) { + // cppcheck-suppress useStlAlgorithm for (auto u : inv_adjacent_vertices_range(v, g)) { if (selfLoopIsAcceptable && u == v) { continue; @@ -307,6 +308,7 @@ void reformUnanchoredRepeatsComponent(NGHolder &g, } for (auto v : otherV) { + // cppcheck-suppress useStlAlgorithm if (!edge(dotV, v, g).second) { return; } @@ -441,6 +443,7 @@ bool gatherParticipants(const NGHolder &g, /* All the non chained v connected to start must be in succ as well * TODO: remember why (and document). */ + // cppcheck-suppress useStlAlgorithm for (auto u : adjacent_vertices_range(start, g)) { if (is_special(u, g)) { continue; diff --git a/src/nfagraph/ng_calc_components.cpp b/src/nfagraph/ng_calc_components.cpp index c5e93cc0..995d0904 100644 --- a/src/nfagraph/ng_calc_components.cpp +++ b/src/nfagraph/ng_calc_components.cpp @@ -77,17 +77,20 @@ static constexpr u32 MAX_TAIL_SHELL_DEPTH = 3; * classes. */ bool isAlternationOfClasses(const NGHolder &g) { + // cppcheck-suppress useStlAlgorithm for (auto v : vertices_range(g)) { if (is_special(v, g)) { continue; } // Vertex must have in edges from starts only. + // cppcheck-suppress useStlAlgorithm for (auto u : inv_adjacent_vertices_range(v, g)) { if (!is_any_start(u, g)) { return false; } } // Vertex must have out edges to accepts only. + // cppcheck-suppress useStlAlgorithm for (auto w : adjacent_vertices_range(v, g)) { if (!is_any_accept(w, g)) { return false; diff --git a/src/nfagraph/ng_depth.cpp b/src/nfagraph/ng_depth.cpp index 6c90326c..572ba9ac 100644 --- a/src/nfagraph/ng_depth.cpp +++ b/src/nfagraph/ng_depth.cpp @@ -157,6 +157,7 @@ vector findLoopReachable(const Graph &g, for (auto v : reverse(topoOrder)) { for (const auto &e : in_edges_range(v, g)) { + // cppcheck-suppress useStlAlgorithm if (deadNodes[g[source(e, g)].index]) { deadNodes[g[v].index] = true; break; diff --git a/src/nfagraph/ng_edge_redundancy.cpp b/src/nfagraph/ng_edge_redundancy.cpp index d6e9895b..e48ebb96 100644 --- a/src/nfagraph/ng_edge_redundancy.cpp +++ b/src/nfagraph/ng_edge_redundancy.cpp @@ -63,6 +63,7 @@ bool checkVerticesFwd(const NGHolder &g, const set &sad, for (auto u : sad) { bool ok = false; for (auto v : adjacent_vertices_range(u, g)) { + // cppcheck-suppress useStlAlgorithm if (contains(happy, v)) { ok = true; break; @@ -85,6 +86,7 @@ bool checkVerticesRev(const NGHolder &g, const set &sad, for (auto v : sad) { bool ok = false; for (auto u : inv_adjacent_vertices_range(v, g)) { + // cppcheck-suppress useStlAlgorithm if (contains(happy, u)) { ok = true; break; diff --git a/src/nfagraph/ng_equivalence.cpp b/src/nfagraph/ng_equivalence.cpp index 7bfe3c93..cddc5d68 100644 --- a/src/nfagraph/ng_equivalence.cpp +++ b/src/nfagraph/ng_equivalence.cpp @@ -197,6 +197,7 @@ bool outIsIrreducible(NFAVertex &v, const NGHolder &g) { unsigned nonSpecialVertices = 0; for (auto w : adjacent_vertices_range(v, g)) { if (!is_special(w, g) && w != v) { + // cppcheck-suppress useStlAlgorithm nonSpecialVertices++; } } @@ -208,6 +209,7 @@ bool inIsIrreducible(NFAVertex &v, const NGHolder &g) { unsigned nonSpecialVertices = 0; for (auto u : inv_adjacent_vertices_range(v, g)) { if (!is_special(u, g) && u != v) { + // cppcheck-suppress useStlAlgorithm nonSpecialVertices++; } } diff --git a/src/nfagraph/ng_expr_info.cpp b/src/nfagraph/ng_expr_info.cpp index 4d467833..7283060e 100644 --- a/src/nfagraph/ng_expr_info.cpp +++ b/src/nfagraph/ng_expr_info.cpp @@ -131,6 +131,7 @@ void checkVertex(const ReportManager &rm, const NGHolder &g, NFAVertex v, static bool hasOffsetAdjust(const ReportManager &rm, const NGHolder &g) { + // cppcheck-suppress useStlAlgorithm for (const auto &report_id : all_reports(g)) { if (rm.getReport(report_id).offsetAdjust) { return true; diff --git a/src/nfagraph/ng_extparam.cpp b/src/nfagraph/ng_extparam.cpp index 65e30a14..66f8dd26 100644 --- a/src/nfagraph/ng_extparam.cpp +++ b/src/nfagraph/ng_extparam.cpp @@ -75,6 +75,7 @@ bool hasSameBounds(const Container &reports, const ReportManager &rm) { assert(!reports.empty()); const auto &first = rm.getReport(*reports.begin()); + // cppcheck-suppress useStlAlgorithm for (auto id : reports) { const auto &report = rm.getReport(id); if (report.minOffset != first.minOffset || @@ -225,6 +226,7 @@ void updateReportBounds(ReportManager &rm, NGHolder &g, static bool hasVirtualStarts(const NGHolder &g) { + // cppcheck-suppress useStlAlgorithm for (auto v : adjacent_vertices_range(g.start, g)) { if (g[v].assert_flags & POS_FLAG_VIRTUAL_START) { return true; @@ -439,6 +441,7 @@ bool hasOffsetAdjust(const ReportManager &rm, NGHolder &g, } int offsetAdjust = rm.getReport(*reports.begin()).offsetAdjust; + // cppcheck-suppress useStlAlgorithm for (auto report : reports) { const Report &ir = rm.getReport(report); if (ir.offsetAdjust != offsetAdjust) { diff --git a/src/nfagraph/ng_fuzzy.cpp b/src/nfagraph/ng_fuzzy.cpp index 78fd8629..397e385f 100644 --- a/src/nfagraph/ng_fuzzy.cpp +++ b/src/nfagraph/ng_fuzzy.cpp @@ -673,6 +673,7 @@ void validate_fuzzy_compile(const NGHolder &g, u32 edit_distance, bool hamming, } // graph isn't fuzzable if there are edge assertions anywhere in the graph for (auto e : edges_range(g)) { + // cppcheck-suppress useStlAlgorithm if (g[e].assert_flags) { throw CompileError("Zero-width assertions are disallowed for " "approximate matching."); diff --git a/src/nfagraph/ng_haig.cpp b/src/nfagraph/ng_haig.cpp index bf951a0b..ae0033ea 100644 --- a/src/nfagraph/ng_haig.cpp +++ b/src/nfagraph/ng_haig.cpp @@ -453,6 +453,7 @@ void haig_do_preds(const NGHolder &g, const stateset &nfa_states, DEBUG_PRINTF("d vertex %zu\n", g[v].index); vector &out_map = preds[slot_id]; for (auto u : inv_adjacent_vertices_range(v, g)) { + // cppcheck-suppress useStlAlgorithm out_map.emplace_back(g[u].index); } diff --git a/src/nfagraph/ng_is_equal.cpp b/src/nfagraph/ng_is_equal.cpp index ca6e30b3..16e49cd0 100644 --- a/src/nfagraph/ng_is_equal.cpp +++ b/src/nfagraph/ng_is_equal.cpp @@ -172,9 +172,11 @@ bool is_equal_i(const NGHolder &a, const NGHolder &b, vector>> top_b; for (const auto &e : out_edges_range(a.start, a)) { + // cppcheck-suppress useStlAlgorithm top_a.emplace_back(a[target(e, a)].index, a[e].tops); } for (const auto &e : out_edges_range(b.start, b)) { + // cppcheck-suppress useStlAlgorithm top_b.emplace_back(b[target(e, b)].index, b[e].tops); } diff --git a/src/nfagraph/ng_literal_analysis.cpp b/src/nfagraph/ng_literal_analysis.cpp index 77964b81..ee3870dd 100644 --- a/src/nfagraph/ng_literal_analysis.cpp +++ b/src/nfagraph/ng_literal_analysis.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -359,6 +360,7 @@ u64a litUniqueness(const string &s) { static u64a litCountBits(const ue2_literal &lit) { u64a n = 0; + // cppcheck-suppress useStlAlgorithm for (const auto &c : lit) { n += c.nocase ? 7 : 8; } @@ -670,10 +672,11 @@ u64a scoreSet(const set &s) { } u64a score = 1ULL; - - for (const auto &lit : s) { - score += calculateScore(lit); - } + auto cscore = [](u64a z, const ue2_literal &lit) { return z + calculateScore(lit); }; + score += std::accumulate(s.begin(), s.end(), 0, cscore); + // for (const auto &lit : s) { + // score += calculateScore(lit); + // } return score; } diff --git a/src/nfagraph/ng_region.h b/src/nfagraph/ng_region.h index a4708a58..9f53a0e4 100644 --- a/src/nfagraph/ng_region.h +++ b/src/nfagraph/ng_region.h @@ -141,12 +141,14 @@ bool isRegionExit(const Graph &g, NFAVertex v, template bool isSingletonRegion(const Graph &g, NFAVertex v, const std::unordered_map ®ion_map) { + // cppcheck-suppress useStlAlgorithm for (const auto &e : in_edges_range(v, g)) { auto u = source(e, g); if (u != v && inSameRegion(g, v, u, region_map)) { return false; } + // cppcheck-suppress useStlAlgorithm for (auto w : ue2::adjacent_vertices_range(u, g)) { if (w != v && inSameRegion(g, v, w, region_map)) { return false; @@ -154,11 +156,13 @@ bool isSingletonRegion(const Graph &g, NFAVertex v, } } + // cppcheck-suppress useStlAlgorithm for (auto w : adjacent_vertices_range(v, g)) { if (w != v && inSameRegion(g, v, w, region_map)) { return false; } + // cppcheck-suppress useStlAlgorithm for (const auto &e : in_edges_range(w, g)) { auto u = source(e, g); if (u != v && inSameRegion(g, v, u, region_map)) { @@ -201,7 +205,7 @@ bool isOptionalRegion(const Graph &g, NFAVertex v, DEBUG_PRINTF(" searching from u=%zu\n", g[u].index); assert(inEarlierRegion(g, v, u, region_map)); - + // cppcheck-suppress useStlAlgorithm for (auto w : adjacent_vertices_range(u, g)) { DEBUG_PRINTF(" searching to w=%zu\n", g[w].index); if (inLaterRegion(g, v, w, region_map)) { diff --git a/src/util/bitfield.h b/src/util/bitfield.h index 4a3fbd6e..14da9967 100644 --- a/src/util/bitfield.h +++ b/src/util/bitfield.h @@ -200,6 +200,8 @@ public: /// Are no bits set? bool none() const { + // cppcheck-suppress useStlAlgorithm + // XXX maybe do this one.. for (const auto &e : bits) { if (e != 0) { return false; diff --git a/src/util/ue2_graph.h b/src/util/ue2_graph.h index aa9718d7..bff49566 100644 --- a/src/util/ue2_graph.h +++ b/src/util/ue2_graph.h @@ -616,12 +616,14 @@ public: vertex_descriptor v) const { if (in_degree_impl(v) < out_degree_impl(u)) { for (const edge_descriptor &e : in_edges_range(v, *this)) { + // cppcheck-suppress useStlAlgorithm if (source_impl(e) == u) { return {e, true}; } } } else { for (const edge_descriptor &e : out_edges_range(u, *this)) { + // cppcheck-suppress useStlAlgorithm if (target_impl(e) == v) { return {e, true}; }