pidgin/gtkcertmgr.h

Tue, 09 Jul 2024 02:03:20 -0500

author
Yoann Congal <yoann.congal@smile.fr>
date
Tue, 09 Jul 2024 02:03:20 -0500
branch
release-2.x.y
changeset 42808
210f318db492
parent 19859
71d37b57eff2
child 32790
b95c7c504118
permissions
-rw-r--r--

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/

18651
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
1 /**
18650
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
2 * @file gtkcertmgr.h GTK+ Certificate Manager API
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
3 * @ingroup pidgin
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
4 */
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
5 /*
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
6 * pidgin
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
7 *
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
10 * source distribution.
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
11 *
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
16 *
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
21 *
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
23 * 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: 18821
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
18650
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
25 *
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
26 */
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
27
18651
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
28 #ifndef _PIDGINCERTMGR_H_
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
29 #define _PIDGINCERTMGR_H_
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
30
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
31 /**************************************************************************
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
32 * @name Structures *
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
33 **************************************************************************/
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
34 typedef struct _PidginCertificateManager PidginCertificateManager;
18650
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
35
18820
4151da0055b3 - Add a Certificate GTK management interface type
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18815
diff changeset
36 /**
4151da0055b3 - Add a Certificate GTK management interface type
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18815
diff changeset
37 * GTK+ Certificate Manager subwidget
4151da0055b3 - Add a Certificate GTK management interface type
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18815
diff changeset
38 */
18651
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
39 struct _PidginCertificateManager {
18820
4151da0055b3 - Add a Certificate GTK management interface type
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18815
diff changeset
40 /** Create, configure, show, and return the management interface */
4151da0055b3 - Add a Certificate GTK management interface type
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18815
diff changeset
41 GtkWidget * (* build)(void);
18821
7024d0ee56e1 - Add label field to PidginCertificateManager
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18820
diff changeset
42 /** Notebook label to use in the CertMgr dialog */
7024d0ee56e1 - Add label field to PidginCertificateManager
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18820
diff changeset
43 gchar *label;
18651
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
44 };
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
45
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
46 /**************************************************************************/
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
47 /** @name Certificate Manager API */
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
48 /**************************************************************************/
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
49 /*@{*/
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
50 /**
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
51 * Show the certificate manager window
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
52 */
18650
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
53 void pidgin_certmgr_show(void);
8a34ac83df75 - Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
54
18815
a3d656beadcf - Make a real Certificate Manager dialog instead of a stupid popup. It
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18651
diff changeset
55 /**
a3d656beadcf - Make a real Certificate Manager dialog instead of a stupid popup. It
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18651
diff changeset
56 * Hide the certificate manager window
a3d656beadcf - Make a real Certificate Manager dialog instead of a stupid popup. It
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18651
diff changeset
57 */
a3d656beadcf - Make a real Certificate Manager dialog instead of a stupid popup. It
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18651
diff changeset
58 void pidgin_certmgr_hide(void);
a3d656beadcf - Make a real Certificate Manager dialog instead of a stupid popup. It
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18651
diff changeset
59
18651
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
60 /*@}*/
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
61
b2639d73930c - More skeleton
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18650
diff changeset
62 #endif /* _PIDGINCERTMGR_H_ */

mercurial