[Xfce4-commits] <terminal:master> Use G_ENABLE_DEBUG to enable additional checks (bug #8552).
Nick Schermer
noreply at xfce.org
Tue Dec 25 10:46:01 CET 2012
Updating branch refs/heads/master
to e759fa24e6d28d55ea947cbaf9a0b3eb04682539 (commit)
from 54e30c180de50f5bf6ec79715dd54b15ef3c9e55 (commit)
commit e759fa24e6d28d55ea947cbaf9a0b3eb04682539
Author: Nick Schermer <nick at xfce.org>
Date: Tue Dec 25 10:44:41 2012 +0100
Use G_ENABLE_DEBUG to enable additional checks (bug #8552).
NDEBUG is enabled by some distros leading to unneeded
aborts.
terminal/main.c | 6 +++---
terminal/terminal-image-loader.c | 4 ++--
terminal/terminal-preferences.c | 6 +++---
terminal/terminal-private.h | 4 ++--
terminal/terminal-screen.c | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/terminal/main.c b/terminal/main.c
index 3494474..ccbd23e 100644
--- a/terminal/main.c
+++ b/terminal/main.c
@@ -174,7 +174,7 @@ main (int argc, char **argv)
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
g_set_application_name (_("Xfce Terminal"));
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
/* Do NOT remove this line for now, If something doesn't work,
* fix your code instead!
*/
@@ -252,7 +252,7 @@ main (int argc, char **argv)
/* don't try to establish another service here */
disable_server = TRUE;
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
g_debug ("%s mismatch when invoking remote terminal: %s",
error->code == TERMINAL_ERROR_USER_MISMATCH ? "User" : "Display",
error->message);
@@ -273,7 +273,7 @@ main (int argc, char **argv)
g_strfreev (nargv);
return EXIT_FAILURE;
}
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
else if (error != NULL)
{
g_debug ("D-Bus reply error: %s (%s: %d)", error->message,
diff --git a/terminal/terminal-image-loader.c b/terminal/terminal-image-loader.c
index d3530fc..58a1be8 100644
--- a/terminal/terminal-image-loader.c
+++ b/terminal/terminal-image-loader.c
@@ -202,7 +202,7 @@ terminal_image_loader_pixbuf_destroyed (gpointer data,
return;
}
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
g_warning ("Pixbuf %p was freed from loader cache %p, "
"this should not happend", pixbuf, loader);
terminal_assert_not_reached ();
@@ -484,7 +484,7 @@ terminal_image_loader_load (TerminalImageLoader *loader,
if (G_UNLIKELY (loader->pixbuf == NULL || width <= 1 || height <= 1))
return NULL;
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
g_debug ("Image Loader Memory Status: %d images in valid "
"cache, %d in invalid cache",
g_slist_length (loader->cache),
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 5655798..522f7cd 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -879,7 +879,7 @@ terminal_preferences_set_property (GObject *object,
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
static void
terminal_preferences_check_blurb (GParamSpec *spec)
{
@@ -961,7 +961,7 @@ terminal_preferences_load (TerminalPreferences *preferences)
pspec = preferences_props[n];
name = g_param_spec_get_name (pspec);
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
terminal_preferences_check_blurb (pspec);
#endif
@@ -1265,7 +1265,7 @@ terminal_preferences_monitor_connect (TerminalPreferences *preferences,
if (G_LIKELY (preferences->monitor != NULL))
{
/* connect signal */
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
g_debug ("Monitoring \"%s\" for changes.", filename);
#endif
g_signal_connect (G_OBJECT (preferences->monitor), "changed",
diff --git a/terminal/terminal-private.h b/terminal/terminal-private.h
index 3bc9cfa..4117d9b 100644
--- a/terminal/terminal-private.h
+++ b/terminal/terminal-private.h
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
} G_END_DECLS
/* support macros for debugging */
-#ifndef NDEBUG
+#ifdef G_ENABLE_DEBUG
#define terminal_assert(expr) g_assert (expr)
#define terminal_assert_not_reached() g_assert_not_reached ()
#define terminal_return_if_fail(expr) g_return_if_fail (expr)
@@ -49,7 +49,7 @@ G_BEGIN_DECLS
#endif
/* avoid trivial g_value_get_*() function calls */
-#ifdef NDEBUG
+#ifdef G_ENABLE_DEBUG
#define g_value_get_boolean(v) (((const GValue *) (v))->data[0].v_int)
#define g_value_get_char(v) (((const GValue *) (v))->data[0].v_int)
#define g_value_get_uchar(v) (((const GValue *) (v))->data[0].v_uint)
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 07fe967..b3178fc 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1446,8 +1446,8 @@ terminal_screen_launch_child (TerminalScreen *screen)
terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
-#ifndef NDEBUG
- if (!GTK_WIDGET_REALIZED (screen))
+#ifdef G_ENABLE_DEBUG
+ if (!gtk_widget_get_realized (GTK_WIDGET (screen)))
g_error ("Tried to launch command in a TerminalScreen that is not realized");
#endif
More information about the Xfce4-commits
mailing list