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/
| 9709 | 1 | /** |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
2 | * @defgroup pidgin Pidgin (GTK+ User Interface) |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
3 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | /* pidgin |
| 9709 | 6 | * |
| 15572 | 7 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 9709 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17648
diff
changeset
|
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 9709 | 24 | */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
25 | #ifndef _PIDGINDIALOGS_H_ |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
26 | #define _PIDGINDIALOGS_H_ |
| 9709 | 27 | |
| 15577 | 28 | #include "pidgin.h" |
|
9718
aeee69c6c784
[gaim-migrate @ 10579]
Mark Doliner <markdoliner@pidgin.im>
parents:
9714
diff
changeset
|
29 | |
| 9709 | 30 | #include "account.h" |
| 31 | #include "conversation.h" | |
| 32 | ||
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9709
diff
changeset
|
33 | /* Functions in gtkdialogs.c (these should actually stay in this file) */ |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
34 | void pidgin_dialogs_destroy_all(void); |
|
20699
22e12fba91bf
Making pidgin_dialogs_about _with_parent
Gabriel Schulhof <nix@go-nix.ca>
parents:
20684
diff
changeset
|
35 | void pidgin_dialogs_about(void); |
|
29522
a5595d764a85
Split the "Debugging Information" and translator info into "Build Information"
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24569
diff
changeset
|
36 | void pidgin_dialogs_buildinfo(void); |
|
29525
424be0764e27
Break the developer information out into its own dialog. I also bolded a few
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29522
diff
changeset
|
37 | void pidgin_dialogs_developers(void); |
|
29522
a5595d764a85
Split the "Debugging Information" and translator info into "Build Information"
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24569
diff
changeset
|
38 | void pidgin_dialogs_translators(void); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29525
diff
changeset
|
39 | void pidgin_dialogs_plugins_info(void); |
| 19448 | 40 | void pidgin_dialogs_im(void); |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
41 | void pidgin_dialogs_im_with_user(PurpleAccount *, const char *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
42 | void pidgin_dialogs_info(void); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
43 | void pidgin_dialogs_log(void); |
|
17648
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
44 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
22099
diff
changeset
|
45 | #if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKDIALOGS_C_) |
|
17648
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
46 | /** |
|
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
47 | * @deprecated This function is no longer used and will be removed in |
|
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
48 | * Pidgin 3.0.0 unless there is sufficient demand to keep it. |
|
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
49 | */ |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
50 | void pidgin_dialogs_alias_contact(PurpleContact *); |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
22099
diff
changeset
|
51 | #endif |
|
17648
5e5e1c1e1570
Add a "deprecated" note about pidgin_dialogs_alias_contact() which
Mark Doliner <markdoliner@pidgin.im>
parents:
16263
diff
changeset
|
52 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
53 | void pidgin_dialogs_alias_buddy(PurpleBuddy *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
54 | void pidgin_dialogs_alias_chat(PurpleChat *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
55 | void pidgin_dialogs_remove_buddy(PurpleBuddy *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
56 | void pidgin_dialogs_remove_group(PurpleGroup *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
57 | void pidgin_dialogs_remove_chat(PurpleChat *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
58 | void pidgin_dialogs_remove_contact(PurpleContact *); |
|
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
59 | void pidgin_dialogs_merge_groups(PurpleGroup *, const char *); |
|
9714
589046af53cb
[gaim-migrate @ 10575]
Mark Doliner <markdoliner@pidgin.im>
parents:
9713
diff
changeset
|
60 | |
|
589046af53cb
[gaim-migrate @ 10575]
Mark Doliner <markdoliner@pidgin.im>
parents:
9713
diff
changeset
|
61 | /* Everything after this should probably be moved elsewhere */ |
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9709
diff
changeset
|
62 | |
|
22099
8e70e3ba6096
Modified patch from Gabriel (Sylar?) Schulof to deprecate PIDGIN_DIALOG. Closes #4535. (PS: I am aware of --author).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21653
diff
changeset
|
63 | #ifndef PIDGIN_DISABLE_DEPRECATED |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
22099
diff
changeset
|
64 | /* This PIDGIN_DISABLE_DEPRECATED doesn't need to be deactivated by |
|
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
22099
diff
changeset
|
65 | * _PIDGIN_GTKDIALOGS_C_, because it shouldn't be using this macro. */ |
| 15571 | 66 | #define PIDGIN_DIALOG(x) x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \ |
| 9709 | 67 | gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG) |
|
22099
8e70e3ba6096
Modified patch from Gabriel (Sylar?) Schulof to deprecate PIDGIN_DIALOG. Closes #4535. (PS: I am aware of --author).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21653
diff
changeset
|
68 | #endif |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
22099
diff
changeset
|
69 | |
| 15571 | 70 | #define PIDGIN_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED) |
| 9709 | 71 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
72 | #endif /* _PIDGINDIALOGS_H_ */ |