summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-04-07 08:14:13 +0200
committerJim Meyering <meyering@redhat.com>2011-09-16 10:30:39 +0200
commit2ed5eb19533a372a85f8acd0024ece62922c572e (patch)
tree2873ced3a4efdcf5ebab9c8e2aa85fdf2879fc42
parent0e5c7a931c68720f57f685501f18f50bcb0912a8 (diff)
downloadgrep-2ed5eb19533a372a85f8acd0024ece62922c572e.tar.gz
maint: dfa: remove some #if MBS_SUPPORT guards
* src/dfa.c: Replace a few "#if MBS_SUPPORT" directives with "if (MBS_SUPPORT)". Remove some altogether.
-rw-r--r--src/dfa.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/dfa.c b/src/dfa.c
index 0e1d826b..6424b6f6 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -644,7 +644,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
@@ -667,7 +666,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
@@ -781,8 +779,8 @@ 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;
@@ -806,7 +804,6 @@ parse_bracket_exp (void)
}
else
work_mbc = NULL;
-#endif
memset (ccl, 0, sizeof ccl);
FETCH_WC (c, wc, _("unbalanced ["));
@@ -818,6 +815,7 @@ parse_bracket_exp (void)
else
invert = 0;
+ wint_t wc1 = 0;
colon_warning_state = (c == ':');
do
{
@@ -1045,11 +1043,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:]"));
@@ -2720,7 +2714,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
@@ -3148,6 +3141,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