diff --git a/src/nfagraph/ng_limex_accel.cpp b/src/nfagraph/ng_limex_accel.cpp index 8bac753d..ac5174f3 100644 --- a/src/nfagraph/ng_limex_accel.cpp +++ b/src/nfagraph/ng_limex_accel.cpp @@ -321,7 +321,7 @@ struct DAccelScheme { bool cd_a = buildDvermMask(a.double_byte); bool cd_b = buildDvermMask(b.double_byte); if (cd_a != cd_b) { - return cd_a > cd_b; + return cd_a; } } diff --git a/src/nfagraph/ng_squash.cpp b/src/nfagraph/ng_squash.cpp index 0b51792b..b06a7af0 100644 --- a/src/nfagraph/ng_squash.cpp +++ b/src/nfagraph/ng_squash.cpp @@ -589,7 +589,7 @@ void getHighlanderReporters(const NGHolder &g, const NFAVertex accept, verts.insert(v); next_vertex: - continue; + ; } } diff --git a/src/nfagraph/ng_util.h b/src/nfagraph/ng_util.h index a2d0d9b7..34199773 100644 --- a/src/nfagraph/ng_util.h +++ b/src/nfagraph/ng_util.h @@ -314,7 +314,7 @@ void duplicateReport(NGHolder &g, ReportID r_old, ReportID r_new); /** Construct a reversed copy of an arbitrary NGHolder, mapping starts to * accepts. */ -void reverseHolder(const NGHolder &g, NGHolder &out); +void reverseHolder(const NGHolder &g_in, NGHolder &g); /** \brief Returns the delay or ~0U if the graph cannot match with * the trailing literal. */ diff --git a/src/parser/logical_combination.cpp b/src/parser/logical_combination.cpp index b75ca34f..a37f4e5f 100644 --- a/src/parser/logical_combination.cpp +++ b/src/parser/logical_combination.cpp @@ -284,7 +284,7 @@ void ParsedLogical::parseLogicalCombination(unsigned id, const char *logical, if (logical[i] == '(') { paren += 1; } else if (logical[i] == ')') { - if (paren <= 0) { + if (paren == 0) { throw LocatedParseError("Not enough left parentheses"); } paren -= 1; diff --git a/src/rose/rose_build_merge.cpp b/src/rose/rose_build_merge.cpp index cddbb760..1e6c9222 100644 --- a/src/rose/rose_build_merge.cpp +++ b/src/rose/rose_build_merge.cpp @@ -1599,7 +1599,8 @@ void dedupeLeftfixesVariableLag(RoseBuildImpl &build) { continue; } } - engine_groups[DedupeLeftKey(build, std::move(preds), left)].emplace_back(left); + auto preds_copy = std::move(preds); + engine_groups[DedupeLeftKey(build, preds_copy , left)].emplace_back(left); } /* We don't bother chunking as we expect deduping to be successful if the diff --git a/src/util/alloc.cpp b/src/util/alloc.cpp index 40004932..fb20f3d3 100644 --- a/src/util/alloc.cpp +++ b/src/util/alloc.cpp @@ -68,7 +68,7 @@ namespace ue2 { #endif void *aligned_malloc_internal(size_t size, size_t align) { - void *mem; + void *mem= nullptr;; int rv = posix_memalign(&mem, align, size); if (rv != 0) { DEBUG_PRINTF("posix_memalign returned %d when asked for %zu bytes\n", diff --git a/src/util/graph_small_color_map.h b/src/util/graph_small_color_map.h index 249b7153..a85f4b77 100644 --- a/src/util/graph_small_color_map.h +++ b/src/util/graph_small_color_map.h @@ -102,10 +102,10 @@ public: using category = boost::read_write_property_map_tag; small_color_map(size_t n_in, const IndexMap &index_map_in) - : n(n_in), index_map(index_map_in) { - size_t num_bytes = (n + entries_per_byte - 1) / entries_per_byte; - data = std::make_shared>(num_bytes); - fill(small_color::white); + : n(n_in), + index_map(index_map_in), + data(std::make_shared>((n_in + entries_per_byte - 1) / entries_per_byte)) { + fill(small_color::white); } void fill(small_color color) {