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

@@ -277,8 +277,8 @@ typedef struct st_partition_part_key_multi_range_hld
} PARTITION_PART_KEY_MULTI_RANGE_HLD;
extern "C" int cmp_key_part_id(void *key_p, uchar *ref1, uchar *ref2);
extern "C" int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2);
extern "C" int cmp_key_part_id(void *key_p, const void *ref1, const void *ref2);
extern "C" int cmp_key_rowid_part_id(void *ptr, const void *ref1, const void *ref2);
class ha_partition :public handler
{
@@ -446,9 +446,7 @@ private:
/** Sorted array of partition ids in descending order of number of rows. */
uint32 *m_part_ids_sorted_by_num_of_records;
/* Compare function for my_qsort2, for reversed order. */
static int compare_number_of_records(ha_partition *me,
const uint32 *a,
const uint32 *b);
static int compare_number_of_records(void *me, const void *a, const void *b);
/** keep track of partitions to call ha_reset */
MY_BITMAP m_partitions_to_reset;
/** partitions that returned HA_ERR_KEY_NOT_FOUND. */
@@ -1635,8 +1633,9 @@ public:
int notify_tabledef_changed(LEX_CSTRING *db, LEX_CSTRING *table,
LEX_CUSTRING *frm, LEX_CUSTRING *version);
friend int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2);
friend int cmp_key_part_id(void *key_p, uchar *ref1, uchar *ref2);
friend int cmp_key_rowid_part_id(void *ptr, const void *ref1,
const void *ref2);
friend int cmp_key_part_id(void *key_p, const void *ref1, const void *ref2);
bool can_convert_nocopy(const Field &field,
const Column_definition &new_field) const override;