Skip to content

Commit

Permalink
Got rid of several warnigs during compilation.
Browse files Browse the repository at this point in the history
Changed regex_start.sh to start hscollider from the default directory
for apps.
  • Loading branch information
biathlon3 committed Jul 25, 2024
1 parent ab68ff0 commit 4f4608e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
25 changes: 18 additions & 7 deletions regex/hwlm/noodle_engine_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion regex/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/regex_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f4608e

Please sign in to comment.