mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Standard pgindent run for 8.1.
This commit is contained in:
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_color.c,v 1.4 2003/11/29 19:51:55 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_color.c,v 1.5 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*
|
||||
* Note that there are some incestuous relationships between this code and
|
||||
@ -179,7 +179,7 @@ setcolor(struct colormap * cm,
|
||||
if (t == fillt || t == cb)
|
||||
{ /* must allocate a new block */
|
||||
newt = (union tree *) MALLOC((bottom) ?
|
||||
sizeof(struct colors) : sizeof(struct ptrs));
|
||||
sizeof(struct colors) : sizeof(struct ptrs));
|
||||
if (newt == NULL)
|
||||
{
|
||||
CERR(REG_ESPACE);
|
||||
@ -256,7 +256,7 @@ newcolor(struct colormap * cm)
|
||||
}
|
||||
else
|
||||
new = (struct colordesc *) REALLOC(cm->cd,
|
||||
n * sizeof(struct colordesc));
|
||||
n * sizeof(struct colordesc));
|
||||
if (new == NULL)
|
||||
{
|
||||
CERR(REG_ESPACE);
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_cvec.c,v 1.4 2003/11/29 19:51:55 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_cvec.c,v 1.5 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -52,8 +52,7 @@ newcvec(int nchrs, /* to hold this many chrs... */
|
||||
if (cv == NULL)
|
||||
return NULL;
|
||||
cv->chrspace = nchrs;
|
||||
cv->chrs = (chr *) &cv->mcces[nmcces]; /* chrs just after MCCE
|
||||
* ptrs */
|
||||
cv->chrs = (chr *) &cv->mcces[nmcces]; /* chrs just after MCCE ptrs */
|
||||
cv->mccespace = nmcces;
|
||||
cv->ranges = cv->chrs + nchrs + nmcces * (MAXMCCE + 1);
|
||||
cv->rangespace = nranges;
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_lex.c,v 1.4 2003/11/29 19:51:55 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_lex.c,v 1.5 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -712,8 +712,7 @@ next(struct vars * v)
|
||||
* lexescape - parse an ARE backslash escape (backslash already eaten)
|
||||
* Note slightly nonstandard use of the CCLASS type code.
|
||||
*/
|
||||
static int /* not actually used, but convenient for
|
||||
* RETV */
|
||||
static int /* not actually used, but convenient for RETV */
|
||||
lexescape(struct vars * v)
|
||||
{
|
||||
chr c;
|
||||
@ -816,8 +815,7 @@ lexescape(struct vars * v)
|
||||
break;
|
||||
case CHR('x'):
|
||||
NOTE(REG_UUNPORT);
|
||||
c = lexdigits(v, 16, 1, 255); /* REs >255 long outside
|
||||
* spec */
|
||||
c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */
|
||||
if (ISERR())
|
||||
FAILW(REG_EESCAPE);
|
||||
RETV(PLAIN, c);
|
||||
@ -844,8 +842,7 @@ lexescape(struct vars * v)
|
||||
case CHR('9'):
|
||||
save = v->now;
|
||||
v->now--; /* put first digit back */
|
||||
c = lexdigits(v, 10, 1, 255); /* REs >255 long outside
|
||||
* spec */
|
||||
c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */
|
||||
if (ISERR())
|
||||
FAILW(REG_EESCAPE);
|
||||
/* ugly heuristic (first test is "exactly 1 digit?") */
|
||||
|
@ -47,7 +47,7 @@
|
||||
* permission to use and distribute the software in accordance with the
|
||||
* terms specified in this license.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_locale.c,v 1.6 2004/05/07 00:24:57 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_locale.c,v 1.7 2005/10/15 02:49:24 momjian Exp $
|
||||
*/
|
||||
|
||||
/* ASCII character-name table */
|
||||
@ -520,10 +520,9 @@ range(struct vars * v, /* context */
|
||||
}
|
||||
|
||||
/*
|
||||
* When case-independent, it's hard to decide when cvec ranges are
|
||||
* usable, so for now at least, we won't try. We allocate enough
|
||||
* space for two case variants plus a little extra for the two title
|
||||
* case variants.
|
||||
* When case-independent, it's hard to decide when cvec ranges are usable,
|
||||
* so for now at least, we won't try. We allocate enough space for two
|
||||
* case variants plus a little extra for the two title case variants.
|
||||
*/
|
||||
|
||||
nchrs = (b - a + 1) * 2 + 4;
|
||||
@ -656,8 +655,7 @@ cclass(struct vars * v, /* context */
|
||||
/*
|
||||
* Now compute the character class contents.
|
||||
*
|
||||
* For the moment, assume that only char codes < 256 can be in these
|
||||
* classes.
|
||||
* For the moment, assume that only char codes < 256 can be in these classes.
|
||||
*/
|
||||
|
||||
switch ((enum classes) index)
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_nfa.c,v 1.3 2003/11/29 19:51:55 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regc_nfa.c,v 1.4 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*
|
||||
* One or two things that technically ought to be in here
|
||||
@ -218,8 +218,7 @@ freestate(struct nfa * nfa,
|
||||
nfa->states = s->next;
|
||||
}
|
||||
s->prev = NULL;
|
||||
s->next = nfa->free; /* don't delete it, put it on the free
|
||||
* list */
|
||||
s->next = nfa->free; /* don't delete it, put it on the free list */
|
||||
nfa->free = s;
|
||||
}
|
||||
|
||||
@ -275,10 +274,10 @@ newarc(struct nfa * nfa,
|
||||
a->from = from;
|
||||
|
||||
/*
|
||||
* Put the new arc on the beginning, not the end, of the chains. Not
|
||||
* only is this easier, it has the very useful side effect that
|
||||
* deleting the most-recently-added arc is the cheapest case rather
|
||||
* than the most expensive one.
|
||||
* Put the new arc on the beginning, not the end, of the chains. Not only
|
||||
* is this easier, it has the very useful side effect that deleting the
|
||||
* most-recently-added arc is the cheapest case rather than the most
|
||||
* expensive one.
|
||||
*/
|
||||
a->inchain = to->ins;
|
||||
to->ins = a;
|
||||
@ -1155,8 +1154,7 @@ cleanup(struct nfa * nfa)
|
||||
static void
|
||||
markreachable(struct nfa * nfa,
|
||||
struct state * s,
|
||||
struct state * okay, /* consider only states with this
|
||||
* mark */
|
||||
struct state * okay, /* consider only states with this mark */
|
||||
struct state * mark) /* the value to mark with */
|
||||
{
|
||||
struct arc *a;
|
||||
@ -1175,8 +1173,7 @@ markreachable(struct nfa * nfa,
|
||||
static void
|
||||
markcanreach(struct nfa * nfa,
|
||||
struct state * s,
|
||||
struct state * okay, /* consider only states with this
|
||||
* mark */
|
||||
struct state * okay, /* consider only states with this mark */
|
||||
struct state * mark) /* the value to mark with */
|
||||
{
|
||||
struct arc *a;
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.43 2005/05/25 21:40:40 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.44 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -208,8 +208,7 @@ struct vars
|
||||
regex_t *re;
|
||||
chr *now; /* scan pointer into string */
|
||||
chr *stop; /* end of string */
|
||||
chr *savenow; /* saved now and stop for "subroutine
|
||||
* call" */
|
||||
chr *savenow; /* saved now and stop for "subroutine call" */
|
||||
chr *savestop;
|
||||
int err; /* error code (0 if none) */
|
||||
int cflags; /* copy of compile flags */
|
||||
@ -251,8 +250,7 @@ struct vars
|
||||
#define NOERR() {if (ISERR()) return;} /* if error seen, return */
|
||||
#define NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */
|
||||
#define NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */
|
||||
#define INSIST(c, e) ((c) ? 0 : ERR(e)) /* if condition false,
|
||||
* error */
|
||||
#define INSIST(c, e) ((c) ? 0 : ERR(e)) /* if condition false, error */
|
||||
#define NOTE(b) (v->re->re_info |= (b)) /* note visible condition */
|
||||
#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y)
|
||||
|
||||
@ -306,7 +304,6 @@ pg_regcomp(regex_t *re,
|
||||
|
||||
#ifdef REG_DEBUG
|
||||
FILE *debug = (flags & REG_PROGRESS) ? stdout : (FILE *) NULL;
|
||||
|
||||
#else
|
||||
FILE *debug = (FILE *) NULL;
|
||||
#endif
|
||||
@ -572,11 +569,10 @@ makesearch(struct vars * v,
|
||||
/*
|
||||
* Now here's the subtle part. Because many REs have no lookback
|
||||
* constraints, often knowing when you were in the pre state tells you
|
||||
* little; it's the next state(s) that are informative. But some of
|
||||
* them may have other inarcs, i.e. it may be possible to make actual
|
||||
* progress and then return to one of them. We must de-optimize such
|
||||
* cases, splitting each such state into progress and no-progress
|
||||
* states.
|
||||
* little; it's the next state(s) that are informative. But some of them
|
||||
* may have other inarcs, i.e. it may be possible to make actual progress
|
||||
* and then return to one of them. We must de-optimize such cases,
|
||||
* splitting each such state into progress and no-progress states.
|
||||
*/
|
||||
|
||||
/* first, make a list of the states */
|
||||
@ -591,8 +587,8 @@ makesearch(struct vars * v,
|
||||
{ /* must be split */
|
||||
if (s->tmp == NULL)
|
||||
{ /* if not already in the list */
|
||||
/* (fixes bugs 505048, 230589, */
|
||||
/* 840258, 504785) */
|
||||
/* (fixes bugs 505048, 230589, */
|
||||
/* 840258, 504785) */
|
||||
s->tmp = slist;
|
||||
slist = s;
|
||||
}
|
||||
@ -1043,9 +1039,8 @@ parseqatom(struct vars * v,
|
||||
}
|
||||
|
||||
/*
|
||||
* hard part: something messy That is, capturing parens, back
|
||||
* reference, short/long clash, or an atom with substructure
|
||||
* containing one of those.
|
||||
* hard part: something messy That is, capturing parens, back reference,
|
||||
* short/long clash, or an atom with substructure containing one of those.
|
||||
*/
|
||||
|
||||
/* now we'll need a subre for the contents even if they're boring */
|
||||
@ -1522,9 +1517,8 @@ brackpart(struct vars * v,
|
||||
endc = startc;
|
||||
|
||||
/*
|
||||
* Ranges are unportable. Actually, standard C does guarantee that
|
||||
* digits are contiguous, but making that an exception is just too
|
||||
* complicated.
|
||||
* Ranges are unportable. Actually, standard C does guarantee that digits
|
||||
* are contiguous, but making that an exception is just too complicated.
|
||||
*/
|
||||
if (startc != endc)
|
||||
NOTE(REG_UUNPORT);
|
||||
@ -1600,8 +1594,7 @@ leaders(struct vars * v,
|
||||
assert(s != v->mccepend);
|
||||
}
|
||||
p++;
|
||||
assert(*p != 0 && *(p + 1) == 0); /* only 2-char MCCEs for
|
||||
* now */
|
||||
assert(*p != 0 && *(p + 1) == 0); /* only 2-char MCCEs for now */
|
||||
newarc(v->nfa, PLAIN, subcolor(v->cm, *p), s, v->mccepend);
|
||||
okcolors(v->nfa, v->cm);
|
||||
}
|
||||
@ -2053,7 +2046,7 @@ newlacon(struct vars * v,
|
||||
else
|
||||
{
|
||||
v->lacons = (struct subre *) REALLOC(v->lacons,
|
||||
(v->nlacons + 1) * sizeof(struct subre));
|
||||
(v->nlacons + 1) * sizeof(struct subre));
|
||||
n = v->nlacons++;
|
||||
}
|
||||
if (v->lacons == NULL)
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/rege_dfa.c,v 1.5 2005/09/24 22:54:38 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/rege_dfa.c,v 1.6 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -145,8 +145,7 @@ shortest(struct vars * v,
|
||||
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 */
|
||||
chr **coldp, /* store coldstart pointer here, if
|
||||
* nonNULL */
|
||||
chr **coldp, /* store coldstart pointer here, if nonNULL */
|
||||
int *hitstopp) /* record whether hit v->stop, if non-NULL */
|
||||
{
|
||||
chr *cp;
|
||||
@ -222,8 +221,7 @@ shortest(struct vars * v,
|
||||
if (ss == NULL)
|
||||
return NULL;
|
||||
|
||||
if (coldp != NULL) /* report last no-progress state set, if
|
||||
* any */
|
||||
if (coldp != NULL) /* report last no-progress state set, if any */
|
||||
*coldp = lastcold(v, d);
|
||||
|
||||
if ((ss->flags & POSTSTATE) && cp > min)
|
||||
|
@ -27,7 +27,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regexec.c,v 1.26 2005/09/24 22:54:38 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/regex/regexec.c,v 1.27 2005/10/15 02:49:24 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -75,8 +75,7 @@ struct dfa
|
||||
struct cnfa *cnfa;
|
||||
struct colormap *cm;
|
||||
chr *lastpost; /* location of last cache-flushed success */
|
||||
chr *lastnopr; /* location of last cache-flushed
|
||||
* NOPROGRESS */
|
||||
chr *lastnopr; /* location of last cache-flushed NOPROGRESS */
|
||||
struct sset *search; /* replacement-search-pointer memory */
|
||||
int cptsmalloced; /* were the areas individually malloced? */
|
||||
char *mallocarea; /* self, or master malloced area, or NULL */
|
||||
@ -122,8 +121,7 @@ struct vars
|
||||
#define ISERR() VISERR(v)
|
||||
#define VERR(vv,e) (((vv)->err) ? (vv)->err : ((vv)->err = (e)))
|
||||
#define ERR(e) VERR(v, e) /* record an error */
|
||||
#define NOERR() {if (ISERR()) return v->err;} /* if error seen, return
|
||||
* it */
|
||||
#define NOERR() {if (ISERR()) return v->err;} /* if error seen, return it */
|
||||
#define OFF(p) ((p) - v->start)
|
||||
#define LOFF(p) ((long)OFF(p))
|
||||
|
||||
@ -279,8 +277,7 @@ find(struct vars * v,
|
||||
chr *begin;
|
||||
chr *end = NULL;
|
||||
chr *cold;
|
||||
chr *open; /* open and close of range of possible
|
||||
* starts */
|
||||
chr *open; /* open and close of range of possible starts */
|
||||
chr *close;
|
||||
int hitend;
|
||||
int shorter = (v->g->tree->flags & SHORTER) ? 1 : 0;
|
||||
@ -408,8 +405,7 @@ cfindloop(struct vars * v,
|
||||
chr *begin;
|
||||
chr *end;
|
||||
chr *cold;
|
||||
chr *open; /* open and close of range of possible
|
||||
* starts */
|
||||
chr *open; /* open and close of range of possible starts */
|
||||
chr *close;
|
||||
chr *estart;
|
||||
chr *estop;
|
||||
@ -1033,8 +1029,7 @@ caltdissect(struct vars * v,
|
||||
|
||||
#define UNTRIED 0 /* not yet tried at all */
|
||||
#define TRYING 1 /* top matched, trying submatches */
|
||||
#define TRIED 2 /* top didn't match or submatches
|
||||
* exhausted */
|
||||
#define TRIED 2 /* top didn't match or submatches exhausted */
|
||||
|
||||
if (t == NULL)
|
||||
return REG_NOMATCH;
|
||||
|
Reference in New Issue
Block a user