[Top][All Lists]
[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
- Re: [PATCH 26/34] tests: skip tests that require MBS support, (continued)
[PATCH 13/34] maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp), Jim Meyering, 2011/09/15
[PATCH 27/34] build: enable compilation without MBS_SUPPORT, Jim Meyering, 2011/09/15
[PATCH 19/34] maint: dfa: convert #if-MBS_SUPPORT (dfastate),
Jim Meyering <=
[PATCH 29/34] maint: stop using skip_test_; use skip_ instead, Jim Meyering, 2011/09/15
[PATCH 11/34] maint: dfa: convert #if-MBS_SUPPORT (dfaexec), Jim Meyering, 2011/09/15
[PATCH 34/34] maint: dfa: remove case-guarding #if-MBS_SUPPORT, Jim Meyering, 2011/09/15
[PATCH 22/34] maint: ensure that MB_CUR_MAX is defined even when !MBS_SUPPORT, Jim Meyering, 2011/09/15
Re: dfa/MBS_SUPPORT cleanup, Paolo Bonzini, 2011/09/15