bug-grep
[Top][All Lists]
Advanced

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

[PATCH 28/34] maint: dfa: avoid in-function "#if MBS_SUPPORT" tests


From: Jim Meyering
Subject: [PATCH 28/34] maint: dfa: avoid in-function "#if MBS_SUPPORT" tests
Date: Thu, 15 Sep 2011 12:28:11 +0200

From: Jim Meyering <address@hidden>

* src/dfa.c (setbit_case_fold_c): Remove "#if MBS_SUPPORT" in favor
of simple "if (MBS_SUPPORT ...".
(dfaexec, addtok): Likewise.
---
 src/dfa.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index ca3c75a..19bb59a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -591,8 +591,7 @@ setbit_c (int b, charclass c)
 static void
 setbit_case_fold_c (int b, charclass c)
 {
-#if MBS_SUPPORT
-  if (MB_CUR_MAX > 1)
+  if (MBS_SUPPORT && MB_CUR_MAX > 1)
     {
       wint_t wc = btowc (b);
       if (wc == WEOF)
@@ -602,7 +601,6 @@ setbit_case_fold_c (int b, charclass c)
         setbit_wc (iswupper (wc) ? towlower (wc) : towupper (wc), c);
     }
   else
-#endif
     {
       setbit (b, c);
       if (case_fold && isalpha (b))
@@ -1444,8 +1442,7 @@ static void addtok_wc (wint_t wc);
 static void
 addtok (token t)
 {
-#if MBS_SUPPORT
-  if (MB_CUR_MAX > 1 && t == MBCSET)
+  if (MBS_SUPPORT && MB_CUR_MAX > 1 && t == MBCSET)
     {
       bool need_or = false;
       struct mb_char_classes *work_mbc = &dfa->mbcsets[dfa->nmbcsets - 1];
@@ -1492,8 +1489,9 @@ addtok (token t)
         }
     }
   else
-#endif
-    addtok_mb (t, 3);
+    {
+      addtok_mb (t, 3);
+    }
 }

 #if MBS_SUPPORT
@@ -3330,10 +3328,8 @@ dfaexec (struct dfa *d, char const *begin, char *end,
           if (count)
             ++*count;

-#if MBS_SUPPORT
-          if (d->mb_cur_max > 1)
+          if (MBS_SUPPORT && d->mb_cur_max > 1)
             prepare_wc_buf ((const char *) p, end);
-#endif
         }

       /* Check if we've run off the end of the buffer. */
-- 
1.7.7.rc0.362.g5a14




reply via email to

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