Simplify some do-while-0 macros.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 22 Jun 2011 06:34:10 +0000 (08:34 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 22 Jun 2011 06:34:10 +0000 (08:34 +0200)
lexer.c
parser.c
preprocessor.c

diff --git a/lexer.c b/lexer.c
index 80e4916..65c52a3 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -400,7 +400,7 @@ static inline void next_char(void);
                lexer_pos.colno = 1; \
                code
 
-#define eat(c_type)  do { assert(c == c_type); next_char(); } while (0)
+#define eat(c_type) (assert(c == c_type), next_char())
 
 static void maybe_concat_lines(void)
 {
index c2ee10a..5754fe3 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2915,11 +2915,8 @@ wrong_thread_storage_class:
                        next_token();
                        break;
 
-#define CHECK_DOUBLE_TYPE()        \
-                       do { \
-                       if ( type != NULL)     \
-                               errorf(HERE, "multiple data types in declaration specifiers"); \
-                       } while(0)
+#define CHECK_DOUBLE_TYPE() \
+       (type != NULL ? errorf(HERE, "multiple types in declaration specifiers") : (void)0)
 
                case T_struct:
                        CHECK_DOUBLE_TYPE();
index 2b077bb..e876e99 100644 (file)
@@ -221,7 +221,7 @@ static inline void put_back(int pc)
                ++input.position.lineno;              \
                code
 
-#define eat(c_type)  do { assert(CC == c_type); next_char(); } while(0)
+#define eat(c_type) (assert(CC == c_type), next_char())
 
 static void maybe_concat_lines(void)
 {