mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-34348: Miscellaneous fixes
Partial commit of the greater MDEV-34348 scope. MDEV-34348: MariaDB is violating clang-16 -Wcast-function-type-strict Various additional fixes, each too small to put into their own commit. Reviewed By: ============ Marko Mäkelä <marko.makela@mariadb.com>
This commit is contained in:
@ -129,8 +129,6 @@ struct list_node :public Sql_alloc
|
||||
}
|
||||
};
|
||||
|
||||
typedef bool List_eq(void *a, void *b);
|
||||
|
||||
extern MYSQL_PLUGIN_IMPORT list_node end_of_list;
|
||||
|
||||
class base_list :public Sql_alloc
|
||||
@ -301,11 +299,12 @@ public:
|
||||
inline void **head_ref() { return first != &end_of_list ? &first->info : 0; }
|
||||
inline bool is_empty() { return first == &end_of_list ; }
|
||||
inline list_node *last_ref() { return &end_of_list; }
|
||||
inline bool add_unique(void *info, List_eq *eq)
|
||||
template <typename T= void>
|
||||
inline bool add_unique(T *info, bool (*eq)(T *a, T *b))
|
||||
{
|
||||
list_node *node= first;
|
||||
for (;
|
||||
node != &end_of_list && (!(*eq)(node->info, info));
|
||||
node != &end_of_list && (!(*eq)(static_cast<T *>(node->info), info));
|
||||
node= node->next) ;
|
||||
if (node == &end_of_list)
|
||||
return push_back(info);
|
||||
@ -513,7 +512,7 @@ public:
|
||||
inline void prepend(List<T> *list) { base_list::prepend(list); }
|
||||
inline void disjoin(List<T> *list) { base_list::disjoin(list); }
|
||||
inline bool add_unique(T *a, bool (*eq)(T *a, T *b))
|
||||
{ return base_list::add_unique(a, (List_eq *)eq); }
|
||||
{ return base_list::add_unique<T>(a, eq); }
|
||||
inline bool copy(const List<T> *list, MEM_ROOT *root)
|
||||
{ return base_list::copy(list, root); }
|
||||
void delete_elements(void)
|
||||
|
Reference in New Issue
Block a user