[glib] gobject: remove -DG_DISABLE_CONST_RETURNS



commit 8f21e8145cf084ecd66c30cd868f56f7dcd87334
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jun 9 11:11:30 2011 -0400

    gobject: remove -DG_DISABLE_CONST_RETURNS
    
    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   |    3 +--
 gobject/gbinding.c    |    4 ++--
 gobject/gobject.c     |    2 +-
 gobject/gparam.c      |    3 ++-
 gobject/gtype.c       |    2 +-
 gobject/testgobject.c |    4 ++--
 6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 8c6da9b..5250548 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -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
diff --git a/gobject/gbinding.c b/gobject/gbinding.c
index de234f7..19aaeed 100644
--- a/gobject/gbinding.c
+++ b/gobject/gbinding.c
@@ -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;
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 60d297d..ca9c0a1 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -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)
     {
diff --git a/gobject/gparam.c b/gobject/gparam.c
index fe1dd9f..cdd2d9f 100644
--- a/gobject/gparam.c
+++ b/gobject/gparam.c
@@ -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);
     }
diff --git a/gobject/gtype.c b/gobject/gtype.c
index d23bd2c..894da15 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -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;
 }
diff --git a/gobject/testgobject.c b/gobject/testgobject.c
index 1861c3c..ac6bc26 100644
--- a/gobject/testgobject.c
+++ b/gobject/testgobject.c
@@ -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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]