gobject: Use local variable names in macros less likely to clash
authorColin Walters <walters@verbum.org>
Fri, 30 Nov 2012 20:22:54 +0000 (15:22 -0500)
committerColin Walters <walters@verbum.org>
Wed, 5 Dec 2012 18:30:14 +0000 (13:30 -0500)
At least GDBus had code that had "_object" as a parameter to one of
its functions, but this clashes with the GObject macro
G_OBJECT_WARN_INVALID_PROPERTY_ID() which created a local "_object".

Since many of us cargo cult around copies of objects, let's be
defensive here and use local variable names less likely to clash with
application code.

https://bugzilla.gnome.org/show_bug.cgi?id=689377

gobject/gobject.h

index f63e4d1..9dcf997 100644 (file)
@@ -567,16 +567,16 @@ gsize         g_object_compat_control           (gsize           what,
 /* --- implementation macros --- */
 #define G_OBJECT_WARN_INVALID_PSPEC(object, pname, property_id, pspec) \
 G_STMT_START { \
-  GObject *_object = (GObject*) (object); \
-  GParamSpec *_pspec = (GParamSpec*) (pspec); \
-  guint _property_id = (property_id); \
+  GObject *_glib__object = (GObject*) (object); \
+  GParamSpec *_glib__pspec = (GParamSpec*) (pspec); \
+  guint _glib__property_id = (property_id); \
   g_warning ("%s: invalid %s id %u for \"%s\" of type `%s' in `%s'", \
              G_STRLOC, \
              (pname), \
-             _property_id, \
-             _pspec->name, \
-             g_type_name (G_PARAM_SPEC_TYPE (_pspec)), \
-             G_OBJECT_TYPE_NAME (_object)); \
+             _glib__property_id, \
+             _glib__pspec->name, \
+             g_type_name (G_PARAM_SPEC_TYPE (_glib__pspec)), \
+             G_OBJECT_TYPE_NAME (_glib__object)); \
 } G_STMT_END
 /**
  * G_OBJECT_WARN_INVALID_PROPERTY_ID: