[Xfce4-commits] <xfce4-panel:devel> Fix warning about using braces in return.

Nick Schermer nick at xfce.org
Tue Aug 11 20:34:58 CEST 2009


Updating branch refs/heads/devel
         to df120fc5b9c0f415fc2df5835a9f8298d3e0a8cd (commit)
       from 12c4409315e6ca47e697b7a86ee2b16104719d11 (commit)

commit df120fc5b9c0f415fc2df5835a9f8298d3e0a8cd
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Jun 15 07:51:23 2009 +0200

    Fix warning about using braces in return.

 libxfce4panel/xfce-panel-macros.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libxfce4panel/xfce-panel-macros.h b/libxfce4panel/xfce-panel-macros.h
index 705f947..b6e92ec 100644
--- a/libxfce4panel/xfce-panel-macros.h
+++ b/libxfce4panel/xfce-panel-macros.h
@@ -32,7 +32,14 @@ G_BEGIN_DECLS
 #ifndef NDEBUG
 #define panel_assert(expr)                 g_assert (expr)
 #define panel_assert_not_reached()         g_assert_not_reached ()
-#define panel_return_if_fail(expr)         panel_return_val_if_fail(expr,{})
+#define panel_return_if_fail(expr)         G_STMT_START { \
+  if (G_UNLIKELY (!(expr))) \
+    { \
+      g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
+             "%s (%s): expression '%s' failed.", G_STRLOC, G_STRFUNC, \
+             #expr); \
+      return; \
+    }; }G_STMT_END
 #define panel_return_val_if_fail(expr,val) G_STMT_START { \
   if (G_UNLIKELY (!(expr))) \
     { \



More information about the Xfce4-commits mailing list