bug-grep
[Top][All Lists]
Advanced

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

[PATCH 19/34] maint: dfa: convert #if-MBS_SUPPORT (dfastate)


From: Jim Meyering
Subject: [PATCH 19/34] maint: dfa: convert #if-MBS_SUPPORT (dfastate)
Date: Thu, 15 Sep 2011 12:28:02 +0200

From: Jim Meyering <address@hidden>

* src/dfa.c (dfastate): Use regular "if", not #if MBS_SUPPORT.
---
 src/dfa.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 4450211..dd8259c 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -2369,9 +2369,7 @@ dfastate (int s, struct dfa *d, int trans[])
   int wants_letter;            /* New state wants to know letter context. */
   int state_letter;            /* New state on a letter transition. */
   static int initialized;      /* Flag for static initialization. */
-#if MBS_SUPPORT
   int next_isnt_1st_byte = 0;  /* Flag if we can't add state0.  */
-#endif
   int i, j, k;

   grps = xnmalloc (NOTCHAR, sizeof *grps);
@@ -2396,10 +2394,10 @@ dfastate (int s, struct dfa *d, int trans[])
         setbit(d->tokens[pos.index], matches);
       else if (d->tokens[pos.index] >= CSET)
         copyset(d->charclasses[d->tokens[pos.index] - CSET], matches);
-#if MBS_SUPPORT
-      else if (d->tokens[pos.index] == ANYCHAR
-               || d->tokens[pos.index] == MBCSET)
-      /* MB_CUR_MAX > 1  */
+      else if (MBS_SUPPORT
+               && (d->tokens[pos.index] == ANYCHAR
+                   || d->tokens[pos.index] == MBCSET))
+        /* MB_CUR_MAX > 1  */
         {
           /* ANYCHAR and MBCSET must match with a single character, so we
              must put it to d->states[s].mbps, which contains the positions
@@ -2411,7 +2409,6 @@ dfastate (int s, struct dfa *d, int trans[])
           insert(pos, &(d->states[s].mbps));
           continue;
         }
-#endif /* MBS_SUPPORT */
       else
         continue;

@@ -2548,8 +2545,7 @@ dfastate (int s, struct dfa *d, int trans[])
         for (k = 0; k < d->follows[grps[i].elems[j].index].nelem; ++k)
           insert(d->follows[grps[i].elems[j].index].elems[k], &follows);

-#if MBS_SUPPORT
-      if (d->mb_cur_max > 1)
+      if (MBS_SUPPORT && d->mb_cur_max > 1)
         {
           /* If a token in follows.elems is not 1st byte of a multibyte
              character, or the states of follows must accept the bytes
@@ -2579,7 +2575,6 @@ dfastate (int s, struct dfa *d, int trans[])
                 }
             }
         }
-#endif

       /* If we are building a searching matcher, throw in the positions
          of state 0 as well. */
-- 
1.7.7.rc0.362.g5a14




reply via email to

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