Fix clang-tidy bugprone-multi-level-implicit-pointer-conversion warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-16 13:41:10 -07:00
parent 9e83759e83
commit d0bbc61bd4
3 changed files with 13 additions and 3 deletions

View file

@ -340,7 +340,9 @@ Manager::Filter::~Filter() {
for ( int i = 0; i < num_fields; ++i )
delete fields[i];
free(fields);
// Static cast this to void* to avoid a clang-tidy warning about converting from the
// double-pointer to void*
free(static_cast<void*>(fields));
Unref(path_val);
Unref(config);
@ -811,7 +813,9 @@ bool Manager::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, Tab
// Alright, we want this field.
filter->indices.push_back(new_indices);
void* tmp = realloc(filter->fields, sizeof(threading::Field*) * (filter->num_fields + 1));
// Static cast this to void* to avoid a clang-tidy warning about converting from the
// double-pointer to void*
void* tmp = realloc(static_cast<void*>(filter->fields), sizeof(threading::Field*) * (filter->num_fields + 1));
if ( ! tmp ) {
reporter->Error("out of memory in add_filter");