aboutsummaryrefslogtreecommitdiffstats
path: root/dfa.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-02-14 23:08:08 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-02-14 23:08:08 +0200
commiteaec4c7a7ca63e0123ee8bddba7aef632c5e47ef (patch)
tree6d7c783cfcf755200ea62f8e6e09650ec998a458 /dfa.c
parentd259a3a82a64490a7e307c8f6c6f2f9fdffb4538 (diff)
downloadegawk-eaec4c7a7ca63e0123ee8bddba7aef632c5e47ef.tar.gz
egawk-eaec4c7a7ca63e0123ee8bddba7aef632c5e47ef.tar.bz2
egawk-eaec4c7a7ca63e0123ee8bddba7aef632c5e47ef.zip
Enable C99 compilation. Fix dfa.c.
Diffstat (limited to 'dfa.c')
-rw-r--r--dfa.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/dfa.c b/dfa.c
index b7ad51eb..08f72900 100644
--- a/dfa.c
+++ b/dfa.c
@@ -3508,8 +3508,7 @@ dfainit (struct dfa *d)
static bool _GL_ATTRIBUTE_PURE
dfa_supported (struct dfa const *d)
{
- size_t i;
- for (i = 0; i < d->tindex; i++)
+ for (size_t i = 0; i < d->tindex; i++)
{
switch (d->tokens[i])
{
@@ -3964,18 +3963,15 @@ dfamust (struct dfa const *d)
{
must *mp = NULL;
char const *result = "";
- size_t ri;
size_t i;
bool exact = false;
bool begline = false;
bool endline = false;
- size_t rj;
bool need_begline = false;
bool need_endline = false;
bool case_fold_unibyte = case_fold && MB_CUR_MAX == 1;
- struct dfamust *dm;
- for (ri = 0; ri < d->tindex; ++ri)
+ for (size_t ri = 0; ri < d->tindex; ++ri)
{
token t = d->tokens[ri];
switch (t)
@@ -4150,7 +4146,7 @@ dfamust (struct dfa const *d)
}
}
- rj = ri + 2;
+ size_t rj = ri + 2;
if (d->tokens[ri + 1] == CAT)
{
for (; rj < d->tindex - 1; rj += 2)
@@ -4179,7 +4175,7 @@ dfamust (struct dfa const *d)
}
done:;
- dm = NULL;
+ struct dfamust *dm = NULL;
if (*result)
{
dm = xmalloc (sizeof *dm);