{
size_t len;
struct cvec *cv = NULL;
- const char **namePtr;
+ const char * const *namePtr;
int i,
index;
* The following arrays define the valid character class names.
*/
- static const char *classNames[] = {
+ static const char * const classNames[] = {
"alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph",
"lower", "print", "punct", "space", "upper", "xdigit", NULL
};
newdfa(struct vars * v,
struct cnfa * cnfa,
struct colormap * cm,
- struct smalldfa * small) /* preallocated space, may be NULL */
+ struct smalldfa * sml) /* preallocated space, may be NULL */
{
struct dfa *d;
size_t nss = cnfa->nstates * 2;
int wordsper = (cnfa->nstates + UBITS - 1) / UBITS;
- struct smalldfa *smallwas = small;
+ struct smalldfa *smallwas = sml;
assert(cnfa != NULL && cnfa->nstates != 0);
if (nss <= FEWSTATES && cnfa->ncolors <= FEWCOLORS)
{
assert(wordsper == 1);
- if (small == NULL)
+ if (sml == NULL)
{
- small = (struct smalldfa *) MALLOC(
- sizeof(struct smalldfa));
- if (small == NULL)
+ sml = (struct smalldfa *) MALLOC(sizeof(struct smalldfa));
+ if (sml == NULL)
{
ERR(REG_ESPACE);
return NULL;
}
}
- d = &small->dfa;
- d->ssets = small->ssets;
- d->statesarea = small->statesarea;
+ d = &sml->dfa;
+ d->ssets = sml->ssets;
+ d->statesarea = sml->statesarea;
d->work = &d->statesarea[nss];
- d->outsarea = small->outsarea;
- d->incarea = small->incarea;
+ d->outsarea = sml->outsarea;
+ d->incarea = sml->incarea;
d->cptsmalloced = 0;
- d->mallocarea = (smallwas == NULL) ? (char *) small : NULL;
+ d->mallocarea = (smallwas == NULL) ? (char *) sml : NULL;
}
else
{
static int condissect(struct vars *, struct subre *, chr *, chr *);
static int altdissect(struct vars *, struct subre *, chr *, chr *);
static int cdissect(struct vars *, struct subre *, chr *, chr *);
-static int ccaptdissect(struct vars *, struct subre *, chr *, chr *);
static int ccondissect(struct vars *, struct subre *, chr *, chr *);
static int crevdissect(struct vars *, struct subre *, chr *, chr *);
static int cbrdissect(struct vars *, struct subre *, chr *, chr *);
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
+ int er;
+
assert(t != NULL);
MDEBUG(("cdissect %ld-%ld %c\n", LOFF(begin), LOFF(end), t->op));
return ccondissect(v, t, begin, end);
case '(': /* capturing */
assert(t->left != NULL && t->right == NULL);
- return ccaptdissect(v, t, begin, end);
+ assert(t->subno > 0);
+ er = cdissect(v, t->left, begin, end);
+ if (er == REG_OKAY)
+ subset(v, t, begin, end);
+ return er;
default:
return REG_ASSERT;
}
}
-/*
- * ccaptdissect - capture subexpression matches (with complications)
- */
-static int /* regexec return code */
-ccaptdissect(struct vars * v,
- struct subre * t,
- chr *begin, /* beginning of relevant substring */
- chr *end) /* end of same */
-{
- int er;
-
- assert(t->subno > 0);
-
- er = cdissect(v, t->left, begin, end);
- if (er == REG_OKAY)
- subset(v, t, begin, end);
- return er;
-}
-
/*
* ccondissect - concatenation subexpression matches (with complications)
* The retry memory stores the offset of the trial midpoint from begin,