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

@@ -94,7 +94,7 @@ hs_database_t * loadDatabase(const char *filename, bool verbose) {
}
size_t len = st.st_size;
bytes = (char *)mmap(nullptr, len, PROT_READ, MAP_SHARED, fd, 0);
bytes = reinterpret_cast<char *>(mmap(nullptr, len, PROT_READ, MAP_SHARED, fd, 0));
if (bytes == MAP_FAILED) {
cout << "mmap failed" << endl;
close(fd);

View File

@@ -141,7 +141,7 @@ void prettyPrintRange(std::ostream &out, it_t begin, it_t end) {
static really_inline
char *makeHex(const unsigned char *pat, unsigned patlen) {
size_t hexlen = patlen * 4;
char *hexbuf = (char *)malloc(hexlen + 1);
char *hexbuf = reinterpret_cast<char *>(malloc(hexlen + 1));
unsigned i;
char *buf;
for (i = 0, buf = hexbuf; i < patlen; i++, buf += 4) {