miniobject: cleanup type registration a little
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 18 May 2010 16:35:58 +0000 (18:35 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 18 May 2010 16:37:25 +0000 (18:37 +0200)
We can make some structs const static with little effort.

gst/gstminiobject.c

index c7d2bb836cdd85fa7d34a8aede1bd317d1fd0de4..c5606d80bb62b724726d328794f3c455e36acae6 100644 (file)
@@ -71,7 +71,7 @@ gst_mini_object_get_type (void)
   static GType _gst_mini_object_type = 0;
 
   if (G_UNLIKELY (_gst_mini_object_type == 0)) {
-    GTypeValueTable value_table = {
+    static const GTypeValueTable value_table = {
       gst_value_mini_object_init,
       gst_value_mini_object_free,
       gst_value_mini_object_copy,
@@ -81,7 +81,7 @@ gst_mini_object_get_type (void)
       (char *) "p",
       gst_value_mini_object_lcopy
     };
-    GTypeInfo mini_object_info = {
+    static const GTypeInfo mini_object_info = {
       sizeof (GstMiniObjectClass),
 #if 0
       gst_mini_object_base_init,
@@ -95,15 +95,13 @@ gst_mini_object_get_type (void)
       sizeof (GstMiniObject),
       0,
       (GInstanceInitFunc) gst_mini_object_init,
-      NULL
+      &value_table
     };
     static const GTypeFundamentalInfo mini_object_fundamental_info = {
       (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE |
           G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE)
     };
 
-    mini_object_info.value_table = &value_table;
-
     _gst_mini_object_type = g_type_fundamental_next ();
     g_type_register_fundamental (_gst_mini_object_type, "GstMiniObject",
         &mini_object_info, &mini_object_fundamental_info, G_TYPE_FLAG_ABSTRACT);