summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-11-19 22:04:13 +0100
committerJim Meyering <meyering@redhat.com>2011-11-19 22:04:13 +0100
commitea1a3cbdf3cb751d0e862b4dcdd8cf449d9d944f (patch)
tree32700c09dcb3f9725e0122aaf44c0f8283ff4d22 /src
parent4e16f2a3f0ee4dcf96997420659e75b121c4783e (diff)
downloadgrep-ea1a3cbdf3cb751d0e862b4dcdd8cf449d9d944f.tar.gz
maint: accommodate -Wdeclaration-after-statement, but only in dfa.c,
and because doing so does not impact readability/maintainability. This is solely to accommodate gawk users who are stuck with ancient gcc. This is no excuse to change any other code in grep. * src/dfa.c (dfaoptimize, parse_bracket_exp): Move declaration to precede first statement in block.
Diffstat (limited to 'src')
-rw-r--r--src/dfa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dfa.c b/src/dfa.c
index dc879159..8db4aba5 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -785,6 +785,7 @@ parse_bracket_exp (void)
wint_t wc;
wint_t wc2;
+ wint_t wc1 = 0;
/* Work area to build a mb_char_classes. */
struct mb_char_classes *work_mbc;
@@ -819,7 +820,6 @@ parse_bracket_exp (void)
else
invert = 0;
- wint_t wc1 = 0;
colon_warning_state = (c == ':');
do
{
@@ -3420,10 +3420,11 @@ dfainit (struct dfa *d)
static void
dfaoptimize (struct dfa *d)
{
+ unsigned int i;
+
if (!MBS_SUPPORT || !using_utf8())
return;
- unsigned int i;
for (i = 0; i < d->tindex; ++i)
{
switch(d->tokens[i])