mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -7679,10 +7679,10 @@ static void print_version(void)
|
||||
}
|
||||
|
||||
/** Compares two options' names, treats - and _ the same */
|
||||
static int option_cmp(my_option *a, my_option *b)
|
||||
static int option_cmp(const void *a, const void *b)
|
||||
{
|
||||
const char *sa= a->name;
|
||||
const char *sb= b->name;
|
||||
const char *sa= static_cast<const my_option *>(a)->name;
|
||||
const char *sb= static_cast<const my_option *>(b)->name;
|
||||
for (; *sa || *sb; sa++, sb++)
|
||||
{
|
||||
if (*sa < *sb)
|
||||
|
Reference in New Issue
Block a user