1
0
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:
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

@ -5844,9 +5844,9 @@ cmp_item *Type_handler_timestamp_common::make_cmp_item(THD *thd,
/***************************************************************************/
static int srtcmp_in(const void *cs_, const void *x_, const void *y_)
static int srtcmp_in(void *cs_, const void *x_, const void *y_)
{
const CHARSET_INFO *cs= static_cast<const CHARSET_INFO *>(cs_);
CHARSET_INFO *cs= static_cast<CHARSET_INFO *>(cs_);
const String *x= static_cast<const String *>(x_);
const String *y= static_cast<const String *>(y_);
return cs->strnncollsp(x->ptr(), x->length(), y->ptr(), y->length());
@ -5856,12 +5856,10 @@ in_vector *Type_handler_string_result::make_in_vector(THD *thd,
const Item_func_in *func,
uint nargs) const
{
return new (thd->mem_root) in_string(thd, nargs, (qsort2_cmp) srtcmp_in,
func->compare_collation());
return new (thd->mem_root)
in_string(thd, nargs, srtcmp_in, func->compare_collation());
}
in_vector *Type_handler_int_result::make_in_vector(THD *thd,
const Item_func_in *func,
uint nargs) const