Tue, 09 Jul 2024 02:03:20 -0500
Fix incompatible pointer types for GtkItemFactoryCallbacks on gcc-14
The GtkItemFactoryEntry struct callback is of type GtkItemFactoryCallbacks
(aka void (*)(void)) but is initialised with GtkItemFactoryCallback1 types
(aka void (*)(void *, guint, GtkWidget *)).
This is coherent with the gtk-2 documentation:
> gtk_item_factory_create_items(..., GtkItemFactoryEntry *entries,...)
> entries : an array of GtkItemFactoryEntrys whose callback members must by of
> type GtkItemFactoryCallback1
But, under gcc-14, the implicit cast from GtkItemFactoryCallback1 to
GtkItemFactoryCallback triggers an incompatible-pointer-types error (See [gcc-doc]).
An exemple of this error:
pidgin/gtkconv.c:3096:66: error: initialization of 'void (*)(void)' from incompatible pointer type 'void (*)(void *, guint, GtkWidget *)' {aka 'void (*)(void *, unsigned int, struct _GtkWidget *)'} [-Wincompatible-pointer-types]
3096 | { N_("/Conversation/New Instant _Message..."), "<CTL>M", menu_new_conv_cb,
| ^~~~~~~~~~~~~~~~
pidgin/gtkconv.c:3096:66: note: (near initialization for 'menu_items[1].callback')
To fix this, explicitely cast to GtkItemFactoryCallback where needed.
[0]: https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types
Testing Done:
Built with gcc-14, started and clicked on some affected menus
Reviewed at https://reviews.imfreedom.org/r/3282/
|
17880
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
1 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
2 | #ifndef __gtksourceview_marshal_MARSHAL_H__ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
3 | #define __gtksourceview_marshal_MARSHAL_H__ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
4 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
5 | #include <glib-object.h> |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
6 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
7 | G_BEGIN_DECLS |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
8 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
9 | /* VOID:VOID (gtksourceview-marshal.list:1) */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
10 | #define gtksourceview_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
11 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
12 | /* VOID:BOOLEAN (gtksourceview-marshal.list:2) */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
13 | #define gtksourceview_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
14 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
15 | /* VOID:BOXED (gtksourceview-marshal.list:3) */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
16 | #define gtksourceview_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
17 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
18 | /* VOID:BOXED,BOXED (gtksourceview-marshal.list:4) */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
19 | extern void gtksourceview_marshal_VOID__BOXED_BOXED (GClosure *closure, |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
20 | GValue *return_value, |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
21 | guint n_param_values, |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
22 | const GValue *param_values, |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
23 | gpointer invocation_hint, |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
24 | gpointer marshal_data); |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
25 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
26 | /* VOID:STRING (gtksourceview-marshal.list:5) */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
27 | #define gtksourceview_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
28 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
29 | G_END_DECLS |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
30 | |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
31 | #endif /* __gtksourceview_marshal_MARSHAL_H__ */ |
|
5e73968467e0
Undo/Redo in GtkImHtml from GtkSourceView. This may not be adaquate enough for us.
Sean Egan <seanegan@pidgin.im>
parents:
diff
changeset
|
32 |