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

@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include "my_base.h" /* ha_rows */
#include <my_sys.h> /* qsort2_cmp */
#include <my_cmp.h>
#include "queues.h"
#include "sql_string.h"
#include "sql_class.h"
@ -565,7 +565,7 @@ public:
bool not_killable;
String tmp_buffer;
// The fields below are used only by Unique class.
qsort2_cmp compare;
qsort_cmp2 compare;
BUFFPEK_COMPARE_CONTEXT cmp_context;
Sort_param()
@ -669,7 +669,7 @@ public:
void try_to_pack_sortkeys();
qsort2_cmp get_compare_function() const
qsort_cmp2 get_compare_function() const
{
return using_packed_sortkeys() ?
get_packed_keys_compare_ptr() :