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:
@ -2957,8 +2957,10 @@ bool quick_rm_table(THD *thd, handlerton *base, const LEX_CSTRING *db,
|
||||
PRIMARY keys are prioritized.
|
||||
*/
|
||||
|
||||
static int sort_keys(KEY *a, KEY *b)
|
||||
static int sort_keys(const void *a_, const void *b_)
|
||||
{
|
||||
const KEY *a= static_cast<const KEY *>(a_);
|
||||
const KEY *b= static_cast<const KEY *>(b_);
|
||||
ulong a_flags= a->flags, b_flags= b->flags;
|
||||
|
||||
/*
|
||||
@ -7143,8 +7145,10 @@ static bool fix_constraints_names(THD *thd, List<Virtual_column_info>
|
||||
}
|
||||
|
||||
|
||||
static int compare_uint(const uint *s, const uint *t)
|
||||
static int compare_uint(const void *s_, const void *t_)
|
||||
{
|
||||
const uint *s= static_cast<const uint *>(s_);
|
||||
const uint *t= static_cast<const uint *>(t_);
|
||||
return (*s < *t) ? -1 : ((*s > *t) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user