Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ int eflags;

/* fill in the details if requested */
if (nmatch > 0) {
pmatch[0].rm_so = m->coldp - m->offp;
pmatch[0].rm_eo = endp - m->offp;
pmatch[0].rm_so = (regoff_t) (m->coldp - m->offp);
pmatch[0].rm_eo = (regoff_t) (endp - m->offp);
}
if (nmatch > 1) {
assert(m->pmatch != NULL);
Expand Down Expand Up @@ -433,12 +433,12 @@ sopno stopst;
case OLPAREN:
i = OPND(m->g->strip[ss]);
assert(0 < i && i <= m->g->nsub);
m->pmatch[i].rm_so = sp - m->offp;
m->pmatch[i].rm_so = (regoff_t) (sp - m->offp);
break;
case ORPAREN:
i = OPND(m->g->strip[ss]);
assert(0 < i && i <= m->g->nsub);
m->pmatch[i].rm_eo = sp - m->offp;
m->pmatch[i].rm_eo = (regoff_t) (sp - m->offp);
break;
default: /* uh oh */
assert(nope);
Expand Down Expand Up @@ -626,7 +626,7 @@ sopno lev; /* PLUS nesting level */
i = OPND(s);
assert(0 < i && i <= m->g->nsub);
offsave = m->pmatch[i].rm_so;
m->pmatch[i].rm_so = sp - m->offp;
m->pmatch[i].rm_so = (regoff_t) (sp - m->offp);
dp = backref(m, sp, stop, ss+1, stopst, lev);
if (dp != NULL)
return(dp);
Expand All @@ -637,7 +637,7 @@ sopno lev; /* PLUS nesting level */
i = OPND(s);
assert(0 < i && i <= m->g->nsub);
offsave = m->pmatch[i].rm_eo;
m->pmatch[i].rm_eo = sp - m->offp;
m->pmatch[i].rm_eo = (regoff_t) (sp - m->offp);
dp = backref(m, sp, stop, ss+1, stopst, lev);
if (dp != NULL)
return(dp);
Expand Down
10 changes: 5 additions & 5 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int cflags;
free((char *) g);
return REG_INVARG;
}
p->ssize = new_ssize;
p->ssize = (sopno) new_ssize;
}
p->strip = (sop *)malloc(p->ssize * sizeof(sop));
p->slen = 0;
Expand Down Expand Up @@ -314,7 +314,7 @@ register struct parse *p;
case '(':
REQUIRE(MORE(), REG_EPAREN);
p->g->nsub++;
subno = p->g->nsub;
subno = (sopno) p->g->nsub;
if (subno < NPAREN)
p->pbegin[subno] = HERE();
EMIT(OLPAREN, subno);
Expand Down Expand Up @@ -534,7 +534,7 @@ int starordinary; /* is a leading * an ordinary character? */
break;
case BACKSL|'(':
p->g->nsub++;
subno = p->g->nsub;
subno = (sopno) p->g->nsub;
if (subno < NPAREN)
p->pbegin[subno] = HERE();
EMIT(OLPAREN, subno);
Expand Down Expand Up @@ -865,7 +865,7 @@ int endc; /* name ended by endc,']' */
SETERROR(REG_EBRACK);
return(0);
}
len = p->next - sp;
len = (int) (p->next - sp);
for (cp = cnames; cp->name != NULL; cp++)
if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0')
return(cp->code); /* known name */
Expand Down Expand Up @@ -1463,7 +1463,7 @@ size_t opnd;
assert(p->slen < p->ssize);

/* finally, it's all reduced to the easy case */
p->strip[p->slen++] = SOP(op, opnd);
p->strip[p->slen++] = SOP(op, (sop) opnd);
}

/*
Expand Down