1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Initial pgindent run with pg_bsd_indent version 2.0.

The new indent version includes numerous fixes thanks to Piotr Stefaniak.
The main changes visible in this commit are:

* Nicer formatting of function-pointer declarations.
* No longer unexpectedly removes spaces in expressions using casts,
  sizeof, or offsetof.
* No longer wants to add a space in "struct structname *varname", as
  well as some similar cases for const- or volatile-qualified pointers.
* Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.
* Fixes bug where comments following declarations were sometimes placed
  with no space separating them from the code.
* Fixes some odd decisions for comments following case labels.
* Fixes some cases where comments following code were indented to less
  than the expected column 33.

On the less good side, it now tends to put more whitespace around typedef
names that are not listed in typedefs.list.  This might encourage us to
put more effort into typedef name collection; it's not really a bug in
indent itself.

There are more changes coming after this round, having to do with comment
indentation and alignment of lines appearing within parentheses.  I wanted
to limit the size of the diffs to something that could be reviewed without
one's eyes completely glazing over, so it seemed better to split up the
changes as much as practical.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2017-06-21 14:39:04 -04:00
parent 8ff6d4ec78
commit e3860ffa4d
379 changed files with 1725 additions and 1707 deletions

View File

@ -46,8 +46,8 @@
* initcm - set up new colormap
*/
static void
initcm(struct vars * v,
struct colormap * cm)
initcm(struct vars *v,
struct colormap *cm)
{
struct colordesc *cd;
@ -100,7 +100,7 @@ initcm(struct vars * v,
* freecm - free dynamically-allocated things in a colormap
*/
static void
freecm(struct colormap * cm)
freecm(struct colormap *cm)
{
cm->magic = 0;
if (cm->cd != cm->cdspace)
@ -117,7 +117,7 @@ freecm(struct colormap * cm)
* pg_reg_getcolor - slow case of GETCOLOR()
*/
color
pg_reg_getcolor(struct colormap * cm, chr c)
pg_reg_getcolor(struct colormap *cm, chr c)
{
int rownum,
colnum,
@ -169,7 +169,7 @@ pg_reg_getcolor(struct colormap * cm, chr c)
* maxcolor - report largest color number in use
*/
static color
maxcolor(struct colormap * cm)
maxcolor(struct colormap *cm)
{
if (CISERR())
return COLORLESS;
@ -182,7 +182,7 @@ maxcolor(struct colormap * cm)
* Beware: may relocate the colordescs.
*/
static color /* COLORLESS for error */
newcolor(struct colormap * cm)
newcolor(struct colormap *cm)
{
struct colordesc *cd;
size_t n;
@ -254,7 +254,7 @@ newcolor(struct colormap * cm)
* freecolor - free a color (must have no arcs or subcolor)
*/
static void
freecolor(struct colormap * cm,
freecolor(struct colormap *cm,
color co)
{
struct colordesc *cd = &cm->cd[co];
@ -309,7 +309,7 @@ freecolor(struct colormap * cm,
* pseudocolor - allocate a false color, to be managed by other means
*/
static color
pseudocolor(struct colormap * cm)
pseudocolor(struct colormap *cm)
{
color co;
struct colordesc *cd;
@ -333,7 +333,7 @@ pseudocolor(struct colormap * cm)
* This works only for chrs that map into the low color map.
*/
static color
subcolor(struct colormap * cm, chr c)
subcolor(struct colormap *cm, chr c)
{
color co; /* current color of c */
color sco; /* new subcolor */
@ -363,7 +363,7 @@ subcolor(struct colormap * cm, chr c)
* colormap, which do not necessarily correspond to exactly one chr code.
*/
static color
subcolorhi(struct colormap * cm, color *pco)
subcolorhi(struct colormap *cm, color *pco)
{
color co; /* current color of entry */
color sco; /* new subcolor */
@ -386,7 +386,7 @@ subcolorhi(struct colormap * cm, color *pco)
* newsub - allocate a new subcolor (if necessary) for a color
*/
static color
newsub(struct colormap * cm,
newsub(struct colormap *cm,
color co)
{
color sco; /* new subcolor */
@ -417,7 +417,7 @@ newsub(struct colormap * cm,
* Returns array index of new row. Note the array might move.
*/
static int
newhicolorrow(struct colormap * cm,
newhicolorrow(struct colormap *cm,
int oldrow)
{
int newrow = cm->hiarrayrows;
@ -466,7 +466,7 @@ newhicolorrow(struct colormap * cm,
* Essentially, extends the 2-D array to the right with a copy of itself.
*/
static void
newhicolorcols(struct colormap * cm)
newhicolorcols(struct colormap *cm)
{
color *newarray;
int r,
@ -519,10 +519,10 @@ newhicolorcols(struct colormap * cm)
* mechanized with the "lastsubcolor" state variable.
*/
static void
subcolorcvec(struct vars * v,
struct cvec * cv,
struct state * lp,
struct state * rp)
subcolorcvec(struct vars *v,
struct cvec *cv,
struct state *lp,
struct state *rp)
{
struct colormap *cm = v->cm;
color lastsubcolor = COLORLESS;
@ -621,10 +621,10 @@ subcolorcvec(struct vars * v,
* to be able to handle both low and high chr codes.
*/
static void
subcoloronechr(struct vars * v,
subcoloronechr(struct vars *v,
chr ch,
struct state * lp,
struct state * rp,
struct state *lp,
struct state *rp,
color *lastsubcolor)
{
struct colormap *cm = v->cm;
@ -744,11 +744,11 @@ subcoloronechr(struct vars * v,
* subcoloronerange - do subcolorcvec's work for a high range
*/
static void
subcoloronerange(struct vars * v,
subcoloronerange(struct vars *v,
chr from,
chr to,
struct state * lp,
struct state * rp,
struct state *lp,
struct state *rp,
color *lastsubcolor)
{
struct colormap *cm = v->cm;
@ -882,10 +882,10 @@ subcoloronerange(struct vars * v,
* subcoloronerow - do subcolorcvec's work for one new row in the high colormap
*/
static void
subcoloronerow(struct vars * v,
subcoloronerow(struct vars *v,
int rownum,
struct state * lp,
struct state * rp,
struct state *lp,
struct state *rp,
color *lastsubcolor)
{
struct colormap *cm = v->cm;
@ -913,8 +913,8 @@ subcoloronerow(struct vars * v,
* okcolors - promote subcolors to full colors
*/
static void
okcolors(struct nfa * nfa,
struct colormap * cm)
okcolors(struct nfa *nfa,
struct colormap *cm)
{
struct colordesc *cd;
struct colordesc *end = CDEND(cm);
@ -972,8 +972,8 @@ okcolors(struct nfa * nfa,
* colorchain - add this arc to the color chain of its color
*/
static void
colorchain(struct colormap * cm,
struct arc * a)
colorchain(struct colormap *cm,
struct arc *a)
{
struct colordesc *cd = &cm->cd[a->co];
@ -988,8 +988,8 @@ colorchain(struct colormap * cm,
* uncolorchain - delete this arc from the color chain of its color
*/
static void
uncolorchain(struct colormap * cm,
struct arc * a)
uncolorchain(struct colormap *cm,
struct arc *a)
{
struct colordesc *cd = &cm->cd[a->co];
struct arc *aa = a->colorchainRev;
@ -1014,12 +1014,12 @@ uncolorchain(struct colormap * cm,
* rainbow - add arcs of all full colors (but one) between specified states
*/
static void
rainbow(struct nfa * nfa,
struct colormap * cm,
rainbow(struct nfa *nfa,
struct colormap *cm,
int type,
color but, /* COLORLESS if no exceptions */
struct state * from,
struct state * to)
struct state *from,
struct state *to)
{
struct colordesc *cd;
struct colordesc *end = CDEND(cm);
@ -1037,13 +1037,13 @@ rainbow(struct nfa * nfa,
* The calling sequence ought to be reconciled with cloneouts().
*/
static void
colorcomplement(struct nfa * nfa,
struct colormap * cm,
colorcomplement(struct nfa *nfa,
struct colormap *cm,
int type,
struct state * of, /* complements of this guy's PLAIN
struct state *of, /* complements of this guy's PLAIN
* outarcs */
struct state * from,
struct state * to)
struct state *from,
struct state *to)
{
struct colordesc *cd;
struct colordesc *end = CDEND(cm);
@ -1063,7 +1063,7 @@ colorcomplement(struct nfa * nfa,
* dumpcolors - debugging output
*/
static void
dumpcolors(struct colormap * cm,
dumpcolors(struct colormap *cm,
FILE *f)
{
struct colordesc *cd;

View File

@ -63,7 +63,7 @@ newcvec(int nchrs, /* to hold this many chrs... */
* Returns pointer as convenience.
*/
static struct cvec *
clearcvec(struct cvec * cv)
clearcvec(struct cvec *cv)
{
assert(cv != NULL);
cv->nchrs = 0;
@ -76,7 +76,7 @@ clearcvec(struct cvec * cv)
* addchr - add a chr to a cvec
*/
static void
addchr(struct cvec * cv, /* character vector */
addchr(struct cvec *cv, /* character vector */
chr c) /* character to add */
{
assert(cv->nchrs < cv->chrspace);
@ -87,7 +87,7 @@ addchr(struct cvec * cv, /* character vector */
* addrange - add a range to a cvec
*/
static void
addrange(struct cvec * cv, /* character vector */
addrange(struct cvec *cv, /* character vector */
chr from, /* first character of range */
chr to) /* last character of range */
{
@ -109,7 +109,7 @@ addrange(struct cvec * cv, /* character vector */
* so transientness is a convenient behavior.
*/
static struct cvec *
getcvec(struct vars * v, /* context */
getcvec(struct vars *v, /* context */
int nchrs, /* to hold this many chrs... */
int nranges) /* ... and this many ranges */
{
@ -132,7 +132,7 @@ getcvec(struct vars * v, /* context */
* freecvec - free a cvec
*/
static void
freecvec(struct cvec * cv)
freecvec(struct cvec *cv)
{
FREE(cv);
}

View File

@ -67,7 +67,7 @@
* lexstart - set up lexical stuff, scan leading options
*/
static void
lexstart(struct vars * v)
lexstart(struct vars *v)
{
prefixes(v); /* may turn on new type bits etc. */
NOERR();
@ -96,7 +96,7 @@ lexstart(struct vars * v)
* prefixes - implement various special prefixes
*/
static void
prefixes(struct vars * v)
prefixes(struct vars *v)
{
/* literal string doesn't get any of this stuff */
if (v->cflags & REG_QUOTE)
@ -200,7 +200,7 @@ prefixes(struct vars * v)
* implicit assumptions about what sorts of strings can be subroutines.
*/
static void
lexnest(struct vars * v,
lexnest(struct vars *v,
const chr *beginp, /* start of interpolation */
const chr *endp) /* one past end of interpolation */
{
@ -265,7 +265,7 @@ static const chr brbackw[] = { /* \w within brackets */
* Possibly ought to inquire whether there is a "word" character class.
*/
static void
lexword(struct vars * v)
lexword(struct vars *v)
{
lexnest(v, backw, ENDOF(backw));
}
@ -274,7 +274,7 @@ lexword(struct vars * v)
* next - get next token
*/
static int /* 1 normal, 0 failure */
next(struct vars * v)
next(struct vars *v)
{
chr c;
@ -384,7 +384,7 @@ next(struct vars * v)
else
FAILW(REG_BADBR);
break;
case CHR('\\'): /* BRE bound ends with \} */
case CHR('\\'): /* BRE bound ends with \} */
if (INCON(L_BBND) && NEXT1('}'))
{
v->now++;
@ -476,7 +476,7 @@ next(struct vars * v)
NOTE(REG_ULOCALE);
RET(CCLASS);
break;
default: /* oops */
default: /* oops */
v->now--;
RETV(PLAIN, c);
break;
@ -671,7 +671,7 @@ next(struct vars * v)
case CHR('$'):
RET('$');
break;
case CHR('\\'): /* mostly punt backslashes to code below */
case CHR('\\'): /* mostly punt backslashes to code below */
if (ATEOS())
FAILW(REG_EESCAPE);
break;
@ -734,7 +734,7 @@ next(struct vars * v)
* Note slightly nonstandard use of the CCLASS type code.
*/
static int /* not actually used, but convenient for RETV */
lexescape(struct vars * v)
lexescape(struct vars *v)
{
chr c;
static const chr alert[] = {
@ -904,7 +904,7 @@ lexescape(struct vars * v)
* if maxlen is large enough to make that possible.
*/
static chr /* chr value; errors signalled via ERR */
lexdigits(struct vars * v,
lexdigits(struct vars *v,
int base,
int minlen,
int maxlen)
@ -985,7 +985,7 @@ lexdigits(struct vars * v,
* context-dependency of some things.
*/
static int /* 1 normal, 0 failure */
brenext(struct vars * v,
brenext(struct vars *v,
chr c)
{
switch (c)
@ -1106,7 +1106,7 @@ brenext(struct vars * v,
* skip - skip white space and comments in expanded form
*/
static void
skip(struct vars * v)
skip(struct vars *v)
{
const chr *start = v->now;
@ -1146,7 +1146,7 @@ newline(void)
* use that it hardly matters.
*/
static chr
chrnamed(struct vars * v,
chrnamed(struct vars *v,
const chr *startp, /* start of name */
const chr *endp, /* just past end of name */
chr lastresort) /* what to return if name lookup fails */

View File

@ -56,7 +56,7 @@ static const struct cname
{
const char *name;
const char code;
} cnames[] =
} cnames[] =
{
{
@ -377,7 +377,7 @@ enum classes
* element - map collating-element name to chr
*/
static chr
element(struct vars * v, /* context */
element(struct vars *v, /* context */
const chr *startp, /* points to start of name */
const chr *endp) /* points just past end of name */
{
@ -413,7 +413,7 @@ element(struct vars * v, /* context */
* range - supply cvec for a range, including legality check
*/
static struct cvec *
range(struct vars * v, /* context */
range(struct vars *v, /* context */
chr a, /* range start */
chr b, /* range end, might equal a */
int cases) /* case-independent? */
@ -505,7 +505,7 @@ before(chr x, chr y)
* Must include case counterparts on request.
*/
static struct cvec *
eclass(struct vars * v, /* context */
eclass(struct vars *v, /* context */
chr c, /* Collating element representing the
* equivalence class. */
int cases) /* all cases? */
@ -545,14 +545,14 @@ eclass(struct vars * v, /* context */
* because callers are not supposed to explicitly free the result either way.
*/
static struct cvec *
cclass(struct vars * v, /* context */
cclass(struct vars *v, /* context */
const chr *startp, /* where the name starts */
const chr *endp, /* just past the end of the name */
int cases) /* case-independent? */
{
size_t len;
struct cvec *cv = NULL;
const char *const * namePtr;
const char *const *namePtr;
int i,
index;
@ -669,7 +669,7 @@ cclass(struct vars * v, /* context */
* cclass_column_index - get appropriate high colormap column index for chr
*/
static int
cclass_column_index(struct colormap * cm, chr c)
cclass_column_index(struct colormap *cm, chr c)
{
int colnum = 0;
@ -713,7 +713,7 @@ cclass_column_index(struct colormap * cm, chr c)
* messy cases are done via range().
*/
static struct cvec *
allcases(struct vars * v, /* context */
allcases(struct vars *v, /* context */
chr c) /* character to get case equivs of */
{
struct cvec *cv;

View File

@ -44,9 +44,9 @@
* newnfa - set up an NFA
*/
static struct nfa * /* the NFA, or NULL */
newnfa(struct vars * v,
struct colormap * cm,
struct nfa * parent) /* NULL if primary NFA */
newnfa(struct vars *v,
struct colormap *cm,
struct nfa *parent) /* NULL if primary NFA */
{
struct nfa *nfa;
@ -95,7 +95,7 @@ newnfa(struct vars * v,
* freenfa - free an entire NFA
*/
static void
freenfa(struct nfa * nfa)
freenfa(struct nfa *nfa)
{
struct state *s;
@ -121,7 +121,7 @@ freenfa(struct nfa * nfa)
* newstate - allocate an NFA state, with zero flag value
*/
static struct state * /* NULL on error */
newstate(struct nfa * nfa)
newstate(struct nfa *nfa)
{
struct state *s;
@ -185,7 +185,7 @@ newstate(struct nfa * nfa)
* newfstate - allocate an NFA state with a specified flag value
*/
static struct state * /* NULL on error */
newfstate(struct nfa * nfa, int flag)
newfstate(struct nfa *nfa, int flag)
{
struct state *s;
@ -199,8 +199,8 @@ newfstate(struct nfa * nfa, int flag)
* dropstate - delete a state's inarcs and outarcs and free it
*/
static void
dropstate(struct nfa * nfa,
struct state * s)
dropstate(struct nfa *nfa,
struct state *s)
{
struct arc *a;
@ -215,8 +215,8 @@ dropstate(struct nfa * nfa,
* freestate - free a state, which has no in-arcs or out-arcs
*/
static void
freestate(struct nfa * nfa,
struct state * s)
freestate(struct nfa *nfa,
struct state *s)
{
assert(s != NULL);
assert(s->nins == 0 && s->nouts == 0);
@ -246,8 +246,8 @@ freestate(struct nfa * nfa,
* destroystate - really get rid of an already-freed state
*/
static void
destroystate(struct nfa * nfa,
struct state * s)
destroystate(struct nfa *nfa,
struct state *s)
{
struct arcbatch *ab;
struct arcbatch *abnext;
@ -273,11 +273,11 @@ destroystate(struct nfa * nfa,
* In general we never want duplicates.
*/
static void
newarc(struct nfa * nfa,
newarc(struct nfa *nfa,
int t,
color co,
struct state * from,
struct state * to)
struct state *from,
struct state *to)
{
struct arc *a;
@ -319,11 +319,11 @@ newarc(struct nfa * nfa,
* identical arc (same type/color/from/to).
*/
static void
createarc(struct nfa * nfa,
createarc(struct nfa *nfa,
int t,
color co,
struct state * from,
struct state * to)
struct state *from,
struct state *to)
{
struct arc *a;
@ -365,8 +365,8 @@ createarc(struct nfa * nfa,
* allocarc - allocate a new out-arc within a state
*/
static struct arc * /* NULL for failure */
allocarc(struct nfa * nfa,
struct state * s)
allocarc(struct nfa *nfa,
struct state *s)
{
struct arc *a;
@ -418,8 +418,8 @@ allocarc(struct nfa * nfa,
* freearc - free an arc
*/
static void
freearc(struct nfa * nfa,
struct arc * victim)
freearc(struct nfa *nfa,
struct arc *victim)
{
struct state *from = victim->from;
struct state *to = victim->to;
@ -492,7 +492,7 @@ freearc(struct nfa * nfa,
* a similar changearcsource function.
*/
static void
changearctarget(struct arc * a, struct state * newto)
changearctarget(struct arc *a, struct state *newto)
{
struct state *oldto = a->to;
struct arc *predecessor;
@ -534,7 +534,7 @@ changearctarget(struct arc * a, struct state * newto)
* hasnonemptyout - Does state have a non-EMPTY out arc?
*/
static int
hasnonemptyout(struct state * s)
hasnonemptyout(struct state *s)
{
struct arc *a;
@ -551,7 +551,7 @@ hasnonemptyout(struct state * s)
* If there is more than one such arc, the result is random.
*/
static struct arc *
findarc(struct state * s,
findarc(struct state *s,
int type,
color co)
{
@ -567,10 +567,10 @@ findarc(struct state * s,
* cparc - allocate a new arc within an NFA, copying details from old one
*/
static void
cparc(struct nfa * nfa,
struct arc * oa,
struct state * from,
struct state * to)
cparc(struct nfa *nfa,
struct arc *oa,
struct state *from,
struct state *to)
{
newarc(nfa, oa->type, oa->co, from, to);
}
@ -579,8 +579,8 @@ cparc(struct nfa * nfa,
* sortins - sort the in arcs of a state by from/color/type
*/
static void
sortins(struct nfa * nfa,
struct state * s)
sortins(struct nfa *nfa,
struct state *s)
{
struct arc **sortarray;
struct arc *a;
@ -623,8 +623,8 @@ sortins(struct nfa * nfa,
static int
sortins_cmp(const void *a, const void *b)
{
const struct arc *aa = *((const struct arc * const *) a);
const struct arc *bb = *((const struct arc * const *) b);
const struct arc *aa = *((const struct arc *const *) a);
const struct arc *bb = *((const struct arc *const *) b);
/* we check the fields in the order they are most likely to be different */
if (aa->from->no < bb->from->no)
@ -646,8 +646,8 @@ sortins_cmp(const void *a, const void *b)
* sortouts - sort the out arcs of a state by to/color/type
*/
static void
sortouts(struct nfa * nfa,
struct state * s)
sortouts(struct nfa *nfa,
struct state *s)
{
struct arc **sortarray;
struct arc *a;
@ -690,8 +690,8 @@ sortouts(struct nfa * nfa,
static int
sortouts_cmp(const void *a, const void *b)
{
const struct arc *aa = *((const struct arc * const *) a);
const struct arc *bb = *((const struct arc * const *) b);
const struct arc *aa = *((const struct arc *const *) a);
const struct arc *bb = *((const struct arc *const *) b);
/* we check the fields in the order they are most likely to be different */
if (aa->to->no < bb->to->no)
@ -733,9 +733,9 @@ sortouts_cmp(const void *a, const void *b)
* the arc lists, and then we can indeed just update the arcs in-place.
*/
static void
moveins(struct nfa * nfa,
struct state * oldState,
struct state * newState)
moveins(struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
assert(oldState != newState);
@ -825,9 +825,9 @@ moveins(struct nfa * nfa,
* copyins - copy in arcs of a state to another state
*/
static void
copyins(struct nfa * nfa,
struct state * oldState,
struct state * newState)
copyins(struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
assert(oldState != newState);
@ -907,9 +907,9 @@ copyins(struct nfa * nfa,
* and are not guaranteed unique. It's okay to clobber the array contents.
*/
static void
mergeins(struct nfa * nfa,
struct state * s,
struct arc ** arcarray,
mergeins(struct nfa *nfa,
struct state *s,
struct arc **arcarray,
int arccount)
{
struct arc *na;
@ -1004,9 +1004,9 @@ mergeins(struct nfa * nfa,
* moveouts - move all out arcs of a state to another state
*/
static void
moveouts(struct nfa * nfa,
struct state * oldState,
struct state * newState)
moveouts(struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
assert(oldState != newState);
@ -1093,9 +1093,9 @@ moveouts(struct nfa * nfa,
* copyouts - copy out arcs of a state to another state
*/
static void
copyouts(struct nfa * nfa,
struct state * oldState,
struct state * newState)
copyouts(struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
assert(oldState != newState);
@ -1172,10 +1172,10 @@ copyouts(struct nfa * nfa,
* cloneouts - copy out arcs of a state to another state pair, modifying type
*/
static void
cloneouts(struct nfa * nfa,
struct state * old,
struct state * from,
struct state * to,
cloneouts(struct nfa *nfa,
struct state *old,
struct state *from,
struct state *to,
int type)
{
struct arc *a;
@ -1193,9 +1193,9 @@ cloneouts(struct nfa * nfa,
* states using their tmp pointer.
*/
static void
delsub(struct nfa * nfa,
struct state * lp, /* the sub-NFA goes from here... */
struct state * rp) /* ...to here, *not* inclusive */
delsub(struct nfa *nfa,
struct state *lp, /* the sub-NFA goes from here... */
struct state *rp) /* ...to here, *not* inclusive */
{
assert(lp != rp);
@ -1216,9 +1216,9 @@ delsub(struct nfa * nfa,
* This routine's basic job is to destroy all out-arcs of the state.
*/
static void
deltraverse(struct nfa * nfa,
struct state * leftend,
struct state * s)
deltraverse(struct nfa *nfa,
struct state *leftend,
struct state *s)
{
struct arc *a;
struct state *to;
@ -1267,11 +1267,11 @@ deltraverse(struct nfa * nfa,
* it's a state pointer, didn't you? :-))
*/
static void
dupnfa(struct nfa * nfa,
struct state * start, /* duplicate of subNFA starting here */
struct state * stop, /* and stopping here */
struct state * from, /* stringing duplicate from here */
struct state * to) /* to here */
dupnfa(struct nfa *nfa,
struct state *start, /* duplicate of subNFA starting here */
struct state *stop, /* and stopping here */
struct state *from, /* stringing duplicate from here */
struct state *to) /* to here */
{
if (start == stop)
{
@ -1291,9 +1291,9 @@ dupnfa(struct nfa * nfa,
* duptraverse - recursive heart of dupnfa
*/
static void
duptraverse(struct nfa * nfa,
struct state * s,
struct state * stmp) /* s's duplicate, or NULL */
duptraverse(struct nfa *nfa,
struct state *s,
struct state *stmp) /* s's duplicate, or NULL */
{
struct arc *a;
@ -1328,8 +1328,8 @@ duptraverse(struct nfa * nfa,
* cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set
*/
static void
cleartraverse(struct nfa * nfa,
struct state * s)
cleartraverse(struct nfa *nfa,
struct state *s)
{
struct arc *a;
@ -1365,7 +1365,7 @@ cleartraverse(struct nfa * nfa,
* that implementation detail not create user-visible performance differences.
*/
static struct state *
single_color_transition(struct state * s1, struct state * s2)
single_color_transition(struct state *s1, struct state *s2)
{
struct arc *a;
@ -1395,7 +1395,7 @@ single_color_transition(struct state * s1, struct state * s2)
* specialcolors - fill in special colors for an NFA
*/
static void
specialcolors(struct nfa * nfa)
specialcolors(struct nfa *nfa)
{
/* false colors for BOS, BOL, EOS, EOL */
if (nfa->parent == NULL)
@ -1434,7 +1434,7 @@ specialcolors(struct nfa * nfa)
* without making any progress in the input string.
*/
static long /* re_info bits */
optimize(struct nfa * nfa,
optimize(struct nfa *nfa,
FILE *f) /* for debug output; NULL none */
{
#ifdef REG_DEBUG
@ -1474,7 +1474,7 @@ optimize(struct nfa * nfa,
* pullback - pull back constraints backward to eliminate them
*/
static void
pullback(struct nfa * nfa,
pullback(struct nfa *nfa,
FILE *f) /* for debug output; NULL none */
{
struct state *s;
@ -1554,9 +1554,9 @@ pullback(struct nfa * nfa,
* through their tmp fields).
*/
static int
pull(struct nfa * nfa,
struct arc * con,
struct state ** intermediates)
pull(struct nfa *nfa,
struct arc *con,
struct state **intermediates)
{
struct state *from = con->from;
struct state *to = con->to;
@ -1641,7 +1641,7 @@ pull(struct nfa * nfa,
* pushfwd - push forward constraints forward to eliminate them
*/
static void
pushfwd(struct nfa * nfa,
pushfwd(struct nfa *nfa,
FILE *f) /* for debug output; NULL none */
{
struct state *s;
@ -1721,9 +1721,9 @@ pushfwd(struct nfa * nfa,
* through their tmp fields).
*/
static int
push(struct nfa * nfa,
struct arc * con,
struct state ** intermediates)
push(struct nfa *nfa,
struct arc *con,
struct state **intermediates)
{
struct state *from = con->from;
struct state *to = con->to;
@ -1812,8 +1812,8 @@ push(struct nfa * nfa,
* #def COMPATIBLE 3 // compatible but not satisfied yet
*/
static int
combine(struct arc * con,
struct arc * a)
combine(struct arc *con,
struct arc *a)
{
#define CA(ct,at) (((ct)<<CHAR_BIT) | (at))
@ -1866,7 +1866,7 @@ combine(struct arc * con,
* fixempties - get rid of EMPTY arcs
*/
static void
fixempties(struct nfa * nfa,
fixempties(struct nfa *nfa,
FILE *f) /* for debug output; NULL none */
{
struct state *s;
@ -2093,10 +2093,10 @@ fixempties(struct nfa * nfa,
* the NFA ... but that could still be enough to cause trouble.
*/
static struct state *
emptyreachable(struct nfa * nfa,
struct state * s,
struct state * lastfound,
struct arc ** inarcsorig)
emptyreachable(struct nfa *nfa,
struct state *s,
struct state *lastfound,
struct arc **inarcsorig)
{
struct arc *a;
@ -2121,7 +2121,7 @@ emptyreachable(struct nfa * nfa,
* isconstraintarc - detect whether an arc is of a constraint type
*/
static inline int
isconstraintarc(struct arc * a)
isconstraintarc(struct arc *a)
{
switch (a->type)
{
@ -2139,7 +2139,7 @@ isconstraintarc(struct arc * a)
* hasconstraintout - does state have a constraint out arc?
*/
static int
hasconstraintout(struct state * s)
hasconstraintout(struct state *s)
{
struct arc *a;
@ -2160,7 +2160,7 @@ hasconstraintout(struct state * s)
* of such loops before doing that.
*/
static void
fixconstraintloops(struct nfa * nfa,
fixconstraintloops(struct nfa *nfa,
FILE *f) /* for debug output; NULL none */
{
struct state *s;
@ -2259,7 +2259,7 @@ restart:
* of the NFA ... but that could still be enough to cause trouble.
*/
static int
findconstraintloop(struct nfa * nfa, struct state * s)
findconstraintloop(struct nfa *nfa, struct state *s)
{
struct arc *a;
@ -2348,7 +2348,7 @@ findconstraintloop(struct nfa * nfa, struct state * s)
* break the loop just by removing those loop arcs, with no new states added.
*/
static void
breakconstraintloop(struct nfa * nfa, struct state * sinitial)
breakconstraintloop(struct nfa *nfa, struct state *sinitial)
{
struct state *s;
struct state *shead;
@ -2494,11 +2494,11 @@ breakconstraintloop(struct nfa * nfa, struct state * sinitial)
* successor states.
*/
static void
clonesuccessorstates(struct nfa * nfa,
struct state * ssource,
struct state * sclone,
struct state * spredecessor,
struct arc * refarc,
clonesuccessorstates(struct nfa *nfa,
struct state *ssource,
struct state *sclone,
struct state *spredecessor,
struct arc *refarc,
char *curdonemap,
char *outerdonemap,
int nstates)
@ -2726,7 +2726,7 @@ clonesuccessorstates(struct nfa * nfa,
* cleanup - clean up NFA after optimizations
*/
static void
cleanup(struct nfa * nfa)
cleanup(struct nfa *nfa)
{
struct state *s;
struct state *nexts;
@ -2761,10 +2761,10 @@ cleanup(struct nfa * nfa)
* markreachable - recursive marking of reachable states
*/
static void
markreachable(struct nfa * nfa,
struct state * s,
struct state * okay, /* consider only states with this mark */
struct state * mark) /* the value to mark with */
markreachable(struct nfa *nfa,
struct state *s,
struct state *okay, /* consider only states with this mark */
struct state *mark) /* the value to mark with */
{
struct arc *a;
@ -2787,10 +2787,10 @@ markreachable(struct nfa * nfa,
* markcanreach - recursive marking of states which can reach here
*/
static void
markcanreach(struct nfa * nfa,
struct state * s,
struct state * okay, /* consider only states with this mark */
struct state * mark) /* the value to mark with */
markcanreach(struct nfa *nfa,
struct state *s,
struct state *okay, /* consider only states with this mark */
struct state *mark) /* the value to mark with */
{
struct arc *a;
@ -2813,7 +2813,7 @@ markcanreach(struct nfa * nfa,
* analyze - ascertain potentially-useful facts about an optimized NFA
*/
static long /* re_info bits to be ORed in */
analyze(struct nfa * nfa)
analyze(struct nfa *nfa)
{
struct arc *a;
struct arc *aa;
@ -2834,8 +2834,8 @@ analyze(struct nfa * nfa)
* compact - construct the compact representation of an NFA
*/
static void
compact(struct nfa * nfa,
struct cnfa * cnfa)
compact(struct nfa *nfa,
struct cnfa *cnfa)
{
struct state *s;
struct arc *a;
@ -2922,7 +2922,7 @@ compact(struct nfa * nfa,
* carcsort - sort compacted-NFA arcs by color
*/
static void
carcsort(struct carc * first, size_t n)
carcsort(struct carc *first, size_t n)
{
if (n > 1)
qsort(first, n, sizeof(struct carc), carc_cmp);
@ -2949,7 +2949,7 @@ carc_cmp(const void *a, const void *b)
* freecnfa - free a compacted NFA
*/
static void
freecnfa(struct cnfa * cnfa)
freecnfa(struct cnfa *cnfa)
{
assert(cnfa->nstates != 0); /* not empty already */
cnfa->nstates = 0;
@ -2962,7 +2962,7 @@ freecnfa(struct cnfa * cnfa)
* dumpnfa - dump an NFA in human-readable form
*/
static void
dumpnfa(struct nfa * nfa,
dumpnfa(struct nfa *nfa,
FILE *f)
{
#ifdef REG_DEBUG
@ -2999,7 +2999,7 @@ dumpnfa(struct nfa * nfa,
* dumpstate - dump an NFA state in human-readable form
*/
static void
dumpstate(struct state * s,
dumpstate(struct state *s,
FILE *f)
{
struct arc *a;
@ -3025,7 +3025,7 @@ dumpstate(struct state * s,
* dumparcs - dump out-arcs in human-readable form
*/
static void
dumparcs(struct state * s,
dumparcs(struct state *s,
FILE *f)
{
int pos;
@ -3057,8 +3057,8 @@ dumparcs(struct state * s,
* dumparc - dump one outarc in readable form, including prefixing tab
*/
static void
dumparc(struct arc * a,
struct state * s,
dumparc(struct arc *a,
struct state *s,
FILE *f)
{
struct arc *aa;
@ -3121,7 +3121,7 @@ dumparc(struct arc * a,
*/
#ifdef REG_DEBUG
static void
dumpcnfa(struct cnfa * cnfa,
dumpcnfa(struct cnfa *cnfa,
FILE *f)
{
int st;
@ -3151,7 +3151,7 @@ dumpcnfa(struct cnfa * cnfa,
*/
static void
dumpcstate(int st,
struct cnfa * cnfa,
struct cnfa *cnfa,
FILE *f)
{
struct carc *ca;

View File

@ -491,14 +491,14 @@ pg_regcomp(regex_t *re,
* moresubs - enlarge subRE vector
*/
static void
moresubs(struct vars * v,
moresubs(struct vars *v,
int wanted) /* want enough room for this one */
{
struct subre **p;
size_t n;
assert(wanted > 0 && (size_t) wanted >= v->nsubs);
n = (size_t) wanted *3 / 2 + 1;
n = (size_t) wanted * 3 / 2 + 1;
if (v->subs == v->sub10)
{
@ -528,7 +528,7 @@ moresubs(struct vars * v,
* (if any), to make error-handling code terser.
*/
static int
freev(struct vars * v,
freev(struct vars *v,
int err)
{
if (v->re != NULL)
@ -557,8 +557,8 @@ freev(struct vars * v,
* NFA must have been optimize()d already.
*/
static void
makesearch(struct vars * v,
struct nfa * nfa)
makesearch(struct vars *v,
struct nfa *nfa)
{
struct arc *a;
struct arc *b;
@ -646,11 +646,11 @@ makesearch(struct vars * v,
* of a chain of '|' subres.
*/
static struct subre *
parse(struct vars * v,
parse(struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookaround subRE) or PLAIN */
struct state * init, /* initial state */
struct state * final) /* final state */
struct state *init, /* initial state */
struct state *final) /* final state */
{
struct state *left; /* scaffolding for branch */
struct state *right;
@ -725,11 +725,11 @@ parse(struct vars * v,
* ',' nodes introduced only when necessary due to substructure.
*/
static struct subre *
parsebranch(struct vars * v,
parsebranch(struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookaround subRE) or PLAIN */
struct state * left, /* leftmost state */
struct state * right, /* rightmost state */
struct state *left, /* leftmost state */
struct state *right, /* rightmost state */
int partial) /* is this only part of a branch? */
{
struct state *lp; /* left end of current construct */
@ -774,12 +774,12 @@ parsebranch(struct vars * v,
* of the branch, making this function's name somewhat inaccurate.
*/
static void
parseqatom(struct vars * v,
parseqatom(struct vars *v,
int stopper, /* EOS or ')' */
int type, /* LACON (lookaround subRE) or PLAIN */
struct state * lp, /* left state to hang it on */
struct state * rp, /* right state to hang it on */
struct subre * top) /* subtree top */
struct state *lp, /* left state to hang it on */
struct state *rp, /* right state to hang it on */
struct subre *top) /* subtree top */
{
struct state *s; /* temporaries for new states */
struct state *s2;
@ -1222,10 +1222,10 @@ parseqatom(struct vars * v,
* nonword - generate arcs for non-word-character ahead or behind
*/
static void
nonword(struct vars * v,
nonword(struct vars *v,
int dir, /* AHEAD or BEHIND */
struct state * lp,
struct state * rp)
struct state *lp,
struct state *rp)
{
int anchor = (dir == AHEAD) ? '$' : '^';
@ -1240,10 +1240,10 @@ nonword(struct vars * v,
* word - generate arcs for word character ahead or behind
*/
static void
word(struct vars * v,
word(struct vars *v,
int dir, /* AHEAD or BEHIND */
struct state * lp,
struct state * rp)
struct state *lp,
struct state *rp)
{
assert(dir == AHEAD || dir == BEHIND);
cloneouts(v->nfa, v->wordchrs, lp, rp, dir);
@ -1254,7 +1254,7 @@ word(struct vars * v,
* scannum - scan a number
*/
static int /* value, <= DUPMAX */
scannum(struct vars * v)
scannum(struct vars *v)
{
int n = 0;
@ -1285,9 +1285,9 @@ scannum(struct vars * v)
* code in parse(), and when this is called, it doesn't matter any more.
*/
static void
repeat(struct vars * v,
struct state * lp,
struct state * rp,
repeat(struct vars *v,
struct state *lp,
struct state *rp,
int m,
int n)
{
@ -1371,9 +1371,9 @@ repeat(struct vars * v,
* Also called from cbracket for complemented bracket expressions.
*/
static void
bracket(struct vars * v,
struct state * lp,
struct state * rp)
bracket(struct vars *v,
struct state *lp,
struct state *rp)
{
assert(SEE('['));
NEXT();
@ -1390,9 +1390,9 @@ bracket(struct vars * v,
* arcs as the b.e. is seen... but that gets messy.
*/
static void
cbracket(struct vars * v,
struct state * lp,
struct state * rp)
cbracket(struct vars *v,
struct state *lp,
struct state *rp)
{
struct state *left = newstate(v->nfa);
struct state *right = newstate(v->nfa);
@ -1420,9 +1420,9 @@ cbracket(struct vars * v,
* brackpart - handle one item (or range) within a bracket expression
*/
static void
brackpart(struct vars * v,
struct state * lp,
struct state * rp)
brackpart(struct vars *v,
struct state *lp,
struct state *rp)
{
chr startc;
chr endc;
@ -1533,7 +1533,7 @@ brackpart(struct vars * v,
* to look past the final bracket of the [. etc.
*/
static const chr * /* just after end of sequence */
scanplain(struct vars * v)
scanplain(struct vars *v)
{
const chr *endp;
@ -1558,10 +1558,10 @@ scanplain(struct vars * v)
* This is mostly a shortcut for efficient handling of the common case.
*/
static void
onechr(struct vars * v,
onechr(struct vars *v,
chr c,
struct state * lp,
struct state * rp)
struct state *lp,
struct state *rp)
{
if (!(v->cflags & REG_ICASE))
{
@ -1585,7 +1585,7 @@ onechr(struct vars * v,
* should be cleaned up to reduce dependencies on input scanning.
*/
static void
wordchrs(struct vars * v)
wordchrs(struct vars *v)
{
struct state *left;
struct state *right;
@ -1617,12 +1617,12 @@ wordchrs(struct vars * v)
* can be optimized.
*/
static void
processlacon(struct vars * v,
struct state * begin, /* start of parsed LACON sub-re */
struct state * end, /* end of parsed LACON sub-re */
processlacon(struct vars *v,
struct state *begin, /* start of parsed LACON sub-re */
struct state *end, /* end of parsed LACON sub-re */
int latype,
struct state * lp, /* left state to hang it on */
struct state * rp) /* right state to hang it on */
struct state *lp, /* left state to hang it on */
struct state *rp) /* right state to hang it on */
{
struct state *s1;
int n;
@ -1683,11 +1683,11 @@ processlacon(struct vars * v,
* subre - allocate a subre
*/
static struct subre *
subre(struct vars * v,
subre(struct vars *v,
int op,
int flags,
struct state * begin,
struct state * end)
struct state *begin,
struct state *end)
{
struct subre *ret = v->treefree;
@ -1735,8 +1735,8 @@ subre(struct vars * v,
* freesubre - free a subRE subtree
*/
static void
freesubre(struct vars * v, /* might be NULL */
struct subre * sr)
freesubre(struct vars *v, /* might be NULL */
struct subre *sr)
{
if (sr == NULL)
return;
@ -1753,8 +1753,8 @@ freesubre(struct vars * v, /* might be NULL */
* freesrnode - free one node in a subRE subtree
*/
static void
freesrnode(struct vars * v, /* might be NULL */
struct subre * sr)
freesrnode(struct vars *v, /* might be NULL */
struct subre *sr)
{
if (sr == NULL)
return;
@ -1777,8 +1777,8 @@ freesrnode(struct vars * v, /* might be NULL */
* optst - optimize a subRE subtree
*/
static void
optst(struct vars * v,
struct subre * t)
optst(struct vars *v,
struct subre *t)
{
/*
* DGP (2007-11-13): I assume it was the programmer's intent to eventually
@ -1793,7 +1793,7 @@ optst(struct vars * v,
* numst - number tree nodes (assigning "id" indexes)
*/
static int /* next number */
numst(struct subre * t,
numst(struct subre *t,
int start) /* starting point for subtree numbers */
{
int i;
@ -1827,7 +1827,7 @@ numst(struct subre * t,
* in or between these two functions.
*/
static void
markst(struct subre * t)
markst(struct subre *t)
{
assert(t != NULL);
@ -1842,7 +1842,7 @@ markst(struct subre * t)
* cleanst - free any tree nodes not marked INUSE
*/
static void
cleanst(struct vars * v)
cleanst(struct vars *v)
{
struct subre *t;
struct subre *next;
@ -1861,8 +1861,8 @@ cleanst(struct vars * v)
* nfatree - turn a subRE subtree into a tree of compacted NFAs
*/
static long /* optimize results from top node */
nfatree(struct vars * v,
struct subre * t,
nfatree(struct vars *v,
struct subre *t,
FILE *f) /* for debug output */
{
assert(t != NULL && t->begin != NULL);
@ -1881,8 +1881,8 @@ nfatree(struct vars * v,
* If converttosearch is true, apply makesearch() to the NFA.
*/
static long /* optimize results */
nfanode(struct vars * v,
struct subre * t,
nfanode(struct vars *v,
struct subre *t,
int converttosearch,
FILE *f) /* for debug output */
{
@ -1920,9 +1920,9 @@ nfanode(struct vars * v,
* newlacon - allocate a lookaround-constraint subRE
*/
static int /* lacon number */
newlacon(struct vars * v,
struct state * begin,
struct state * end,
newlacon(struct vars *v,
struct state *begin,
struct state *end,
int latype)
{
int n;
@ -1959,7 +1959,7 @@ newlacon(struct vars * v,
* freelacons - free lookaround-constraint subRE vector
*/
static void
freelacons(struct subre * subs,
freelacons(struct subre *subs,
int n)
{
struct subre *sub;
@ -2102,7 +2102,7 @@ dump(regex_t *re,
* dumpst - dump a subRE tree
*/
static void
dumpst(struct subre * t,
dumpst(struct subre *t,
FILE *f,
int nfapresent) /* is the original NFA still around? */
{
@ -2117,7 +2117,7 @@ dumpst(struct subre * t,
* stdump - recursive guts of dumpst
*/
static void
stdump(struct subre * t,
stdump(struct subre *t,
FILE *f,
int nfapresent) /* is the original NFA still around? */
{
@ -2167,7 +2167,7 @@ stdump(struct subre * t,
* stid - identify a subtree node for dumping
*/
static const char * /* points to buf or constant string */
stid(struct subre * t,
stid(struct subre *t,
char *buf,
size_t bufsize)
{

View File

@ -39,8 +39,8 @@
* Internal errors also return NULL, with v->err set.
*/
static chr *
longest(struct vars * v,
struct dfa * d,
longest(struct vars *v,
struct dfa *d,
chr *start, /* where the match should start */
chr *stop, /* match must end at or before here */
int *hitstopp) /* record whether hit v->stop, if non-NULL */
@ -165,8 +165,8 @@ longest(struct vars * v,
* Internal errors also return NULL, with v->err set.
*/
static chr *
shortest(struct vars * v,
struct dfa * d,
shortest(struct vars *v,
struct dfa *d,
chr *start, /* where the match should start */
chr *min, /* match must end at or after here */
chr *max, /* match must end at or before here */
@ -300,10 +300,10 @@ shortest(struct vars * v,
* Internal errors also return 0, with v->err set.
*/
static int
matchuntil(struct vars * v,
struct dfa * d,
matchuntil(struct vars *v,
struct dfa *d,
chr *probe, /* we want to know if a match ends here */
struct sset ** lastcss, /* state storage across calls */
struct sset **lastcss, /* state storage across calls */
chr **lastcp) /* state storage across calls */
{
chr *cp = *lastcp;
@ -414,8 +414,8 @@ matchuntil(struct vars * v,
* lastcold - determine last point at which no progress had been made
*/
static chr * /* endpoint, or NULL */
lastcold(struct vars * v,
struct dfa * d)
lastcold(struct vars *v,
struct dfa *d)
{
struct sset *ss;
chr *nopr;
@ -434,10 +434,10 @@ lastcold(struct vars * v,
* newdfa - set up a fresh DFA
*/
static struct dfa *
newdfa(struct vars * v,
struct cnfa * cnfa,
struct colormap * cm,
struct smalldfa * sml) /* preallocated space, may be NULL */
newdfa(struct vars *v,
struct cnfa *cnfa,
struct colormap *cm,
struct smalldfa *sml) /* preallocated space, may be NULL */
{
struct dfa *d;
size_t nss = cnfa->nstates * 2;
@ -514,7 +514,7 @@ newdfa(struct vars * v,
* freedfa - free a DFA
*/
static void
freedfa(struct dfa * d)
freedfa(struct dfa *d)
{
if (d->cptsmalloced)
{
@ -554,8 +554,8 @@ hash(unsigned *uv,
* initialize - hand-craft a cache entry for startup, otherwise get ready
*/
static struct sset *
initialize(struct vars * v,
struct dfa * d,
initialize(struct vars *v,
struct dfa *d,
chr *start)
{
struct sset *ss;
@ -600,9 +600,9 @@ initialize(struct vars * v,
* Internal errors also return NULL, with v->err set.
*/
static struct sset *
miss(struct vars * v,
struct dfa * d,
struct sset * css,
miss(struct vars *v,
struct dfa *d,
struct sset *css,
color co,
chr *cp, /* next chr */
chr *start) /* where the attempt got started */
@ -740,8 +740,8 @@ miss(struct vars * v,
* lacon - lookaround-constraint checker for miss()
*/
static int /* predicate: constraint satisfied? */
lacon(struct vars * v,
struct cnfa * pcnfa, /* parent cnfa */
lacon(struct vars *v,
struct cnfa *pcnfa, /* parent cnfa */
chr *cp,
color co) /* "color" of the lookaround constraint */
{
@ -797,8 +797,8 @@ lacon(struct vars * v,
* clear the innards of the state set -- that's up to the caller.
*/
static struct sset *
getvacant(struct vars * v,
struct dfa * d,
getvacant(struct vars *v,
struct dfa *d,
chr *cp,
chr *start)
{
@ -868,8 +868,8 @@ getvacant(struct vars * v,
* pickss - pick the next stateset to be used
*/
static struct sset *
pickss(struct vars * v,
struct dfa * d,
pickss(struct vars *v,
struct dfa *d,
chr *cp,
chr *start)
{

View File

@ -42,7 +42,7 @@ static const struct rerr
int code;
const char *name;
const char *explain;
} rerrs[] =
} rerrs[] =
{
/* the actual table is built from regex.h */

View File

@ -334,8 +334,8 @@ cleanup:
* The DFA will be freed by the cleanup step in pg_regexec().
*/
static struct dfa *
getsubdfa(struct vars * v,
struct subre * t)
getsubdfa(struct vars *v,
struct subre *t)
{
if (v->subdfas[t->id] == NULL)
{
@ -352,7 +352,7 @@ getsubdfa(struct vars * v,
* Same as above, but for LACONs.
*/
static struct dfa *
getladfa(struct vars * v,
getladfa(struct vars *v,
int n)
{
assert(n > 0 && n < v->g->nlacons && v->g->lacons != NULL);
@ -372,9 +372,9 @@ getladfa(struct vars * v,
* find - find a match for the main NFA (no-complications case)
*/
static int
find(struct vars * v,
struct cnfa * cnfa,
struct colormap * cm)
find(struct vars *v,
struct cnfa *cnfa,
struct colormap *cm)
{
struct dfa *s;
struct dfa *d;
@ -463,9 +463,9 @@ find(struct vars * v,
* cfind - find a match for the main NFA (with complications)
*/
static int
cfind(struct vars * v,
struct cnfa * cnfa,
struct colormap * cm)
cfind(struct vars *v,
struct cnfa *cnfa,
struct colormap *cm)
{
struct dfa *s;
struct dfa *d;
@ -503,11 +503,11 @@ cfind(struct vars * v,
* cfindloop - the heart of cfind
*/
static int
cfindloop(struct vars * v,
struct cnfa * cnfa,
struct colormap * cm,
struct dfa * d,
struct dfa * s,
cfindloop(struct vars *v,
struct cnfa *cnfa,
struct colormap *cm,
struct dfa *d,
struct dfa *s,
chr **coldp) /* where to put coldstart pointer */
{
chr *begin;
@ -632,8 +632,8 @@ zapallsubs(regmatch_t *p,
* zaptreesubs - initialize subexpressions within subtree to "no match"
*/
static void
zaptreesubs(struct vars * v,
struct subre * t)
zaptreesubs(struct vars *v,
struct subre *t)
{
if (t->op == '(')
{
@ -657,8 +657,8 @@ zaptreesubs(struct vars * v,
* subset - set subexpression match data for a successful subre
*/
static void
subset(struct vars * v,
struct subre * sub,
subset(struct vars *v,
struct subre *sub,
chr *begin,
chr *end)
{
@ -689,8 +689,8 @@ subset(struct vars * v,
* zaptreesubs (or zapallsubs at the top level).
*/
static int /* regexec return code */
cdissect(struct vars * v,
struct subre * t,
cdissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -760,8 +760,8 @@ cdissect(struct vars * v,
* ccondissect - dissect match for concatenation node
*/
static int /* regexec return code */
ccondissect(struct vars * v,
struct subre * t,
ccondissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -838,8 +838,8 @@ ccondissect(struct vars * v,
* crevcondissect - dissect match for concatenation node, shortest-first
*/
static int /* regexec return code */
crevcondissect(struct vars * v,
struct subre * t,
crevcondissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -916,8 +916,8 @@ crevcondissect(struct vars * v,
* cbrdissect - dissect match for backref node
*/
static int /* regexec return code */
cbrdissect(struct vars * v,
struct subre * t,
cbrdissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -997,8 +997,8 @@ cbrdissect(struct vars * v,
* caltdissect - dissect match for alternation node
*/
static int /* regexec return code */
caltdissect(struct vars * v,
struct subre * t,
caltdissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -1034,8 +1034,8 @@ caltdissect(struct vars * v,
* citerdissect - dissect match for iteration node
*/
static int /* regexec return code */
citerdissect(struct vars * v,
struct subre * t,
citerdissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
@ -1235,8 +1235,8 @@ backtrack:
* creviterdissect - dissect match for iteration node, shortest-first
*/
static int /* regexec return code */
creviterdissect(struct vars * v,
struct subre * t,
creviterdissect(struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{

View File

@ -90,7 +90,7 @@ pg_reg_getfinalstate(const regex_t *regex)
* arcs_len (possibly 0) are emitted into arcs[].
*/
static void
traverse_lacons(struct cnfa * cnfa, int st,
traverse_lacons(struct cnfa *cnfa, int st,
int *arcs_count,
regex_arc_t *arcs, int arcs_len)
{

View File

@ -19,7 +19,7 @@
/*
* forward declarations
*/
static int findprefix(struct cnfa * cnfa, struct colormap * cm,
static int findprefix(struct cnfa *cnfa, struct colormap *cm,
chr *string, size_t *slength);
@ -109,8 +109,8 @@ pg_regprefix(regex_t *re,
* *slength (which must be preset to zero) incremented for each chr.
*/
static int /* regprefix return code */
findprefix(struct cnfa * cnfa,
struct colormap * cm,
findprefix(struct cnfa *cnfa,
struct colormap *cm,
chr *string,
size_t *slength)
{