mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
Do not use static GTypeInfo and GInterfaceInfo
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED) and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and GInterfaceInfo structs, while tutorials and source code often use static variables. This commit consistently adopts the former method. https://bugzilla.gnome.org/show_bug.cgi?id=600161
This commit is contained in:
committed by
Matthias Clasen
parent
1f33446e1f
commit
f24d8247b3
@@ -32,7 +32,7 @@ prefix ## _get_type (void) \
|
||||
\
|
||||
if (!object_type) \
|
||||
{ \
|
||||
static const GTypeInfo object_info = \
|
||||
const GTypeInfo object_info = \
|
||||
{ \
|
||||
sizeof (name ## Class), \
|
||||
(GBaseInitFunc) base_init, \
|
||||
@@ -68,7 +68,7 @@ prefix ## _get_type (void) \
|
||||
\
|
||||
if (!iface_type) \
|
||||
{ \
|
||||
static const GTypeInfo iface_info = \
|
||||
const GTypeInfo iface_info = \
|
||||
{ \
|
||||
sizeof (name ## Class), \
|
||||
(GBaseInitFunc) base_init, \
|
||||
@@ -85,7 +85,7 @@ prefix ## _get_type (void) \
|
||||
|
||||
#define INTERFACE_FULL(type, init_func, iface_type) \
|
||||
{ \
|
||||
static GInterfaceInfo const iface = \
|
||||
GInterfaceInfo const iface = \
|
||||
{ \
|
||||
(GInterfaceInitFunc) init_func, NULL, NULL \
|
||||
}; \
|
||||
|
Reference in New Issue
Block a user