After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729914 - instead of DEBUG_CODE and IF_DEBUG, provide a common macro to support GOBJECT_DEBUG environment variable
instead of DEBUG_CODE and IF_DEBUG, provide a common macro to support GOBJECT...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-05-10 12:38 UTC by Kang Hu
Modified: 2016-07-17 00:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add _GOBJECT_DEBUG_CODE (5.18 KB, patch)
2014-05-10 12:42 UTC, Kang Hu
needs-work Details | Review
move _g_type_debug_flags out of gtype.h to gtype-private.h (1.19 KB, patch)
2014-05-10 12:53 UTC, Kang Hu
committed Details | Review
this is the version 2 of the 0001-gobject-add-_GOBJECT_DEBUG_CODE-macro-for-debugging-.patch (5.22 KB, patch)
2014-05-25 14:43 UTC, Kang Hu
none Details | Review
remove signoff in the previous patch (5.17 KB, patch)
2014-05-26 02:01 UTC, Kang Hu
accepted-commit_now Details | Review

Description Kang Hu 2014-05-10 12:38:06 UTC
to support GOBJECT_DEBUG environment(see gtype.c), gtype.c defines DEBUG_CODE but never uses it. 
gobject.c and gsignal.c both define IF_DEBUG macro.(though IF_DEBUG is removed from gsignal.c now.)

I think we should provide a single macro to clean things up.
in the following two patches, I add a new macro _GOBJECT_DEBUG_CODE based on DEBUG_CODE and move _g_type_debug_flags into gtype-private.h
Comment 1 Kang Hu 2014-05-10 12:42:28 UTC
Created attachment 276279 [details] [review]
add _GOBJECT_DEBUG_CODE
Comment 2 Kang Hu 2014-05-10 12:53:39 UTC
Created attachment 276280 [details] [review]
move _g_type_debug_flags out of gtype.h to gtype-private.h
Comment 3 Allison Karlitskaya (desrt) 2014-05-25 11:02:45 UTC
Review of attachment 276279 [details] [review]:

Thanks.  This is a nice cleanup.  A small nitpick below.

::: gobject/gtype-private.h
@@ +26,3 @@
 
+/**
+ * _GOBJECT_DEBUG_CODE:

Please don't write a gtk-doc style comment here.  Start it like so instead:

/*< private >
 *

Also: we don't use (anymore) underscore prefixing for private functions or macros in GLib...  I'd also prefer to keep 'IF' in the name, since it reads nicer at the points that it is used... so maybe GOBJECT_IF_DEBUG() or so?
Comment 4 Allison Karlitskaya (desrt) 2014-05-25 11:04:06 UTC
Review of attachment 276280 [details] [review]:

Agreed.  This is not currently on our ABI, so it could never possibly work from outside anyway.
Comment 5 Kang Hu 2014-05-25 14:43:32 UTC
Created attachment 277145 [details] [review]
this is the version 2 of the 0001-gobject-add-_GOBJECT_DEBUG_CODE-macro-for-debugging-.patch
Comment 6 Kang Hu 2014-05-26 02:01:52 UTC
Created attachment 277169 [details] [review]
remove signoff in the previous patch
Comment 7 Kang Hu 2014-06-29 13:01:53 UTC
Review of attachment 277169 [details] [review]:

hi, i updated the patch several weeks ago according to Ryan Lortie's suggestions. but no one has reviewed it since then.
i'm not sure if it's appropriate for me to change this patch status.
Comment 8 Kang Hu 2014-06-29 13:01:53 UTC
Review of attachment 277169 [details] [review]:

hi, i updated the patch several weeks ago according to Ryan Lortie's suggestions. but no one has reviewed it since then.
i'm not sure if it's appropriate for me to change this patch status.