Add more C style casts fixes and suppressions

This commit is contained in:
Konstantinos Margaritis
2024-05-18 21:48:40 +03:00
parent 92d5db503e
commit 40da067b4f
13 changed files with 78 additions and 51 deletions

View File

@@ -104,7 +104,7 @@ TEST(ExtParam, LargeExactOffset) {
// Try the exact match.
corpus = "hatstand" + string(199983, '_') + "teakettle";
err = hs_scan(db, corpus.c_str(), corpus.length(), 0, scratch, record_cb,
(void *)&c);
reinterpret_cast<void *>(&c));
ASSERT_EQ(HS_SUCCESS, err);
ASSERT_EQ(1U, c.matches.size());
ASSERT_EQ(MatchRecord(200000, 0), c.matches[0]);

View File

@@ -52,7 +52,7 @@ static
int vectorCallback(unsigned id, unsigned long long from,
unsigned long long to, unsigned, void *ctx) {
//printf("match id %u at (%llu,%llu)\n", id, from, to);
vector<Match> *matches = (vector<Match> *)ctx;
vector<Match> *matches = reinterpret_cast<vector<Match> *>(ctx);
matches->push_back(Match(id, from, to));
return 0;
}