mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Merge pull request #258 from isildur-g/wip-isildur-g-cppcheck1220
Wip cppcheck1220
This commit is contained in:
commit
aa1955a368
@ -298,7 +298,7 @@ void get_conf_stride_4(const u8 *itPtr, UNUSED const u8 *start_ptr,
|
||||
static really_inline
|
||||
void do_confirm_fdr(u64a *conf, u8 offset, hwlmcb_rv_t *control,
|
||||
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;
|
||||
|
||||
if (likely(!*conf)) {
|
||||
|
@ -400,7 +400,7 @@ char castleFindMatch(const struct Castle *c, const u64a begin, const u64a end,
|
||||
}
|
||||
|
||||
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,
|
||||
const u32 subIdx) {
|
||||
DEBUG_PRINTF("subcastle %u\n", subIdx);
|
||||
|
@ -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.
|
||||
static really_inline
|
||||
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) {
|
||||
assert(limex);
|
||||
|
||||
@ -382,7 +382,7 @@ char LIMEX_INACCEPT_FN(const IMPL_NFA_T *limex, STATE_T state,
|
||||
|
||||
static really_inline
|
||||
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) {
|
||||
assert(limex);
|
||||
|
||||
|
@ -607,7 +607,7 @@ size_t find_last_bad(const struct mpv_kilopuff *kp, const u8 *buf,
|
||||
}
|
||||
|
||||
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,
|
||||
const u8 *buf, u64a prev_limit, size_t buf_length, u32 i) {
|
||||
const struct mpv_kilopuff *kp = (const void *)(m + 1);
|
||||
|
@ -884,7 +884,7 @@ void buildAccel(const RoseBuildImpl &build,
|
||||
}
|
||||
|
||||
bytecode_ptr<HWLM>
|
||||
buildHWLMMatcher(const RoseBuildImpl &build, LitProto *litProto) {
|
||||
buildHWLMMatcher(const RoseBuildImpl &build, const LitProto *litProto) {
|
||||
if (!litProto) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ struct LitProto {
|
||||
};
|
||||
|
||||
bytecode_ptr<HWLM>
|
||||
buildHWLMMatcher(const RoseBuildImpl &build, LitProto *proto);
|
||||
buildHWLMMatcher(const RoseBuildImpl &build, const LitProto *proto);
|
||||
|
||||
std::unique_ptr<LitProto>
|
||||
buildFloatingMatcherProto(const RoseBuildImpl &build,
|
||||
|
@ -104,7 +104,7 @@ void runAnchoredTableStream(const struct RoseEngine *t, const void *atable,
|
||||
|
||||
|
||||
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",
|
||||
q->offset, q->length, q->hlength, 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? */
|
||||
static really_inline
|
||||
struct fatbit **getAnchoredLiteralLog(struct hs_scratch *scratch) {
|
||||
struct fatbit **getAnchoredLiteralLog(const struct hs_scratch *scratch) {
|
||||
return scratch->al_log;
|
||||
}
|
||||
|
||||
static really_inline
|
||||
struct fatbit **getDelaySlots(struct hs_scratch *scratch) {
|
||||
struct fatbit **getDelaySlots(const struct hs_scratch *scratch) {
|
||||
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
|
||||
char ok_and_mark_if_write(u8 *som_store_valid, struct fatbit *som_set_now,
|
||||
u8 *som_store_writable, u32 som_store_count,
|
||||
char ok_and_mark_if_write(u8 *som_store_valid, const struct fatbit *som_set_now,
|
||||
const u8 *som_store_writable, u32 som_store_count,
|
||||
u32 loc) {
|
||||
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
||||
|| 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
|
||||
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) {
|
||||
return !mmbit_set(som_store_valid, som_store_count, loc) /* unwritten */
|
||||
|| 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. */
|
||||
static
|
||||
void startTotalTimer(ThreadContext *ctx) {
|
||||
void startTotalTimer(const ThreadContext *ctx) {
|
||||
if (ctx->num != 0) {
|
||||
return; // only runs in the first thread
|
||||
}
|
||||
@ -474,7 +474,7 @@ void startTotalTimer(ThreadContext *ctx) {
|
||||
|
||||
/** Stop the global timer and calculate totals. */
|
||||
static
|
||||
void stopTotalTimer(ThreadContext *ctx) {
|
||||
void stopTotalTimer(const ThreadContext *ctx) {
|
||||
if (ctx->num != 0) {
|
||||
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_platform_info *plat) {
|
||||
const hs_platform_info *plat) {
|
||||
vector<const char *> expressions;
|
||||
vector<unsigned int> flags;
|
||||
vector<unsigned int> ids;
|
||||
@ -92,7 +92,7 @@ hs_database_t *buildDB(const pattern &expr, unsigned int mode) {
|
||||
|
||||
hs_database_t *buildDB(const char *expression, unsigned int flags,
|
||||
unsigned int id, unsigned int mode,
|
||||
hs_platform_info_t *plat) {
|
||||
const hs_platform_info_t *plat) {
|
||||
return buildDB({pattern(expression, flags, id)}, mode, plat);
|
||||
}
|
||||
|
||||
|
@ -99,11 +99,11 @@ struct pattern {
|
||||
std::ostream &operator<<(std::ostream &o, const pattern &p);
|
||||
|
||||
hs_database_t *buildDB(const std::vector<pattern> &patterns, unsigned int mode,
|
||||
hs_platform_info *plat = nullptr);
|
||||
const hs_platform_info *plat = nullptr);
|
||||
hs_database_t *buildDB(const pattern &pat, unsigned int mode);
|
||||
hs_database_t *buildDB(const char *expression, unsigned int flags,
|
||||
unsigned int id, unsigned int mode,
|
||||
hs_platform_info *plat = nullptr);
|
||||
const hs_platform_info *plat = nullptr);
|
||||
hs_database_t *buildDB(const char *filename, unsigned int mode,
|
||||
unsigned int extra_flags = 0);
|
||||
hs_database_t *buildDB(const char *filename, unsigned int mode,
|
||||
|
Loading…
x
Reference in New Issue
Block a user