gobject: remove -DG_DISABLE_CONST_RETURNS
authorRyan Lortie <desrt@desrt.ca>
Thu, 9 Jun 2011 15:11:30 +0000 (11:11 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 9 Jun 2011 15:11:30 +0000 (11:11 -0400)
GObject had a few cases of depending on G_CONST_RETURN not being defined
to 'const'.  Remove those in preparation for deprecation of
G_CONST_RETURN.

gobject/Makefile.am
gobject/gbinding.c
gobject/gobject.c
gobject/gparam.c
gobject/gtype.c
gobject/testgobject.c

index 8c6da9b..5250548 100644 (file)
@@ -18,8 +18,7 @@ AM_CPPFLAGS =                                         \
        $(GLIB_DEBUG_FLAGS)                     \
        $(THREAD_FLAGS)                         \
        -DG_DISABLE_DEPRECATED                  \
-       -DGOBJECT_COMPILATION                   \
-       -DG_DISABLE_CONST_RETURNS
+       -DGOBJECT_COMPILATION
 
 gobject.def: gobject.symbols
        $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gobject.symbols | $(SED) -e '/^$$/d' -e 's/^/      /' -e 's/G_GNUC_[^ ]*//g' | sort) > gobject.def
index de234f7..19aaeed 100644 (file)
@@ -151,8 +151,8 @@ struct _GBinding
   GObject *target;
 
   /* the property names are interned, so they should not be freed */
-  gchar *source_property;
-  gchar *target_property;
+  const gchar *source_property;
+  const gchar *target_property;
 
   GParamSpec *source_pspec;
   GParamSpec *target_pspec;
index 60d297d..ca9c0a1 100644 (file)
@@ -1148,7 +1148,7 @@ object_set_property (GObject             *object,
   GObjectClass *class = g_type_class_peek (pspec->owner_type);
   guint param_id = PARAM_SPEC_PARAM_ID (pspec);
   GParamSpec *redirect;
-  static gchar* enable_diagnostic = NULL;
+  static const gchar * enable_diagnostic = NULL;
 
   if (class == NULL)
     {
index fe1dd9f..cdd2d9f 100644 (file)
@@ -421,7 +421,8 @@ g_param_spec_internal (GType        param_type,
 
   if (flags & G_PARAM_STATIC_NAME)
     {
-      pspec->name = g_intern_static_string (name);
+      /* pspec->name is not freed if (flags & G_PARAM_STATIC_NAME) */
+      pspec->name = (gchar *) g_intern_static_string (name);
       if (!is_canonical (pspec->name))
         g_warning ("G_PARAM_STATIC_NAME used with non-canonical pspec name: %s", pspec->name);
     }
index d23bd2c..894da15 100644 (file)
@@ -488,7 +488,7 @@ type_node_any_new_W (TypeNode             *pnode,
   node->global_gdata = NULL;
   
   g_hash_table_insert (static_type_nodes_ht,
-                      g_quark_to_string (node->qname),
+                      (gpointer) g_quark_to_string (node->qname),
                       (gpointer) type);
   return node;
 }
index 1861c3c..ac6bc26 100644 (file)
@@ -231,8 +231,8 @@ test_signal_accumulator (GSignalInvocationHint *ihint,
                         const GValue          *handler_return,
                         gpointer               data)
 {
-  gchar *accu_string = g_value_get_string (return_accu);
-  gchar *new_string = g_value_get_string (handler_return);
+  const gchar *accu_string = g_value_get_string (return_accu);
+  const gchar *new_string = g_value_get_string (handler_return);
   gchar *result_string;
 
   if (accu_string)