From 4f4608e36f0e9f0ce7fc9f9ad7a4f379ed2cf795 Mon Sep 17 00:00:00 2001 From: Alexandr Goncharov Date: Thu, 25 Jul 2024 14:38:17 +0400 Subject: [PATCH] Got rid of several warnigs during compilation. Changed regex_start.sh to start hscollider from the default directory for apps. --- regex/hwlm/noodle_engine_avx2.c | 25 ++++++++++++++++++------- regex/runtime.c | 2 +- scripts/regex_start.sh | 3 ++- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/regex/hwlm/noodle_engine_avx2.c b/regex/hwlm/noodle_engine_avx2.c index 5edc646af..2a42a3c0e 100644 --- a/regex/hwlm/noodle_engine_avx2.c +++ b/regex/hwlm/noodle_engine_avx2.c @@ -114,13 +114,17 @@ hwlm_error_t scanSingleShort(const struct noodTable *n, const u8 *buf, } m256 v; - if (l < 4) { u8 *vp = (u8*)&v; switch (l) { - case 3: vp[2] = d[2]; // fallthrough - case 2: vp[1] = d[1]; // fallthrough - case 1: vp[0] = d[0]; // fallthrough + case 3: + vp[2] = d[2]; // fallthrough + fallthrough; + case 2: + vp[1] = d[1]; // fallthrough + fallthrough; + case 1: + vp[0] = d[0]; // fallthrough } } else { v = masked_move256_len(d, l); @@ -154,16 +158,23 @@ hwlm_error_t scanDoubleShort(const struct noodTable *n, const u8 *buf, m256 v; DEBUG_PRINTF("d %zu\n", d - buf); + if (l < 4) { u8 *vp = (u8*)&v; switch (l) { - case 3: vp[2] = d[2]; // fallthrough - case 2: vp[1] = d[1]; // fallthrough - case 1: vp[0] = d[0]; // fallthrough + case 3: + vp[2] = d[2]; // fallthrough + fallthrough; + case 2: + vp[1] = d[1]; // fallthrough + fallthrough; + case 1: + vp[0] = d[0]; // fallthrough } } else { v = masked_move256_len(d, l); } + if (noCase) { v = and256(v, caseMask); } diff --git a/regex/runtime.c b/regex/runtime.c index 54ee2fd8e..b7c17320e 100644 --- a/regex/runtime.c +++ b/regex/runtime.c @@ -1224,7 +1224,7 @@ hs_error_t HS_CDECL hs_scan_tfwstr(const hs_database_t *db, TFW_STR_FOR_EACH_CHUNK(chunk, str, end) { - DEBUG_PRINTF("offset=%llu len=%u\n", chunk->data, chunk->len); + DEBUG_PRINTF("offset=%llu len=%lu\n", id->offset, chunk->len); #ifdef DEBUG dumpData(chunk->data, chunk->len); #endif diff --git a/scripts/regex_start.sh b/scripts/regex_start.sh index 554f5bbfe..18f532924 100755 --- a/scripts/regex_start.sh +++ b/scripts/regex_start.sh @@ -10,7 +10,8 @@ for filename in ${tmp_path}/*.txt; do rm -rf ${tmp_path}/out/ && mkdir ${tmp_path}/out #${script_path}/hscollider -e ${filename} -ao ${tmp_path}/out/ -n1 #this version for single block strings - ${script_path}/hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 + #${script_path}/hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 #this version starts hscollider from scripts directory + hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 mkdir $db_path dd if=$(echo ${tmp_path}/out/*.db) of=${db_path}/database