std::vector<hlmMatchEntry> ctxt;
static hwlmcb_rv_t hlmSimpleCallback(size_t to, u32 id,
- UNUSED struct hs_scratch *scratch) {
+ UNUSED struct hs_scratch *scratch) { // cppcheck-suppress constParameterCallback
DEBUG_PRINTF("match @%zu = %u\n", to, id);
ctxt.push_back(hlmMatchEntry(to, id));
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return shuftiExec(b.truffle_mask_lo, b.truffle_mask_hi, b.buf.data(),
b.buf.data() + b.size);
});
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return rshuftiExec(b.truffle_mask_lo, b.truffle_mask_hi, b.buf.data(),
b.buf.data() + b.size);
});
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return truffleExec(b.truffle_mask_lo, b.truffle_mask_hi, b.buf.data(),
b.buf.data() + b.size);
});
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return rtruffleExec(b.truffle_mask_lo, b.truffle_mask_hi, b.buf.data(),
b.buf.data() + b.size);
});
ue2::truffleBuildMasksWide(b.chars, reinterpret_cast<u8 *>(&b.truffle_mask));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return truffleExecWide(b.truffle_mask, b.buf.data(), b.buf.data() + b.size);
}
);
ue2::truffleBuildMasksWide(b.chars, reinterpret_cast<u8 *>(&b.truffle_mask));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return rtruffleExecWide(b.truffle_mask, b.buf.data(), b.buf.data() + b.size);
}
);
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return vermicelliExec('a', 'b', b.buf.data(),
b.buf.data() + b.size);
});
reinterpret_cast<u8 *>(&b.truffle_mask_hi));
memset(b.buf.data(), 'b', b.size);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark const &b) {
return rvermicelliExec('a', 'b', b.buf.data(),
b.buf.data() + b.size);
});
b.nt = ue2::noodBuildTable(lit);
assert(b.nt.get() != nullptr);
},
- [&](MicroBenchmark &b) {
+ [&](MicroBenchmark &b) { // cppcheck-suppress constParameterReference
noodExec(b.nt.get(), b.buf.data(), b.size, 0,
hlmSimpleCallback, &b.scratch);
return b.buf.data() + b.size;
knownConditionTrueFalse:*Parser.rl
knownConditionTrueFalse:*Parser.cpp
variableScope:*Parser.rl
+duplicateBreak:*.rl
unreadVariable:*control_verbs.cpp
+unreachableCode:*rose_build_dump.cpp
*:*simde/*
assertWithSideEffect
syntaxError
checkersReport
missingInclude
missingIncludeSystem
-unmatchedSuppression
\ No newline at end of file
+unmatchedSuppression
static really_inline
char lbrRevScanDot(UNUSED const struct NFA *nfa, UNUSED const u8 *buf,
UNUSED size_t begin, UNUSED size_t end,
- UNUSED size_t *loc) {
+ UNUSED const size_t *loc) {
assert(begin <= end);
assert(nfa->type == LBR_NFA_DOT);
// Nothing can kill a dot!
static really_inline
char lbrFwdScanDot(UNUSED const struct NFA *nfa, UNUSED const u8 *buf,
UNUSED size_t begin, UNUSED size_t end,
- UNUSED size_t *loc) {
+ UNUSED const size_t *loc) {
assert(begin <= end);
assert(nfa->type == LBR_NFA_DOT);
// Nothing can kill a dot!
u64a ep = MIN(MIN(end, (s64a)q->length) + offset, first_match);
if (ep > sp && sp >= offset) {
- size_t eloc;
+ size_t eloc = 0;
DEBUG_PRINTF("rev b%llu e%llu/%zu\n", sp - offset, ep - offset,
q->length);
assert(ep - offset <= q->length);
}
static
-NFAVertex createCyclic(NGHolder &g, ReachSubgraph &rsi) {
+NFAVertex createCyclic(NGHolder &g, ReachSubgraph const &rsi) {
NFAVertex last = rsi.vertices.back();
NFAVertex cyclic = clone_vertex(g, last);
add_edge(cyclic, cyclic, g);
}
static
-NFAVertex createPos(NGHolder &g, ReachSubgraph &rsi) {
+NFAVertex createPos(NGHolder &g, ReachSubgraph const &rsi) {
NFAVertex pos = add_vertex(g);
NFAVertex first = rsi.vertices.front();
os << endl;
}
- #define PROGRAM_CASE(name) \
+#define PROGRAM_CASE(name) \
case ROSE_INSTR_##name: { \
os << " " << std::setw(4) << std::setfill('0') << (pc - pc_base) \
<< ": " #name "\n"; \
static
void makePushDelayedInstructions(const RoseLiteralMap &literals,
- ProgramBuild &prog_build,
+ ProgramBuild const &prog_build,
const flat_set<u32> &delayed_ids,
RoseProgram &program) {
vector<RoseInstrPushDelayed> delay_instructions;
}
static
-void makeRoleGroups(const RoseGraph &g, ProgramBuild &prog_build,
+void makeRoleGroups(const RoseGraph &g, ProgramBuild const &prog_build,
RoseVertex v, RoseProgram &program) {
rose_group groups = g[v].groups;
if (!groups) {
}
static UNUSED
-string convertMaskstoString(u8 *p, int byte_len) {
+string convertMaskstoString(u8 const *p, int byte_len) {
string s;
for (int i = 0; i < byte_len; i++) {
u8 hi = *p >> 4;
static
RoseProgram makeLitInitialProgram(const RoseBuildImpl &build,
- ProgramBuild &prog_build, u32 lit_id,
+ ProgramBuild const &prog_build, u32 lit_id,
const vector<RoseEdge> &lit_edges,
bool is_anchored_replay_program) {
RoseProgram program;
}
RoseProgram makeDelayRebuildProgram(const RoseBuildImpl &build,
- ProgramBuild &prog_build,
+ ProgramBuild const &prog_build,
const vector<u32> &lit_ids) {
assert(!lit_ids.empty());
assert(build.cc.streaming);
bool is_anchored_replay_program);
RoseProgram makeDelayRebuildProgram(const RoseBuildImpl &build,
- ProgramBuild &prog_build,
+ ProgramBuild const &prog_build,
const std::vector<u32> &lit_ids);
RoseProgram makeEodAnchorProgram(const RoseBuildImpl &build,
static
hwlmcb_rv_t decentCallback(size_t end, u32 id,
- UNUSED struct hs_scratch *scratch) {
+ UNUSED struct hs_scratch *scratch) { // cppcheck-suppress constParameterCallback
DEBUG_PRINTF("match @%zu : %u\n", end, id);
matches.push_back(match(end, id));
static
hwlmcb_rv_t decentCallbackT(size_t end, u32 id,
- UNUSED struct hs_scratch *scratch) {
+ UNUSED struct hs_scratch *scratch) { // cppcheck-suppress constParameterCallback
matches.push_back(match(end, id));
return HWLM_TERMINATE_MATCHING;
}
extern "C" {
static hwlmcb_rv_t countCallback(UNUSED size_t end, u32 id,
- UNUSED struct hs_scratch *scratch) {
+ UNUSED struct hs_scratch *scratch) { // cppcheck-suppress constParameterCallback
matchesCounts[id]++;
return HWLM_CONTINUE_MATCHING;
}
char *makeHex(const unsigned char *pat, unsigned patlen) {
size_t hexlen = patlen * 4;
char *hexbuf = reinterpret_cast<char *>(malloc(hexlen + 1));
- unsigned i;
- char *buf;
- for (i = 0, buf = hexbuf; i < patlen; i++, buf += 4) {
+ if (!hexbuf) abort();
+ char *buf = hexbuf;
+ for (size_t i = 0; i < patlen; i++, buf += 4) {
snprintf(buf, 5, "\\x%02x", (unsigned char)pat[i]);
}
hexbuf[hexlen] = '\0';