mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
next batch for cppeheck, addressing syntaxError and
constParameterPointer
This commit is contained in:
parent
e291d498fa
commit
7fd45f864c
@ -298,7 +298,7 @@ void get_conf_stride_4(const u8 *itPtr, UNUSED const u8 *start_ptr,
|
|||||||
static really_inline
|
static really_inline
|
||||||
void do_confirm_fdr(u64a *conf, u8 offset, hwlmcb_rv_t *control,
|
void do_confirm_fdr(u64a *conf, u8 offset, hwlmcb_rv_t *control,
|
||||||
const u32 *confBase, const struct FDR_Runtime_Args *a,
|
const u32 *confBase, const struct FDR_Runtime_Args *a,
|
||||||
const u8 *ptr, u32 *last_match_id, struct zone *z) {
|
const u8 *ptr, u32 *last_match_id, const struct zone *z) {
|
||||||
const u8 bucket = 8;
|
const u8 bucket = 8;
|
||||||
|
|
||||||
if (likely(!*conf)) {
|
if (likely(!*conf)) {
|
||||||
|
@ -400,7 +400,7 @@ char castleFindMatch(const struct Castle *c, const u64a begin, const u64a end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
u64a subCastleNextMatch(const struct Castle *c, void *full_state,
|
u64a subCastleNextMatch(const struct Castle *c, const void *full_state,
|
||||||
void *stream_state, const u64a loc,
|
void *stream_state, const u64a loc,
|
||||||
const u32 subIdx) {
|
const u32 subIdx) {
|
||||||
DEBUG_PRINTF("subcastle %u\n", subIdx);
|
DEBUG_PRINTF("subcastle %u\n", subIdx);
|
||||||
|
@ -659,7 +659,7 @@ GoughSSAVar *GoughSSAVarJoin::get_input(const GoughEdge &prev) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const flat_set<GoughEdge> &GoughSSAVarJoin::get_edges_for_input(
|
const flat_set<GoughEdge> &GoughSSAVarJoin::get_edges_for_input(
|
||||||
GoughSSAVar *input) const {
|
const GoughSSAVar *input) const {
|
||||||
return input_map.at(input);
|
return input_map.at(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void EXPIRE_ESTATE_FN(const IMPL_NFA_T *limex, struct CONTEXT_T *ctx,
|
|||||||
// UE-1636) need to guard cyclic tug-accepts as well.
|
// UE-1636) need to guard cyclic tug-accepts as well.
|
||||||
static really_inline
|
static really_inline
|
||||||
char LIMEX_INACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
char LIMEX_INACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
||||||
union RepeatControl *repeat_ctrl, char *repeat_state,
|
const union RepeatControl *repeat_ctrl, const char *repeat_state,
|
||||||
u64a offset, ReportID report) {
|
u64a offset, ReportID report) {
|
||||||
assert(limex);
|
assert(limex);
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ char LIMEX_INACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
|||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
char LIMEX_INANYACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
char LIMEX_INANYACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
||||||
union RepeatControl *repeat_ctrl, char *repeat_state,
|
const union RepeatControl *repeat_ctrl, const char *repeat_state,
|
||||||
u64a offset) {
|
u64a offset) {
|
||||||
assert(limex);
|
assert(limex);
|
||||||
|
|
||||||
|
@ -927,7 +927,7 @@ char JOIN(LIMEX_API_ROOT, _testEOD)(const struct NFA *n, const char *state,
|
|||||||
context);
|
context);
|
||||||
}
|
}
|
||||||
|
|
||||||
char JOIN(LIMEX_API_ROOT, _reportCurrent)(const struct NFA *n, struct mq *q) {
|
char JOIN(LIMEX_API_ROOT, _reportCurrent)(const struct NFA *n, const struct mq *q) {
|
||||||
const IMPL_NFA_T *limex = getImplNfa(n);
|
const IMPL_NFA_T *limex = getImplNfa(n);
|
||||||
REPORTCURRENT_FN(limex, q);
|
REPORTCURRENT_FN(limex, q);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -607,7 +607,7 @@ size_t find_last_bad(const struct mpv_kilopuff *kp, const u8 *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
void restartKilo(const struct mpv *m, UNUSED u8 *active, u8 *reporters,
|
void restartKilo(const struct mpv *m, UNUSED const u8 *active, u8 *reporters,
|
||||||
struct mpv_decomp_state *dstate, struct mpv_pq_item *pq,
|
struct mpv_decomp_state *dstate, struct mpv_pq_item *pq,
|
||||||
const u8 *buf, u64a prev_limit, size_t buf_length, u32 i) {
|
const u8 *buf, u64a prev_limit, size_t buf_length, u32 i) {
|
||||||
const struct mpv_kilopuff *kp = (const void *)(m + 1);
|
const struct mpv_kilopuff *kp = (const void *)(m + 1);
|
||||||
|
@ -884,7 +884,7 @@ void buildAccel(const RoseBuildImpl &build,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bytecode_ptr<HWLM>
|
bytecode_ptr<HWLM>
|
||||||
buildHWLMMatcher(const RoseBuildImpl &build, LitProto *litProto) {
|
buildHWLMMatcher(const RoseBuildImpl &build, const LitProto *litProto) {
|
||||||
if (!litProto) {
|
if (!litProto) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ void runAnchoredTableStream(const struct RoseEngine *t, const void *atable,
|
|||||||
|
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
void saveStreamState(const struct NFA *nfa, struct mq *q, s64a loc) {
|
void saveStreamState(const struct NFA *nfa, const struct mq *q, s64a loc) {
|
||||||
DEBUG_PRINTF("offset=%llu, length=%zu, hlength=%zu, loc=%lld\n",
|
DEBUG_PRINTF("offset=%llu, length=%zu, hlength=%zu, loc=%lld\n",
|
||||||
q->offset, q->length, q->hlength, loc);
|
q->offset, q->length, q->hlength, loc);
|
||||||
nfaQueueCompressState(nfa, q, loc);
|
nfaQueueCompressState(nfa, q, loc);
|
||||||
|
@ -215,12 +215,12 @@ struct ALIGN_CL_DIRECTIVE hs_scratch {
|
|||||||
|
|
||||||
/* array of fatbit ptr; TODO: why not an array of fatbits? */
|
/* array of fatbit ptr; TODO: why not an array of fatbits? */
|
||||||
static really_inline
|
static really_inline
|
||||||
struct fatbit **getAnchoredLiteralLog(struct hs_scratch *scratch) {
|
struct fatbit **getAnchoredLiteralLog(const struct hs_scratch *scratch) {
|
||||||
return scratch->al_log;
|
return scratch->al_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
struct fatbit **getDelaySlots(struct hs_scratch *scratch) {
|
struct fatbit **getDelaySlots(const struct hs_scratch *scratch) {
|
||||||
return scratch->delay_slots;
|
return scratch->delay_slots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ void setSomLoc(struct fatbit *som_set_now, u64a *som_store, u32 som_store_count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
char ok_and_mark_if_write(u8 *som_store_valid, struct fatbit *som_set_now,
|
char ok_and_mark_if_write(u8 *som_store_valid, const struct fatbit *som_set_now,
|
||||||
u8 *som_store_writable, u32 som_store_count,
|
const u8 *som_store_writable, u32 som_store_count,
|
||||||
u32 loc) {
|
u32 loc) {
|
||||||
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
||||||
|| fatbit_isset(som_set_now, som_store_count, loc) /* write here, need
|
|| fatbit_isset(som_set_now, som_store_count, loc) /* write here, need
|
||||||
@ -79,7 +79,7 @@ char ok_and_mark_if_write(u8 *som_store_valid, struct fatbit *som_set_now,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
char ok_and_mark_if_unset(u8 *som_store_valid, struct fatbit *som_set_now,
|
char ok_and_mark_if_unset(u8 *som_store_valid, const struct fatbit *som_set_now,
|
||||||
u32 som_store_count, u32 loc) {
|
u32 som_store_count, u32 loc) {
|
||||||
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
||||||
|| fatbit_isset(som_set_now, som_store_count, loc); /* write here, need
|
|| fatbit_isset(som_set_now, som_store_count, loc); /* write here, need
|
||||||
|
@ -465,7 +465,7 @@ void processArgs(int argc, char *argv[], vector<BenchmarkSigs> &sigSets,
|
|||||||
|
|
||||||
/** Start the global timer. */
|
/** Start the global timer. */
|
||||||
static
|
static
|
||||||
void startTotalTimer(ThreadContext *ctx) {
|
void startTotalTimer(const ThreadContext *ctx) {
|
||||||
if (ctx->num != 0) {
|
if (ctx->num != 0) {
|
||||||
return; // only runs in the first thread
|
return; // only runs in the first thread
|
||||||
}
|
}
|
||||||
@ -474,7 +474,7 @@ void startTotalTimer(ThreadContext *ctx) {
|
|||||||
|
|
||||||
/** Stop the global timer and calculate totals. */
|
/** Stop the global timer and calculate totals. */
|
||||||
static
|
static
|
||||||
void stopTotalTimer(ThreadContext *ctx) {
|
void stopTotalTimer(const ThreadContext *ctx) {
|
||||||
if (ctx->num != 0) {
|
if (ctx->num != 0) {
|
||||||
return; // only runs in the first thread
|
return; // only runs in the first thread
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ std::ostream &operator<<(std::ostream &o, const pattern &p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hs_database_t *buildDB(const vector<pattern> &patterns, unsigned int mode,
|
hs_database_t *buildDB(const vector<pattern> &patterns, unsigned int mode,
|
||||||
hs_platform_info *plat) {
|
const hs_platform_info *plat) {
|
||||||
vector<const char *> expressions;
|
vector<const char *> expressions;
|
||||||
vector<unsigned int> flags;
|
vector<unsigned int> flags;
|
||||||
vector<unsigned int> ids;
|
vector<unsigned int> ids;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user