summaryrefslogtreecommitdiff
path: root/json-glib/json-debug.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2013-05-16 10:16:02 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2013-05-16 10:16:02 +0100
commit72a3a8f71003d40087c59371d07df5b59f2df3a7 (patch)
tree07f10a6c74d6f5c5ded5b36ddcd15fa0adf38be5 /json-glib/json-debug.c
parent5b89c6438b8c1bf7a7b1476305a4e20f2c34234b (diff)
downloadjson-glib-72a3a8f71003d40087c59371d07df5b59f2df3a7.tar.gz
debug: Clean up debug flags accessor
Mark json_get_debug_flags() as an internal function, and drop the '_' prefix; also, add a simple macro that we can use everywhere to mask the function call.
Diffstat (limited to 'json-glib/json-debug.c')
-rw-r--r--json-glib/json-debug.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/json-glib/json-debug.c b/json-glib/json-debug.c
index c0dc2e9..2838542 100644
--- a/json-glib/json-debug.c
+++ b/json-glib/json-debug.c
@@ -4,8 +4,7 @@
#include "json-debug.h"
-static unsigned int json_debug_flags = 0;
-static gboolean json_debug_flags_set = FALSE;
+static unsigned int json_debug_flags = 0;
#ifdef JSON_ENABLE_DEBUG
static const GDebugKey json_debug_keys[] = {
@@ -16,12 +15,13 @@ static const GDebugKey json_debug_keys[] = {
#endif /* JSON_ENABLE_DEBUG */
JsonDebugFlags
-_json_get_debug_flags (void)
+json_get_debug_flags (void)
{
#ifdef JSON_ENABLE_DEBUG
+ static gboolean json_debug_flags_set;
const gchar *env_str;
- if (json_debug_flags_set)
+ if (G_LIKELY (json_debug_flags_set))
return json_debug_flags;
env_str = g_getenv ("JSON_DEBUG");