diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:18:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:19:25 -0400 |
commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
tree | e85979fb1213a731b7b557f8a830df541f26b135 /src/interfaces/ecpg/test | |
parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) | |
download | postgresql-c7b8998ebbf310a156aa38022555a24d98fdbfb4.tar.gz postgresql-c7b8998ebbf310a156aa38022555a24d98fdbfb4.zip |
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
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/interfaces/ecpg/test')
18 files changed, 36 insertions, 36 deletions
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-describe.c b/src/interfaces/ecpg/test/expected/compat_informix-describe.c index d1632e280c1..1b5aae0df7a 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-describe.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-describe.c @@ -41,7 +41,7 @@ typedef struct sqlda_struct sqlda_t; #endif -#endif /* ECPG_SQLDA_H */ +#endif /* ECPG_SQLDA_H */ #line 5 "describe.pgc" diff --git a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c index 1f316fbd7c6..1df87f83ef0 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c @@ -43,7 +43,7 @@ typedef struct sqlda_struct sqlda_t; #endif -#endif /* ECPG_SQLDA_H */ +#endif /* ECPG_SQLDA_H */ #line 7 "sqlda.pgc" @@ -105,7 +105,7 @@ typedef struct sqlda_struct sqlda_t; #define SQLSERIAL8 ECPGt_long #endif -#endif /* ndef ECPG_SQLTYPES_H */ +#endif /* ndef ECPG_SQLTYPES_H */ #line 8 "sqlda.pgc" diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c index 98246f47345..4e372a57991 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c @@ -23,8 +23,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/preproc-init.c b/src/interfaces/ecpg/test/expected/preproc-init.c index 6ca8d559014..ca23d348d6e 100644 --- a/src/interfaces/ecpg/test/expected/preproc-init.c +++ b/src/interfaces/ecpg/test/expected/preproc-init.c @@ -17,8 +17,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c index 70809c450d0..b3deb221d74 100644 --- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c +++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c @@ -58,7 +58,7 @@ typedef struct int rscale; /* result scale */ int dscale; /* display scale */ int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */ - NumericDigit digits[DECSIZE]; /* decimal digits */ + NumericDigit digits[DECSIZE]; /* decimal digits */ } decimal; #ifdef __cplusplus @@ -91,7 +91,7 @@ int PGTYPESnumeric_from_decimal(decimal *, numeric *); } #endif -#endif /* PGTYPES_NUMERIC */ +#endif /* PGTYPES_NUMERIC */ #line 8 "outofscope.pgc" diff --git a/src/interfaces/ecpg/test/expected/sql-array.c b/src/interfaces/ecpg/test/expected/sql-array.c index 4b0a0418f73..781c4267718 100644 --- a/src/interfaces/ecpg/test/expected/sql-array.c +++ b/src/interfaces/ecpg/test/expected/sql-array.c @@ -30,8 +30,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-code100.c b/src/interfaces/ecpg/test/expected/sql-code100.c index 4338f7ed2d3..4c85530a17a 100644 --- a/src/interfaces/ecpg/test/expected/sql-code100.c +++ b/src/interfaces/ecpg/test/expected/sql-code100.c @@ -17,8 +17,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-copystdout.c b/src/interfaces/ecpg/test/expected/sql-copystdout.c index a1e75958731..d2599fb0e93 100644 --- a/src/interfaces/ecpg/test/expected/sql-copystdout.c +++ b/src/interfaces/ecpg/test/expected/sql-copystdout.c @@ -19,8 +19,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-define.c b/src/interfaces/ecpg/test/expected/sql-define.c index 9c9931f4438..29583ecd741 100644 --- a/src/interfaces/ecpg/test/expected/sql-define.c +++ b/src/interfaces/ecpg/test/expected/sql-define.c @@ -17,8 +17,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-describe.c b/src/interfaces/ecpg/test/expected/sql-describe.c index b5e2d7427fc..155e206f29d 100644 --- a/src/interfaces/ecpg/test/expected/sql-describe.c +++ b/src/interfaces/ecpg/test/expected/sql-describe.c @@ -39,7 +39,7 @@ typedef struct sqlda_struct sqlda_t; #endif -#endif /* ECPG_SQLDA_H */ +#endif /* ECPG_SQLDA_H */ #line 5 "describe.pgc" diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc.c b/src/interfaces/ecpg/test/expected/sql-dynalloc.c index d2051e6996a..a95dddf15d6 100644 --- a/src/interfaces/ecpg/test/expected/sql-dynalloc.c +++ b/src/interfaces/ecpg/test/expected/sql-dynalloc.c @@ -18,8 +18,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c index 2d25149cbbc..711857706ae 100644 --- a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c +++ b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c @@ -18,8 +18,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-dyntest.c b/src/interfaces/ecpg/test/expected/sql-dyntest.c index ea0d859bd7e..513d44c6304 100644 --- a/src/interfaces/ecpg/test/expected/sql-dyntest.c +++ b/src/interfaces/ecpg/test/expected/sql-dyntest.c @@ -57,7 +57,7 @@ enum * standard) */ }; -#endif /* !_ECPG_SQL3TYPES_H */ +#endif /* !_ECPG_SQL3TYPES_H */ #line 7 "dyntest.pgc" @@ -71,8 +71,8 @@ enum #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-indicators.c b/src/interfaces/ecpg/test/expected/sql-indicators.c index 454fba0dba8..7cf43ad6228 100644 --- a/src/interfaces/ecpg/test/expected/sql-indicators.c +++ b/src/interfaces/ecpg/test/expected/sql-indicators.c @@ -19,8 +19,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c index b6c35ab1a3a..15c81c6b126 100644 --- a/src/interfaces/ecpg/test/expected/sql-sqlda.c +++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c @@ -41,7 +41,7 @@ typedef struct sqlda_struct sqlda_t; #endif -#endif /* ECPG_SQLDA_H */ +#endif /* ECPG_SQLDA_H */ #line 7 "sqlda.pgc" @@ -80,7 +80,7 @@ typedef struct int rscale; /* result scale */ int dscale; /* display scale */ int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */ - NumericDigit digits[DECSIZE]; /* decimal digits */ + NumericDigit digits[DECSIZE]; /* decimal digits */ } decimal; #ifdef __cplusplus @@ -113,7 +113,7 @@ int PGTYPESnumeric_from_decimal(decimal *, numeric *); } #endif -#endif /* PGTYPES_NUMERIC */ +#endif /* PGTYPES_NUMERIC */ #line 8 "sqlda.pgc" diff --git a/src/interfaces/ecpg/test/expected/thread-alloc.c b/src/interfaces/ecpg/test/expected/thread-alloc.c index 57ef2bcc63b..9f8ac594304 100644 --- a/src/interfaces/ecpg/test/expected/thread-alloc.c +++ b/src/interfaces/ecpg/test/expected/thread-alloc.c @@ -40,8 +40,8 @@ main(void) #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/thread-descriptor.c b/src/interfaces/ecpg/test/expected/thread-descriptor.c index 50a7a31da43..607df7ce242 100644 --- a/src/interfaces/ecpg/test/expected/thread-descriptor.c +++ b/src/interfaces/ecpg/test/expected/thread-descriptor.c @@ -31,8 +31,8 @@ #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 diff --git a/src/interfaces/ecpg/test/expected/thread-prep.c b/src/interfaces/ecpg/test/expected/thread-prep.c index 382e2148799..72ca568151d 100644 --- a/src/interfaces/ecpg/test/expected/thread-prep.c +++ b/src/interfaces/ecpg/test/expected/thread-prep.c @@ -40,8 +40,8 @@ main(void) #define PGDLLIMPORT __declspec (dllimport) #else #define PGDLLIMPORT -#endif /* __CYGWIN__ */ -#endif /* PGDLLIMPORT */ +#endif /* __CYGWIN__ */ +#endif /* PGDLLIMPORT */ #define SQLERRMC_LEN 150 |