diff --git a/src/fdr/fdr.c b/src/fdr/fdr.c index 561e8f98..16f453c5 100644 --- a/src/fdr/fdr.c +++ b/src/fdr/fdr.c @@ -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)) { diff --git a/src/nfa/castle.c b/src/nfa/castle.c index 29208f8d..4c103636 100644 --- a/src/nfa/castle.c +++ b/src/nfa/castle.c @@ -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); diff --git a/src/nfa/limex_common_impl.h b/src/nfa/limex_common_impl.h index e441945d..48661871 100644 --- a/src/nfa/limex_common_impl.h +++ b/src/nfa/limex_common_impl.h @@ -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); diff --git a/src/nfa/mpv.c b/src/nfa/mpv.c index 2b1b5c5f..edfe5f89 100644 --- a/src/nfa/mpv.c +++ b/src/nfa/mpv.c @@ -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); diff --git a/src/rose/rose_build_matchers.cpp b/src/rose/rose_build_matchers.cpp index aa7a794d..3d68200f 100644 --- a/src/rose/rose_build_matchers.cpp +++ b/src/rose/rose_build_matchers.cpp @@ -884,7 +884,7 @@ void buildAccel(const RoseBuildImpl &build, } bytecode_ptr -buildHWLMMatcher(const RoseBuildImpl &build, LitProto *litProto) { +buildHWLMMatcher(const RoseBuildImpl &build, const LitProto *litProto) { if (!litProto) { return nullptr; } diff --git a/src/rose/rose_build_matchers.h b/src/rose/rose_build_matchers.h index ef8999ed..37a96c7a 100644 --- a/src/rose/rose_build_matchers.h +++ b/src/rose/rose_build_matchers.h @@ -101,7 +101,7 @@ struct LitProto { }; bytecode_ptr -buildHWLMMatcher(const RoseBuildImpl &build, LitProto *proto); +buildHWLMMatcher(const RoseBuildImpl &build, const LitProto *proto); std::unique_ptr buildFloatingMatcherProto(const RoseBuildImpl &build, diff --git a/src/rose/stream.c b/src/rose/stream.c index 26268dd5..acf4855a 100644 --- a/src/rose/stream.c +++ b/src/rose/stream.c @@ -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); diff --git a/src/scratch.h b/src/scratch.h index e3cd9245..e01ccd6b 100644 --- a/src/scratch.h +++ b/src/scratch.h @@ -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; } diff --git a/src/som/som_runtime.c b/src/som/som_runtime.c index 1a868efc..ce179ca0 100644 --- a/src/som/som_runtime.c +++ b/src/som/som_runtime.c @@ -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 diff --git a/tools/hsbench/main.cpp b/tools/hsbench/main.cpp index 1a19d510..8d9f8d6d 100644 --- a/tools/hsbench/main.cpp +++ b/tools/hsbench/main.cpp @@ -465,7 +465,7 @@ void processArgs(int argc, char *argv[], vector &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 } diff --git a/unit/hyperscan/test_util.cpp b/unit/hyperscan/test_util.cpp index f6c20a74..10d23962 100644 --- a/unit/hyperscan/test_util.cpp +++ b/unit/hyperscan/test_util.cpp @@ -58,7 +58,7 @@ std::ostream &operator<<(std::ostream &o, const pattern &p) { } hs_database_t *buildDB(const vector &patterns, unsigned int mode, - hs_platform_info *plat) { + const hs_platform_info *plat) { vector expressions; vector flags; vector 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); } diff --git a/unit/hyperscan/test_util.h b/unit/hyperscan/test_util.h index 21862b6b..01fdca0b 100644 --- a/unit/hyperscan/test_util.h +++ b/unit/hyperscan/test_util.h @@ -99,11 +99,11 @@ struct pattern { std::ostream &operator<<(std::ostream &o, const pattern &p); hs_database_t *buildDB(const std::vector &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,