bug-grep
[Top][All Lists]
Advanced

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

[PATCH 21/34] maint: dfa: remove some #if MBS_SUPPORT guards


From: Jim Meyering
Subject: [PATCH 21/34] maint: dfa: remove some #if MBS_SUPPORT guards
Date: Thu, 15 Sep 2011 12:28:04 +0200

From: Jim Meyering <address@hidden>

* src/dfa.c: Replace a few "#if MBS_SUPPORT" directives with
"if (MBS_SUPPORT)".  Remove some altogether.
---
 src/dfa.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index f245208..cef3a98 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -650,7 +650,6 @@ static int hard_LC_COLLATE; /* Nonzero if LC_COLLATE is 
hard.  */

 static int cur_mb_len = 1;     /* Length of the multibyte representation of
                                    wctok.  */
-#if MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX > 1).  */
 static mbstate_t mbs;          /* Mbstate for mbrlen().  */
 static wchar_t wctok;          /* Wide character representation of the current
@@ -673,7 +672,6 @@ static wchar_t *inputwcs;   /* Wide character 
representation of input
                                    And inputwcs[i] is the codepoint.  */
 static unsigned char const *buf_begin; /* reference to begin in dfaexec().  */
 static unsigned char const *buf_end;   /* reference to end in dfaexec().  */
-#endif /* MBS_SUPPORT  */


 #if MBS_SUPPORT
@@ -787,14 +785,16 @@ parse_bracket_exp (void)
      Bit 3 = includes ranges, char/equiv classes or collation elements.  */
   int colon_warning_state;

-#if MBS_SUPPORT
-  wint_t wc, wc1, wc2;
+  wint_t wc;
+  wint_t wc2;

   /* Work area to build a mb_char_classes.  */
   struct mb_char_classes *work_mbc;
   int chars_al, range_sts_al, range_ends_al, ch_classes_al,
     equivs_al, coll_elems_al;

+  if (MBS_SUPPORT)
+    {
   chars_al = 1;
   range_sts_al = range_ends_al = 0;
   ch_classes_al = equivs_al = coll_elems_al = 0;
@@ -812,7 +812,7 @@ parse_bracket_exp (void)
     }
   else
     work_mbc = NULL;
-#endif
+    }

   memset (ccl, 0, sizeof ccl);
   FETCH_WC (c, wc, _("unbalanced ["));
@@ -824,6 +824,7 @@ parse_bracket_exp (void)
   else
     invert = 0;

+  wint_t wc1 = 0;
   colon_warning_state = (c == ':');
   do
     {
@@ -1051,11 +1052,7 @@ parse_bracket_exp (void)
           work_mbc->chars[work_mbc->nchars++] = wc;
         }
     }
-  while ((
-#if MBS_SUPPORT
-         wc = wc1,
-#endif
-         (c = c1) != ']'));
+  while ((wc = wc1, (c = c1) != ']'));

   if (colon_warning_state == 7)
     dfawarn (_("character class syntax is [[:space:]], not [:space:]"));
@@ -2726,7 +2723,6 @@ build_state_zero (struct dfa *d)
   build_state(0, d);
 }

-#if MBS_SUPPORT
 /* Multibyte character handling sub-routines for dfaexec.  */

 /* Initial state may encounter the byte which is not a single byte character
@@ -3154,6 +3150,8 @@ transit_state (struct dfa *d, int s, unsigned char const 
**pp)
   return s1;
 }

+#if MBS_SUPPORT
+
 /* Initialize mblen_buf and inputwcs with data from the next line.  */

 static void
-- 
1.7.7.rc0.362.g5a14




reply via email to

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