1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-34348: Consolidate cmp function declarations

Partial commit of the greater MDEV-34348 scope.
MDEV-34348: MariaDB is violating clang-16 -Wcast-function-type-strict

The functions queue_compare, qsort2_cmp, and qsort_cmp2
all had similar interfaces, and were used interchangable
and unsafely cast to one another.

This patch consolidates the functions all into the
qsort_cmp2 interface.

Reviewed By:
============
Marko Mäkelä <marko.makela@mariadb.com>
This commit is contained in:
Brandon Nesterenko
2024-10-26 08:17:03 -06:00
parent 3997d28f48
commit dbfee9fc2b
83 changed files with 678 additions and 524 deletions

View File

@ -343,11 +343,10 @@ public:
uint elements() { return (uint) (array->elements() / elem_size); }
void sort (int (*cmp) (void *ctxt, const void *el1, const void *el2),
void *cmp_arg)
void sort(qsort_cmp2 cmp, void *cmp_arg)
{
my_qsort2(array->front(), array->elements()/elem_size,
elem_size, (qsort2_cmp) cmp, cmp_arg);
my_qsort2(array->front(), array->elements() / elem_size, elem_size, cmp,
cmp_arg);
}
bool is_empty() { return elements() == 0; }
@ -464,7 +463,7 @@ public:
Rowid_filter_container *create_container();
double get_a() { return a; }
double get_a() const { return a; }
void trace_info(THD *thd);