diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 14:39:04 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 14:39:04 -0400 |
commit | e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 (patch) | |
tree | 8dc7df95c340803546152724fbc17aee4b8527f9 /src/backend/regex/regc_lex.c | |
parent | 8ff6d4ec7840b0af56f1207073f44b7f2afae96d (diff) | |
download | postgresql-e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89.tar.gz postgresql-e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89.zip |
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
Diffstat (limited to 'src/backend/regex/regc_lex.c')
-rw-r--r-- | src/backend/regex/regc_lex.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/regex/regc_lex.c b/src/backend/regex/regc_lex.c index cd34c8ae411..b2506ca814f 100644 --- a/src/backend/regex/regc_lex.c +++ b/src/backend/regex/regc_lex.c @@ -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 */ |