[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Wed Apr 21 12:04:01 UTC 2010


 include/parted/debug.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8c78382b9a35e19121c043cab2451cf79af4b959
Author: Colin Watson <cjwatson at ubuntu.com>
Date:   Tue Apr 20 13:01:33 2010 +0100

    maint: make PED_ASSERT and PED_DEBUG if-safe
    
    Constructions such as:
    
      if (foo)
        PED_DEBUG (0, "foo");
      else
        PED_DEBUG (0, "not foo");
    
    did not compile reliably, depending on the configuration.  Make this
    work.
    
    * include/parted/debug.h [DEBUG && __GNUC__ && !__JSFTRACE__]
    (PED_DEBUG): Remove trailing semicolon.
    [!DEBUG] (PED_ASSERT): Use do-while rather than while.
    [!DEBUG] (PED_DEBUG): Likewise.

diff --git a/include/parted/debug.h b/include/parted/debug.h
index bbba09e..c0da54a 100644
--- a/include/parted/debug.h
+++ b/include/parted/debug.h
@@ -39,7 +39,7 @@ ped_assert ( const char* cond_text,
 
 #define PED_DEBUG(level, ...) \
         ped_debug ( level, __FILE__, __LINE__, __PRETTY_FUNCTION__, \
-                    __VA_ARGS__ );
+                    __VA_ARGS__ )
 
 #define PED_ASSERT(cond, action)				\
 	do {							\
@@ -79,8 +79,8 @@ static void PED_DEBUG (int level, ...)
 
 #else /* !DEBUG */
 
-#define PED_ASSERT(cond, action)	while (0) {}
-#define PED_DEBUG(level, ...)           while (0) {}
+#define PED_ASSERT(cond, action)	do {} while (0)
+#define PED_DEBUG(level, ...)           do {} while (0)
 
 
 #endif /* DEBUG */



More information about the Parted-commits mailing list