mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +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:
@ -6116,15 +6116,19 @@ static int cmp_file_names(const void *a, const void *b)
|
||||
return cs->strnncoll(aa, strlen(aa), bb, strlen(bb));
|
||||
}
|
||||
|
||||
static int cmp_table_names(LEX_CSTRING * const *a, LEX_CSTRING * const *b)
|
||||
static int cmp_table_names(const void *a_, const void *b_)
|
||||
{
|
||||
auto a= static_cast<const LEX_CSTRING *const *>(a_);
|
||||
auto b= static_cast<const LEX_CSTRING *const *>(b_);
|
||||
return my_charset_bin.strnncoll((*a)->str, (*a)->length,
|
||||
(*b)->str, (*b)->length);
|
||||
}
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
static int cmp_table_names_desc(LEX_CSTRING * const *a, LEX_CSTRING * const *b)
|
||||
static int cmp_table_names_desc(const void *a_, const void *b_)
|
||||
{
|
||||
auto a= static_cast<const LEX_CSTRING *const *>(a_);
|
||||
auto b= static_cast<const LEX_CSTRING *const *>(b_);
|
||||
return -cmp_table_names(a, b);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user