diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-10-16 21:11:11 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-10-16 21:41:15 -0400 |
commit | 38e8ecd62a4e9dfcdf37bc31d8de6fb1fd39d6b5 (patch) | |
tree | 9bf8229ef081bcf1650f71f07e3da7f19be1faef /gobject | |
parent | b264fccd23cfb678fbaba9fc7459220f5eef7e14 (diff) |
more 'static' adding in testcases
No dead code found this time...
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/tests/binding.c | 2 | ||||
-rw-r--r-- | gobject/tests/boxed.c | 1 | ||||
-rw-r--r-- | gobject/tests/dynamictests.c | 5 | ||||
-rw-r--r-- | gobject/tests/ifaceproperties.c | 7 | ||||
-rw-r--r-- | gobject/tests/properties.c | 1 | ||||
-rw-r--r-- | gobject/tests/reference.c | 1 | ||||
-rw-r--r-- | gobject/tests/signals.c | 4 | ||||
-rw-r--r-- | gobject/tests/threadtests.c | 7 |
8 files changed, 22 insertions, 6 deletions
diff --git a/gobject/tests/binding.c b/gobject/tests/binding.c index 4d0465c7c..7f6716b86 100644 --- a/gobject/tests/binding.c +++ b/gobject/tests/binding.c @@ -25,6 +25,7 @@ enum PROP_SOURCE_TOGGLE }; +static GType binding_source_get_type (void); G_DEFINE_TYPE (BindingSource, binding_source, G_TYPE_OBJECT); static void @@ -133,6 +134,7 @@ enum PROP_TARGET_TOGGLE }; +static GType binding_target_get_type (void); G_DEFINE_TYPE (BindingTarget, binding_target, G_TYPE_OBJECT); static void diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c index 421a4378e..59fe4ba4f 100644 --- a/gobject/tests/boxed.c +++ b/gobject/tests/boxed.c @@ -36,6 +36,7 @@ my_boxed_free (gpointer orig) my_boxed_free_count++; } +static GType my_boxed_get_type (void); #define MY_TYPE_BOXED (my_boxed_get_type ()) G_DEFINE_BOXED_TYPE (MyBoxed, my_boxed, my_boxed_copy, my_boxed_free) diff --git a/gobject/tests/dynamictests.c b/gobject/tests/dynamictests.c index b2b29755e..2cd44cad9 100644 --- a/gobject/tests/dynamictests.c +++ b/gobject/tests/dynamictests.c @@ -101,7 +101,7 @@ static GType test_module_get_type (void) } -GTypeModule * +static GTypeModule * test_module_new (TestModuleRegisterFunc register_func) { TestModule *test_module = g_object_new (TEST_TYPE_MODULE, NULL); @@ -129,6 +129,7 @@ struct _DynamicObjectClass guint val; }; +static GType dynamic_object_get_type (void); G_DEFINE_DYNAMIC_TYPE(DynamicObject, dynamic_object, G_TYPE_OBJECT); static void @@ -250,8 +251,10 @@ struct _DynIfaceInterface static void dyn_obj_iface_init (DynIfaceInterface *iface); +static GType dyn_iface_get_type (void); G_DEFINE_INTERFACE (DynIface, dyn_iface, G_TYPE_OBJECT) +static GType dyn_obj_get_type (void); G_DEFINE_DYNAMIC_TYPE_EXTENDED(DynObj, dyn_obj, G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC(dyn_iface_get_type (), dyn_obj_iface_init)) diff --git a/gobject/tests/ifaceproperties.c b/gobject/tests/ifaceproperties.c index 14762fb6e..22fc747c5 100644 --- a/gobject/tests/ifaceproperties.c +++ b/gobject/tests/ifaceproperties.c @@ -34,9 +34,9 @@ * prop3: Defined in TestIface, Implemented in BaseObject, Overridden in DerivedObject * prop4: Defined in BaseObject, Overridden in DerivedObject */ - -static GType base_object_get_type (); -static GType derived_object_get_type (); + +static GType base_object_get_type (void); +static GType derived_object_get_type (void); enum { BASE_PROP_0, @@ -552,6 +552,7 @@ struct _Base2ObjectClass GObjectClass parent_class; }; +static GType base2_object_get_type (void); G_DEFINE_TYPE_WITH_CODE (Base2Object, base2_object, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE, base2_object_test_iface_init)) diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c index 2a842cda0..296adc34a 100644 --- a/gobject/tests/properties.c +++ b/gobject/tests/properties.c @@ -17,6 +17,7 @@ enum { PROP_0, PROP_FOO, PROP_BAR, PROP_BAZ, N_PROPERTIES }; static GParamSpec *properties[N_PROPERTIES] = { NULL, }; +static GType test_object_get_type (void); G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT); static void diff --git a/gobject/tests/reference.c b/gobject/tests/reference.c index 37793dd26..1106591f3 100644 --- a/gobject/tests/reference.c +++ b/gobject/tests/reference.c @@ -74,6 +74,7 @@ struct _MyObjectClassPrivate gint secret_class_count; }; +static GType my_object_get_type (void); G_DEFINE_TYPE_WITH_CODE (MyObject, my_object, G_TYPE_OBJECT, g_type_add_class_private (g_define_type_id, sizeof (MyObjectClassPrivate)) ); diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c index 420b60932..e54fbffec 100644 --- a/gobject/tests/signals.c +++ b/gobject/tests/signals.c @@ -12,7 +12,7 @@ typedef enum { TEST_UNSIGNED_ENUM_BAR = 0x80000000 } TestUnsignedEnum; -GType +static GType test_enum_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -34,7 +34,7 @@ test_enum_get_type (void) return g_define_type_id__volatile; } -GType +static GType test_unsigned_enum_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; diff --git a/gobject/tests/threadtests.c b/gobject/tests/threadtests.c index 91bb443f6..72392b40c 100644 --- a/gobject/tests/threadtests.c +++ b/gobject/tests/threadtests.c @@ -45,18 +45,22 @@ static void interface_per_class_init () { call_counter_init (NULL); } /* define 3 test interfaces */ typedef GTypeInterface MyFace0Interface; +static GType my_face0_get_type (void); G_DEFINE_INTERFACE (MyFace0, my_face0, G_TYPE_OBJECT); static void my_face0_default_init (MyFace0Interface *iface) { call_counter_init (iface); } typedef GTypeInterface MyFace1Interface; +static GType my_face1_get_type (void); G_DEFINE_INTERFACE (MyFace1, my_face1, G_TYPE_OBJECT); static void my_face1_default_init (MyFace1Interface *iface) { call_counter_init (iface); } typedef GTypeInterface MyFace2Interface; +static GType my_face2_get_type (void); G_DEFINE_INTERFACE (MyFace2, my_face2, G_TYPE_OBJECT); static void my_face2_default_init (MyFace2Interface *iface) { call_counter_init (iface); } /* define 3 test objects, adding interfaces 0 & 1, and adding interface 2 after class initialization */ typedef GObject MyTester0; typedef GObjectClass MyTester0Class; +static GType my_tester0_get_type (void); G_DEFINE_TYPE_WITH_CODE (MyTester0, my_tester0, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init); G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init); @@ -65,6 +69,7 @@ static void my_tester0_init (MyTester0*t) {} static void my_tester0_class_init (MyTester0Class*c) { call_counter_init (c); } typedef GObject MyTester1; typedef GObjectClass MyTester1Class; +static GType my_tester1_get_type (void); G_DEFINE_TYPE_WITH_CODE (MyTester1, my_tester1, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init); G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init); @@ -73,6 +78,7 @@ static void my_tester1_init (MyTester1*t) {} static void my_tester1_class_init (MyTester1Class*c) { call_counter_init (c); } typedef GObject MyTester2; typedef GObjectClass MyTester2Class; +static GType my_tester2_get_type (void); G_DEFINE_TYPE_WITH_CODE (MyTester2, my_tester2, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init); G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init); @@ -133,6 +139,7 @@ typedef struct { char *name; } PropTester; typedef GObjectClass PropTesterClass; +static GType prop_tester_get_type (void); G_DEFINE_TYPE (PropTester, prop_tester, G_TYPE_OBJECT); #define PROP_NAME 1 static void |