bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] use do...while(0) idiom


From: Paolo Bonzini
Subject: [PATCH 4/5] use do...while(0) idiom
Date: Sun, 7 Mar 2010 11:20:54 +0100

* dfa.c (FETCH): Wrap with do...while(0).
---
 src/dfa.c |    8 ++++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 400061a..9661cbb 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -411,7 +411,7 @@ update_mb_len_index (char const *p, int len)
 #ifdef MBS_SUPPORT
 /* Note that characters become unsigned here. */
 # define FETCH(c, eoferr)                      \
-  {                                            \
+  do {                                         \
     if (! lexleft)                             \
      {                                         \
        if (eoferr != 0)                        \
@@ -423,7 +423,7 @@ update_mb_len_index (char const *p, int len)
       update_mb_len_index(lexptr, lexleft);    \
     (c) = (unsigned char) *lexptr++;           \
     --lexleft;                                 \
-  }
+  } while(0)
 
 /* This function fetch a wide character, and update cur_mb_len,
    used only if the current locale is a multibyte environment.  */
@@ -452,7 +452,7 @@ fetch_wc (char const *eoferr)
 #else
 /* Note that characters become unsigned here. */
 # define FETCH(c, eoferr)            \
-  {                                  \
+  do {                               \
     if (! lexleft)                   \
       {                                      \
        if (eoferr != 0)              \
@@ -462,7 +462,7 @@ fetch_wc (char const *eoferr)
       }                                      \
     (c) = (unsigned char) *lexptr++;  \
     --lexleft;                       \
-  }
+  } while(0)
 #endif /* MBS_SUPPORT */
 
 #ifdef MBS_SUPPORT
-- 
1.6.6






reply via email to

[Prev in Thread] Current Thread [Next in Thread]