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
@@ -77,7 +77,7 @@ value_free (GValue *value)
|
||||
void
|
||||
_g_boxed_type_init (void)
|
||||
{
|
||||
static const GTypeInfo info = {
|
||||
const GTypeInfo info = {
|
||||
0, /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_destroy */
|
||||
|
@@ -88,7 +88,7 @@ _g_enum_types_init (void)
|
||||
"p", /* lcopy_format */
|
||||
value_flags_enum_lcopy_value, /* lcopy_value */
|
||||
};
|
||||
static GTypeInfo info = {
|
||||
GTypeInfo info = {
|
||||
0, /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_destroy */
|
||||
|
@@ -346,7 +346,7 @@ _g_object_type_init (void)
|
||||
static const GTypeFundamentalInfo finfo = {
|
||||
G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE,
|
||||
};
|
||||
static GTypeInfo info = {
|
||||
GTypeInfo info = {
|
||||
sizeof (GObjectClass),
|
||||
(GBaseInitFunc) g_object_base_class_init,
|
||||
(GBaseFinalizeFunc) g_object_base_class_finalize,
|
||||
|
@@ -101,7 +101,7 @@ _g_param_type_init (void)
|
||||
"p", /* lcopy_format */
|
||||
value_param_lcopy_value, /* lcopy_value */
|
||||
};
|
||||
static const GTypeInfo param_spec_info = {
|
||||
const GTypeInfo param_spec_info = {
|
||||
sizeof (GParamSpecClass),
|
||||
|
||||
(GBaseInitFunc) g_param_spec_class_base_init,
|
||||
|
@@ -1366,7 +1366,7 @@ gpointer g_type_class_get_private (GTypeClass *klass,
|
||||
* (GInstanceInitFunc) gtk_gadget_init,
|
||||
* (GTypeFlags) flags);
|
||||
* {
|
||||
* static const GInterfaceInfo g_implement_interface_info = {
|
||||
* const GInterfaceInfo g_implement_interface_info = {
|
||||
* (GInterfaceInitFunc) gtk_gadget_gizmo_init
|
||||
* };
|
||||
* g_type_add_interface_static (g_define_type_id, TYPE_GIZMO, &g_implement_interface_info);
|
||||
|
@@ -153,7 +153,7 @@ g_type_module_get_type (void)
|
||||
|
||||
if (!type_module_type)
|
||||
{
|
||||
static const GTypeInfo type_module_info = {
|
||||
const GTypeInfo type_module_info = {
|
||||
sizeof (GTypeModuleClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
@@ -164,7 +164,7 @@ g_type_module_get_type (void)
|
||||
0, /* n_preallocs */
|
||||
NULL, /* instance_init */
|
||||
};
|
||||
static const GInterfaceInfo iface_info = {
|
||||
const GInterfaceInfo iface_info = {
|
||||
(GInterfaceInitFunc) g_type_module_iface_init,
|
||||
NULL, /* interface_finalize */
|
||||
NULL, /* interface_data */
|
||||
|
@@ -95,7 +95,7 @@ g_type_plugin_get_type (void)
|
||||
|
||||
if (!type_plugin_type)
|
||||
{
|
||||
static const GTypeInfo type_plugin_info = {
|
||||
const GTypeInfo type_plugin_info = {
|
||||
sizeof (GTypePluginClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
|
@@ -1424,7 +1424,7 @@ g_strdup_value_contents (const GValue *value)
|
||||
GType
|
||||
g_pointer_type_register_static (const gchar *name)
|
||||
{
|
||||
static const GTypeInfo type_info = {
|
||||
const GTypeInfo type_info = {
|
||||
0, /* class_size */
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
|
@@ -47,7 +47,7 @@ test_iface_get_type (void)
|
||||
|
||||
if (!test_iface_type)
|
||||
{
|
||||
static const GTypeInfo test_iface_info =
|
||||
const GTypeInfo test_iface_info =
|
||||
{
|
||||
sizeof (TestIfaceClass),
|
||||
(GBaseInitFunc) iface_base_init, /* base_init */
|
||||
@@ -163,7 +163,7 @@ test_object_get_type (void)
|
||||
|
||||
if (!test_object_type)
|
||||
{
|
||||
static const GTypeInfo test_object_info =
|
||||
const GTypeInfo test_object_info =
|
||||
{
|
||||
sizeof (TestObjectClass),
|
||||
NULL, /* base_init */
|
||||
@@ -327,7 +327,7 @@ derived_object_get_type (void)
|
||||
|
||||
if (!derived_object_type)
|
||||
{
|
||||
static const GTypeInfo derived_object_info =
|
||||
const GTypeInfo derived_object_info =
|
||||
{
|
||||
sizeof (DerivedObjectClass),
|
||||
NULL, /* base_init */
|
||||
|
Reference in New Issue
Block a user