char_u *expr;
int re_flags; /* see vim_regcomp() */
{
- int postfix_size;
+ size_t postfix_size;
nstate = 0;
istate = 0;
/* A reasonable estimation for size */
- nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
+ nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
/* Some items blow up in size, such as [A-z]. Add more space for that.
* TODO: some patterns may still fail. */
-// nstate_max += 1000;
+ nstate_max += 1000;
/* Size for postfix representation of expr. */
postfix_size = sizeof(*post_start) * nstate_max;
* No new state added here. */
if (nfa_calc_size == TRUE)
{
- nstate += 0;
+ /* nstate += 0; */
break;
}
e2 = POP();
/* Negation of a character */
if (nfa_calc_size == TRUE)
{
- nstate += 0;
+ /* nstate += 0; */
break;
}
e1 = POP();
/* Alternation */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
e2 = POP();
/* Zero or more */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
e = POP();
/* one or zero atoms=> greedy match */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
e = POP();
/* zero or one atoms => non-greedy match */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
e = POP();
/* One or more */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
e = POP();
* with max/min count of 0 */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
s = new_state(NFA_SKIP_CHAR, NULL, NULL);
/* Operands */
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
break;
}
s = new_state(*p, NULL, NULL);
if (nfa_calc_size == TRUE)
{
- nstate ++;
+ nstate++;
return NULL; /* Return value when counting size is ignored anyway */
}
save.startpos[subidx] = m->startpos[subidx];
save.endpos[subidx] = m->endpos[subidx];
m->startpos[subidx].lnum = reglnum;
- m->startpos[subidx].col = reginput - regline + off;
+ m->startpos[subidx].col = (colnr_T)(reginput - regline + off);
}
else
{
save.startpos[subidx] = m->startpos[subidx];
save.endpos[subidx] = m->endpos[subidx];
m->endpos[subidx].lnum = reglnum;
- m->endpos[subidx].col = reginput - regline + off;
+ m->endpos[subidx].col = (colnr_T)(reginput - regline + off);
}
else
{
int re_flags;
{
nfa_regprog_T *prog;
- int prog_size;
+ size_t prog_size;
int *postfix;
if (expr == NULL)