[glib] gobject: Use local variable names in macros less likely to clash
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gobject: Use local variable names in macros less likely to clash
- Date: Wed, 5 Dec 2012 18:31:00 +0000 (UTC)
commit 33de093b5abf26c42e9b6ead38088afd21e61991
Author: Colin Walters <walters verbum org>
Date: Fri Nov 30 15:22:54 2012 -0500
gobject: Use local variable names in macros less likely to clash
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 | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gobject/gobject.h b/gobject/gobject.h
index f63e4d1..9dcf997 100644
--- a/gobject/gobject.h
+++ b/gobject/gobject.h
@@ -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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]