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:
@@ -30,10 +30,11 @@ typedef struct st_my_ft_parser_param
|
||||
MEM_ROOT *mem_root;
|
||||
} MY_FT_PARSER_PARAM;
|
||||
|
||||
static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2)
|
||||
static int FT_WORD_cmp(void *cs_, const void *w1_, const void *w2_)
|
||||
{
|
||||
return ha_compare_word(cs, (uchar*) w1->pos, w1->len,
|
||||
(uchar*) w2->pos, w2->len);
|
||||
CHARSET_INFO *cs= cs_;
|
||||
const FT_WORD *w1= w1_, *w2= w2_;
|
||||
return ha_compare_word(cs, w1->pos, w1->len, w2->pos, w2->len);
|
||||
}
|
||||
|
||||
static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
|
||||
@@ -257,8 +258,8 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
|
||||
{
|
||||
DBUG_ENTER("ft_parse_init");
|
||||
if (!is_tree_inited(wtree))
|
||||
init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0,
|
||||
(void*)cs, MYF(0));
|
||||
init_tree(wtree, 0, 0, sizeof(FT_WORD), &FT_WORD_cmp, 0, (void *) cs,
|
||||
MYF(0));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user