mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Merge pull request #254 from gtsoul-tech/bug/cppcheckErrors
Bug/cppcheck errors WIP
This commit is contained in:
commit
08942348c6
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ void getHighlanderReporters(const NGHolder &g, const NFAVertex accept,
|
||||
|
||||
verts.insert(v);
|
||||
next_vertex:
|
||||
continue;
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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",
|
||||
|
@ -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<std::vector<unsigned char>>(num_bytes);
|
||||
fill(small_color::white);
|
||||
: n(n_in),
|
||||
index_map(index_map_in),
|
||||
data(std::make_shared<std::vector<unsigned char>>((n_in + entries_per_byte - 1) / entries_per_byte)) {
|
||||
fill(small_color::white);
|
||||
}
|
||||
|
||||
void fill(small_color color) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user