mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +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
@@ -309,7 +309,7 @@ GType maman_bar_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
static const GTypeInfo info = {
|
||||
const GTypeInfo info = {
|
||||
/* You fill this structure. */
|
||||
};
|
||||
type = g_type_register_static (G_TYPE_OBJECT,
|
||||
@@ -422,7 +422,7 @@ maman_bar_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
static const GTypeInfo info = {
|
||||
const GTypeInfo info = {
|
||||
sizeof (MamanBarClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
@@ -727,7 +727,7 @@ maman_baz_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
static const GTypeInfo info = {
|
||||
const GTypeInfo info = {
|
||||
sizeof (MamanBazInterface),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
@@ -738,7 +738,7 @@ maman_baz_get_type (void)
|
||||
0, /* n_preallocs */
|
||||
NULL /* instance_init */
|
||||
};
|
||||
static const GInterfaceInfo ibaz_info = {
|
||||
const GInterfaceInfo ibaz_info = {
|
||||
(GInterfaceInitFunc) baz_interface_init, /* interface_init */
|
||||
NULL, /* interface_finalize */
|
||||
NULL /* interface_data */
|
||||
|
@@ -877,7 +877,7 @@ maman_ibaz_get_type (void)
|
||||
static GType iface_type = 0;
|
||||
if (iface_type == 0)
|
||||
{
|
||||
static const GTypeInfo info = {
|
||||
const GTypeInfo info = {
|
||||
sizeof (MamanIbazInterface),
|
||||
maman_ibaz_base_init, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
|
Reference in New Issue
Block a user