mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Don't shadow names
This commit is contained in:
parent
68ae4cc7c8
commit
cbd115f7fe
@ -174,7 +174,7 @@ else()
|
|||||||
|
|
||||||
# set compiler flags - more are tested and added later
|
# set compiler flags - more are tested and added later
|
||||||
set(EXTRA_C_FLAGS "-std=c99 -Wall -Wextra -Wshadow -Wcast-qual -fno-strict-aliasing")
|
set(EXTRA_C_FLAGS "-std=c99 -Wall -Wextra -Wshadow -Wcast-qual -fno-strict-aliasing")
|
||||||
set(EXTRA_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wno-shadow -Wswitch -Wreturn-type -Wcast-qual -Wno-deprecated -Wnon-virtual-dtor -fno-strict-aliasing")
|
set(EXTRA_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wshadow -Wswitch -Wreturn-type -Wcast-qual -Wno-deprecated -Wnon-virtual-dtor -fno-strict-aliasing")
|
||||||
if (NOT RELEASE_BUILD)
|
if (NOT RELEASE_BUILD)
|
||||||
# -Werror is most useful during development, don't potentially break
|
# -Werror is most useful during development, don't potentially break
|
||||||
# release builds
|
# release builds
|
||||||
|
@ -195,18 +195,18 @@ struct OffsetIDFromEndOrder {
|
|||||||
|
|
||||||
static
|
static
|
||||||
void fillHashes(const vector<hwlmLiteral> &long_lits, size_t max_len,
|
void fillHashes(const vector<hwlmLiteral> &long_lits, size_t max_len,
|
||||||
FDRSHashEntry *tab, size_t numEntries, MODES m,
|
FDRSHashEntry *tab, size_t numEntries, MODES mode,
|
||||||
map<u32, u32> &litToOffsetVal) {
|
map<u32, u32> &litToOffsetVal) {
|
||||||
const u32 nbits = lg2(numEntries);
|
const u32 nbits = lg2(numEntries);
|
||||||
map<u32, deque<pair<u32, u32> > > bucketToLitOffPairs;
|
map<u32, deque<pair<u32, u32> > > bucketToLitOffPairs;
|
||||||
map<u32, u64a> bucketToBitfield;
|
map<u32, u64a> bucketToBitfield;
|
||||||
|
|
||||||
for (const auto &lit : long_lits) {
|
for (const auto &lit : long_lits) {
|
||||||
if ((m == CASELESS) != lit.nocase) {
|
if ((mode == CASELESS) != lit.nocase) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (u32 j = 1; j < lit.s.size() - max_len + 1; j++) {
|
for (u32 j = 1; j < lit.s.size() - max_len + 1; j++) {
|
||||||
u32 h = hashLit(lit, j, max_len, m);
|
u32 h = hashLit(lit, j, max_len, mode);
|
||||||
u32 h_ent = h & ((1U << nbits) - 1);
|
u32 h_ent = h & ((1U << nbits) - 1);
|
||||||
u32 h_low = (h >> nbits) & 63;
|
u32 h_low = (h >> nbits) & 63;
|
||||||
bucketToLitOffPairs[h_ent].emplace_back(lit.id, j);
|
bucketToLitOffPairs[h_ent].emplace_back(lit.id, j);
|
||||||
|
@ -266,9 +266,9 @@ bool TeddyCompiler::pack(map<BucketIndex,
|
|||||||
|
|
||||||
u32 bucket_id = 0;
|
u32 bucket_id = 0;
|
||||||
for (const TeddySet &ts : sts) {
|
for (const TeddySet &ts : sts) {
|
||||||
const auto &lits = ts.getLits();
|
const auto &ts_lits = ts.getLits();
|
||||||
auto &bucket_lits = bucketToLits[bucket_id];
|
auto &bucket_lits = bucketToLits[bucket_id];
|
||||||
bucket_lits.insert(end(bucket_lits), begin(lits), end(lits));
|
bucket_lits.insert(end(bucket_lits), begin(ts_lits), end(ts_lits));
|
||||||
bucket_id++;
|
bucket_id++;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -79,9 +79,9 @@ namespace {
|
|||||||
class gough_build_strat : public mcclellan_build_strat {
|
class gough_build_strat : public mcclellan_build_strat {
|
||||||
public:
|
public:
|
||||||
gough_build_strat(
|
gough_build_strat(
|
||||||
raw_som_dfa &r, const GoughGraph &g, const ReportManager &rm,
|
raw_som_dfa &r, const GoughGraph &g, const ReportManager &rm_in,
|
||||||
const map<dstate_id_t, gough_accel_state_info> &accel_info)
|
const map<dstate_id_t, gough_accel_state_info> &accel_info)
|
||||||
: mcclellan_build_strat(r, rm), rdfa(r), gg(g),
|
: mcclellan_build_strat(r, rm_in), rdfa(r), gg(g),
|
||||||
accel_gough_info(accel_info) {}
|
accel_gough_info(accel_info) {}
|
||||||
unique_ptr<raw_report_info> gatherReports(vector<u32> &reports /* out */,
|
unique_ptr<raw_report_info> gatherReports(vector<u32> &reports /* out */,
|
||||||
vector<u32> &reports_eod /* out */,
|
vector<u32> &reports_eod /* out */,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Intel Corporation
|
* Copyright (c) 2015-2016, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -347,9 +347,9 @@ void match(accel_data &d, const CharReach &ref_cr, const CharReach &cur_cr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiaccelCompileHelper::MultiaccelCompileHelper(const CharReach &ref_cr, u32 off,
|
MultiaccelCompileHelper::MultiaccelCompileHelper(const CharReach &ref_cr,
|
||||||
unsigned max_len) :
|
u32 off, unsigned max_length)
|
||||||
cr(ref_cr), offset(off), max_len(max_len) {
|
: cr(ref_cr), offset(off), max_len(max_length) {
|
||||||
int accel_num = (int) MultibyteAccelInfo::MAT_MAX;
|
int accel_num = (int) MultibyteAccelInfo::MAT_MAX;
|
||||||
accels.resize(accel_num);
|
accels.resize(accel_num);
|
||||||
|
|
||||||
|
@ -1880,15 +1880,15 @@ bool improvePrefix(NGHolder &h, RoseInGraph &vg, const vector<RoseInEdge> &ee,
|
|||||||
trimmed.clear();
|
trimmed.clear();
|
||||||
for (auto &elem : trimmed_vec) {
|
for (auto &elem : trimmed_vec) {
|
||||||
shared_ptr<NGHolder> &hp = elem.first;
|
shared_ptr<NGHolder> &hp = elem.first;
|
||||||
NGHolder &h = *hp;
|
NGHolder &eh = *hp;
|
||||||
|
|
||||||
vector<NFAVertex> base_states;
|
vector<NFAVertex> base_states;
|
||||||
insert(&base_states, base_states.end(),
|
insert(&base_states, base_states.end(),
|
||||||
inv_adjacent_vertices(h.accept, h));
|
inv_adjacent_vertices(eh.accept, eh));
|
||||||
clear_in_edges(h.accept, h);
|
clear_in_edges(eh.accept, eh);
|
||||||
|
|
||||||
for (auto v : base_states) {
|
for (auto v : base_states) {
|
||||||
h[v].reports.clear(); /* clear report from old accepts */
|
eh[v].reports.clear(); /* clear report from old accepts */
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &edge_delay : elem.second) {
|
for (const auto &edge_delay : elem.second) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Intel Corporation
|
* Copyright (c) 2015-2016, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -1447,12 +1447,12 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
|
|||||||
// Otherwise, we interpret the first three digits as an
|
// Otherwise, we interpret the first three digits as an
|
||||||
// octal escape, and the remaining characters stand for
|
// octal escape, and the remaining characters stand for
|
||||||
// themselves as literals.
|
// themselves as literals.
|
||||||
const u8 *p = ts;
|
const u8 *s = ts;
|
||||||
unsigned int accum = 0;
|
unsigned int accum = 0;
|
||||||
unsigned int oct_digits = 0;
|
unsigned int oct_digits = 0;
|
||||||
assert(*p == '\\'); // token starts at backslash
|
assert(*s == '\\'); // token starts at backslash
|
||||||
for (++p; p < te && oct_digits < 3; ++oct_digits, ++p) {
|
for (++s; s < te && oct_digits < 3; ++oct_digits, ++s) {
|
||||||
u8 digit = *p - '0';
|
u8 digit = *s - '0';
|
||||||
if (digit < 8) {
|
if (digit < 8) {
|
||||||
accum = digit + accum * 8;
|
accum = digit + accum * 8;
|
||||||
} else {
|
} else {
|
||||||
@ -1465,8 +1465,8 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// And then the rest of the digits, if any, are literal.
|
// And then the rest of the digits, if any, are literal.
|
||||||
for (; p < te; ++p) {
|
for (; s < te; ++s) {
|
||||||
addLiteral(currentSeq, *p, mode);
|
addLiteral(currentSeq, *s, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -709,7 +709,6 @@ void makeEodEventLeftfix(RoseBuildImpl &build, RoseVertex u,
|
|||||||
g[v].literals.insert(eod_event);
|
g[v].literals.insert(eod_event);
|
||||||
build.literal_info[eod_event].vertices.insert(v);
|
build.literal_info[eod_event].vertices.insert(v);
|
||||||
|
|
||||||
map<u32, set<ReportID> > report_remap;
|
|
||||||
g[v].left.graph = eod_leftfix;
|
g[v].left.graph = eod_leftfix;
|
||||||
g[v].left.leftfix_report = report_mapping.second;
|
g[v].left.leftfix_report = report_mapping.second;
|
||||||
g[v].left.lag = 0;
|
g[v].left.lag = 0;
|
||||||
|
@ -4906,11 +4906,11 @@ void addEodAnchorProgram(RoseBuildImpl &build, build_context &bc,
|
|||||||
assert(contains(bc.roleStateIndices, u));
|
assert(contains(bc.roleStateIndices, u));
|
||||||
u32 predStateIdx = bc.roleStateIndices.at(u);
|
u32 predStateIdx = bc.roleStateIndices.at(u);
|
||||||
|
|
||||||
auto program = makeEodAnchorProgram(build, bc, e, multiple_preds);
|
auto prog = makeEodAnchorProgram(build, bc, e, multiple_preds);
|
||||||
if (program.empty()) {
|
if (prog.empty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
predProgramLists[predStateIdx].push_back(program);
|
predProgramLists[predStateIdx].push_back(prog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,8 +511,8 @@ bool RoseBuildImpl::isDirectReport(u32 id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use the program to handle cases that aren't external reports.
|
// Use the program to handle cases that aren't external reports.
|
||||||
for (const ReportID &id : g[v].reports) {
|
for (const ReportID &rid : g[v].reports) {
|
||||||
if (!isExternalReport(rm.getReport(id))) {
|
if (!isExternalReport(rm.getReport(rid))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,8 +416,8 @@ bool isDirectHighlander(const RoseBuildImpl &build, const u32 id,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto is_simple_exhaustible = [&build](ReportID id) {
|
auto is_simple_exhaustible = [&build](ReportID rid) {
|
||||||
const Report &report = build.rm.getReport(id);
|
const Report &report = build.rm.getReport(rid);
|
||||||
return isSimpleExhaustible(report);
|
return isSimpleExhaustible(report);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -283,9 +283,9 @@ TEST(DoubleShufti, BuildMask1) {
|
|||||||
|
|
||||||
lits.insert(make_pair('a', 'B'));
|
lits.insert(make_pair('a', 'B'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
||||||
&lo2m, &hi2m);
|
&lo2m, &hi2m);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
u8 *lo1 = (u8 *)&lo1m;
|
u8 *lo1 = (u8 *)&lo1m;
|
||||||
u8 *lo2 = (u8 *)&lo2m;
|
u8 *lo2 = (u8 *)&lo2m;
|
||||||
@ -326,9 +326,9 @@ TEST(DoubleShufti, BuildMask2) {
|
|||||||
lits.insert(make_pair('a','z'));
|
lits.insert(make_pair('a','z'));
|
||||||
lits.insert(make_pair('B','z'));
|
lits.insert(make_pair('B','z'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
||||||
&lo2m, &hi2m);
|
&lo2m, &hi2m);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
u8 *lo1 = (u8 *)&lo1m;
|
u8 *lo1 = (u8 *)&lo1m;
|
||||||
u8 *lo2 = (u8 *)&lo2m;
|
u8 *lo2 = (u8 *)&lo2m;
|
||||||
@ -354,9 +354,9 @@ TEST(DoubleShufti, BuildMask4) {
|
|||||||
lits.insert(make_pair('A','z'));
|
lits.insert(make_pair('A','z'));
|
||||||
lits.insert(make_pair('b','z'));
|
lits.insert(make_pair('b','z'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
||||||
&lo2m, &hi2m);
|
&lo2m, &hi2m);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
u8 *lo1 = (u8 *)&lo1m;
|
u8 *lo1 = (u8 *)&lo1m;
|
||||||
u8 *lo2 = (u8 *)&lo2m;
|
u8 *lo2 = (u8 *)&lo2m;
|
||||||
@ -383,9 +383,9 @@ TEST(DoubleShufti, BuildMask5) {
|
|||||||
CharReach bytes;
|
CharReach bytes;
|
||||||
bytes.set('X');
|
bytes.set('X');
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(bytes, lits, &lo1m, &hi1m,
|
bool ret = shuftiBuildDoubleMasks(bytes, lits, &lo1m, &hi1m,
|
||||||
&lo2m, &hi2m);
|
&lo2m, &hi2m);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
u8 *lo1 = (u8 *)&lo1m;
|
u8 *lo1 = (u8 *)&lo1m;
|
||||||
u8 *lo2 = (u8 *)&lo2m;
|
u8 *lo2 = (u8 *)&lo2m;
|
||||||
@ -421,9 +421,9 @@ TEST(DoubleShufti, BuildMask6) {
|
|||||||
lits.insert(make_pair('A','x'));
|
lits.insert(make_pair('A','x'));
|
||||||
lits.insert(make_pair('b','x'));
|
lits.insert(make_pair('b','x'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1m, &hi1m,
|
||||||
&lo2m, &hi2m);
|
&lo2m, &hi2m);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
u8 *lo1 = (u8 *)&lo1m;
|
u8 *lo1 = (u8 *)&lo1m;
|
||||||
u8 *lo2 = (u8 *)&lo2m;
|
u8 *lo2 = (u8 *)&lo2m;
|
||||||
@ -485,9 +485,9 @@ TEST(DoubleShufti, ExecNoMatch1) {
|
|||||||
|
|
||||||
lits.insert(make_pair('a','b'));
|
lits.insert(make_pair('a','b'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1,
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1,
|
||||||
&lo2, &hi2);
|
&lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -506,8 +506,8 @@ TEST(DoubleShufti, ExecNoMatch1b) {
|
|||||||
|
|
||||||
lits.insert(make_pair('b','a'));
|
lits.insert(make_pair('b','a'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -527,8 +527,8 @@ TEST(DoubleShufti, ExecNoMatch2) {
|
|||||||
lits.insert(make_pair('a','b'));
|
lits.insert(make_pair('a','b'));
|
||||||
lits.insert(make_pair('B','b'));
|
lits.insert(make_pair('B','b'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -548,8 +548,8 @@ TEST(DoubleShufti, ExecNoMatch2b) {
|
|||||||
lits.insert(make_pair('b','a'));
|
lits.insert(make_pair('b','a'));
|
||||||
lits.insert(make_pair('b','B'));
|
lits.insert(make_pair('b','B'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -568,8 +568,8 @@ TEST(DoubleShufti, ExecNoMatch3) {
|
|||||||
|
|
||||||
lits.insert(make_pair('V','e'));
|
lits.insert(make_pair('V','e'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
char t1[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
||||||
|
|
||||||
@ -588,8 +588,8 @@ TEST(DoubleShufti, ExecNoMatch3b) {
|
|||||||
|
|
||||||
lits.insert(make_pair('e','V'));
|
lits.insert(make_pair('e','V'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
char t1[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
||||||
|
|
||||||
@ -608,8 +608,8 @@ TEST(DoubleShufti, ExecMatch1) {
|
|||||||
|
|
||||||
lits.insert(make_pair('a','b'));
|
lits.insert(make_pair('a','b'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
/* 0123456789012345678901234567890 */
|
/* 0123456789012345678901234567890 */
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
||||||
@ -629,8 +629,8 @@ TEST(DoubleShufti, ExecMatch2) {
|
|||||||
|
|
||||||
lits.insert(make_pair('a','a'));
|
lits.insert(make_pair('a','a'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
/* 0123456789012345678901234567890 */
|
/* 0123456789012345678901234567890 */
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
||||||
@ -651,8 +651,8 @@ TEST(DoubleShufti, ExecMatch3) {
|
|||||||
lits.insert(make_pair('B','a'));
|
lits.insert(make_pair('B','a'));
|
||||||
lits.insert(make_pair('a','a'));
|
lits.insert(make_pair('a','a'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
/* 0123456789012345678901234567890 */
|
/* 0123456789012345678901234567890 */
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbBaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbBaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
||||||
@ -675,8 +675,8 @@ TEST(DoubleShufti, ExecMatch4) {
|
|||||||
lits.insert(make_pair('C','a'));
|
lits.insert(make_pair('C','a'));
|
||||||
lits.insert(make_pair('c','a'));
|
lits.insert(make_pair('c','a'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
/* 0123456789012345678901234567890 */
|
/* 0123456789012345678901234567890 */
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbAaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbAaaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
||||||
@ -717,8 +717,8 @@ TEST(DoubleShufti, ExecMatch4b) {
|
|||||||
lits.insert(make_pair('a','C'));
|
lits.insert(make_pair('a','C'));
|
||||||
lits.insert(make_pair('a','c'));
|
lits.insert(make_pair('a','c'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
/* 0123456789012345678901234567890 */
|
/* 0123456789012345678901234567890 */
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbaAaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbaAaaaaaaaaaaaaaabbbbbbbbbbbbbbbabbbbbbbbbbbb";
|
||||||
@ -756,8 +756,8 @@ TEST(DoubleShufti, ExecMatch5) {
|
|||||||
|
|
||||||
lits.insert(make_pair('a','A'));
|
lits.insert(make_pair('a','A'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(CharReach(), lits, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -780,8 +780,8 @@ TEST(DoubleShufti, ExecMatchMixed1) {
|
|||||||
// just one one-byte literal
|
// just one one-byte literal
|
||||||
onebyte.set('a');
|
onebyte.set('a');
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
|
|
||||||
@ -804,8 +804,8 @@ TEST(DoubleShufti, ExecMatchMixed2) {
|
|||||||
onebyte.set('a');
|
onebyte.set('a');
|
||||||
twobyte.insert(make_pair('x', 'y'));
|
twobyte.insert(make_pair('x', 'y'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t1[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
char t2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
char t2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
||||||
@ -838,8 +838,8 @@ TEST(DoubleShufti, ExecMatchMixed3) {
|
|||||||
onebyte.set('a');
|
onebyte.set('a');
|
||||||
twobyte.insert(make_pair('x', 'y'));
|
twobyte.insert(make_pair('x', 'y'));
|
||||||
|
|
||||||
bool rv = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
bool ret = shuftiBuildDoubleMasks(onebyte, twobyte, &lo1, &hi1, &lo2, &hi2);
|
||||||
ASSERT_TRUE(rv);
|
ASSERT_TRUE(ret);
|
||||||
|
|
||||||
const int len = 420;
|
const int len = 420;
|
||||||
char t1[len + 1];
|
char t1[len + 1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user