summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/regcomp.c17
-rw-r--r--generic/regexec.c8
2 files changed, 12 insertions, 13 deletions
diff --git a/generic/regcomp.c b/generic/regcomp.c
index 58d55fb..7735d8b 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -210,7 +210,7 @@ struct vars {
int lexcon; /* lexical context type (see lex.c) */
int nsubexp; /* subexpression count */
struct subre **subs; /* subRE pointer vector */
- size_t nsubs; /* length of vector */
+ int nsubs; /* length of vector */
struct subre *sub10[10]; /* initial vector, enough for most */
struct nfa *nfa; /* the NFA */
struct colormap *cm; /* character color map */
@@ -287,8 +287,7 @@ compile(
{
AllocVars(v);
struct guts *g;
- int i;
- size_t j;
+ int i, j;
FILE *debug = (flags&REG_PROGRESS) ? stdout : NULL;
#define CNOERR() { if (ISERR()) return freev(v, v->err); }
@@ -477,10 +476,10 @@ moresubs(
int wanted) /* want enough room for this one */
{
struct subre **p;
- size_t n;
+ int n;
- assert(wanted > 0 && (size_t)wanted >= v->nsubs);
- n = (size_t)wanted * 3 / 2 + 1;
+ assert(wanted > 0 && wanted >= v->nsubs);
+ n = wanted * 3 / 2 + 1;
if (v->subs == v->sub10) {
p = (struct subre **) MALLOC(n * sizeof(struct subre *));
if (p != NULL) {
@@ -499,7 +498,7 @@ moresubs(
*p = NULL;
}
assert(v->nsubs == n);
- assert((size_t)wanted < v->nsubs);
+ assert(wanted < v->nsubs);
}
/*
@@ -954,10 +953,10 @@ parseqatom(
if (cap) {
v->nsubexp++;
subno = v->nsubexp;
- if ((size_t)subno >= v->nsubs) {
+ if (subno >= v->nsubs) {
moresubs(v, subno);
}
- assert((size_t)subno < v->nsubs);
+ assert(subno < v->nsubs);
} else {
atomtype = PLAIN; /* something that's not '(' */
}
diff --git a/generic/regexec.c b/generic/regexec.c
index 128d439..c57f42c 100644
--- a/generic/regexec.c
+++ b/generic/regexec.c
@@ -172,8 +172,8 @@ exec(
{
AllocVars(v);
int st, backref;
- size_t n;
- size_t i;
+ int n;
+ int i;
#define LOCALMAT 20
regmatch_t mat[LOCALMAT];
#define LOCALDFAS 40
@@ -236,7 +236,7 @@ exec(
v->stop = (chr *)string + len;
v->err = 0;
assert(v->g->ntree >= 0);
- n = (size_t) v->g->ntree;
+ n = v->g->ntree;
if (n <= LOCALDFAS)
v->subdfas = subdfas;
else
@@ -278,7 +278,7 @@ exec(
if (v->pmatch != pmatch && v->pmatch != mat) {
FREE(v->pmatch);
}
- n = (size_t) v->g->ntree;
+ n = v->g->ntree;
for (i = 0; i < n; i++) {
if (v->subdfas[i] != NULL)
freeDFA(v->subdfas[i]);