diff options
| author | Tom Lane | 2017-06-21 19:18:54 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-06-21 19:19:25 +0000 |
| commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
| tree | e85979fb1213a731b7b557f8a830df541f26b135 /src/include/libpq | |
| parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) | |
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/include/libpq')
| -rw-r--r-- | src/include/libpq/auth.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/be-fsstubs.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/hba.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/ifaddr.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/libpq-be.h | 12 | ||||
| -rw-r--r-- | src/include/libpq/libpq-fs.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/libpq.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/pqcomm.h | 12 | ||||
| -rw-r--r-- | src/include/libpq/pqformat.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/pqmq.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/pqsignal.h | 4 | ||||
| -rw-r--r-- | src/include/libpq/scram.h | 2 |
12 files changed, 23 insertions, 23 deletions
diff --git a/src/include/libpq/auth.h b/src/include/libpq/auth.h index 601dc5d71a3..871cc03adda 100644 --- a/src/include/libpq/auth.h +++ b/src/include/libpq/auth.h @@ -26,4 +26,4 @@ extern void ClientAuthentication(Port *port); typedef void (*ClientAuthentication_hook_type) (Port *, int); extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook; -#endif /* AUTH_H */ +#endif /* AUTH_H */ diff --git a/src/include/libpq/be-fsstubs.h b/src/include/libpq/be-fsstubs.h index 641124cd21a..96bcaa0f086 100644 --- a/src/include/libpq/be-fsstubs.h +++ b/src/include/libpq/be-fsstubs.h @@ -34,4 +34,4 @@ extern void AtEOXact_LargeObject(bool isCommit); extern void AtEOSubXact_LargeObject(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); -#endif /* BE_FSSTUBS_H */ +#endif /* BE_FSSTUBS_H */ diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h index f28b860877c..07d92d4f9f3 100644 --- a/src/include/libpq/hba.h +++ b/src/include/libpq/hba.h @@ -120,4 +120,4 @@ extern int check_usermap(const char *usermap_name, bool case_sensitive); extern bool pg_isblank(const char c); -#endif /* HBA_H */ +#endif /* HBA_H */ diff --git a/src/include/libpq/ifaddr.h b/src/include/libpq/ifaddr.h index f11bb4a0735..be19ff88239 100644 --- a/src/include/libpq/ifaddr.h +++ b/src/include/libpq/ifaddr.h @@ -27,4 +27,4 @@ extern int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data); -#endif /* IFADDR_H */ +#endif /* IFADDR_H */ diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index 5774a6df3ff..7bde744d51a 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -32,7 +32,7 @@ #include <gssapi.h> #else #include <gssapi/gssapi.h> -#endif /* HAVE_GSSAPI_H */ +#endif /* HAVE_GSSAPI_H */ /* * GSSAPI brings in headers that set a lot of things in the global namespace on win32, * that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore, @@ -41,7 +41,7 @@ #ifdef _MSC_VER #undef HAVE_GETADDRINFO #endif -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ #ifdef ENABLE_SSPI #define SECURITY_WIN32 @@ -61,7 +61,7 @@ typedef struct int length; } gss_buffer_desc; #endif -#endif /* ENABLE_SSPI */ +#endif /* ENABLE_SSPI */ #include "datatype/timestamp.h" #include "libpq/hba.h" @@ -124,7 +124,7 @@ typedef struct Port char *remote_hostname; /* name (not ip addr) of remote host, if * available */ int remote_hostname_resolv; /* see above */ - int remote_hostname_errcode; /* see above */ + int remote_hostname_errcode; /* see above */ char *remote_port; /* text rep of remote port */ CAC_state canAcceptConnections; /* postmaster connection status */ @@ -148,7 +148,7 @@ typedef struct Port * but since it gets used by elog.c in the same way as database_name and * other members of this struct, we may as well keep it here. */ - TimestampTz SessionStartTime; /* backend start time */ + TimestampTz SessionStartTime; /* backend start time */ /* * TCP keepalive settings. @@ -223,4 +223,4 @@ extern int pq_setkeepalivesidle(int idle, Port *port); extern int pq_setkeepalivesinterval(int interval, Port *port); extern int pq_setkeepalivescount(int count, Port *port); -#endif /* LIBPQ_BE_H */ +#endif /* LIBPQ_BE_H */ diff --git a/src/include/libpq/libpq-fs.h b/src/include/libpq/libpq-fs.h index afe32706f4d..ce4b2a18923 100644 --- a/src/include/libpq/libpq-fs.h +++ b/src/include/libpq/libpq-fs.h @@ -21,4 +21,4 @@ #define INV_WRITE 0x00020000 #define INV_READ 0x00040000 -#endif /* LIBPQ_FS_H */ +#endif /* LIBPQ_FS_H */ diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index d4885a5e282..78851b10605 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -99,4 +99,4 @@ extern char *SSLCipherSuites; extern char *SSLECDHCurve; extern bool SSLPreferServerCiphers; -#endif /* LIBPQ_H */ +#endif /* LIBPQ_H */ diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h index b6de569c5cb..10c7434c411 100644 --- a/src/include/libpq/pqcomm.h +++ b/src/include/libpq/pqcomm.h @@ -57,7 +57,7 @@ struct sockaddr_storage #define ss_len ss_stuff.sa.sa_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif -#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ +#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ typedef struct { @@ -133,19 +133,19 @@ typedef uint32 PacketLen; #define SM_DATABASE 64 #define SM_USER 32 /* We append database name if db_user_namespace true. */ -#define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */ +#define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */ #define SM_OPTIONS 64 #define SM_UNUSED 64 #define SM_TTY 64 typedef struct StartupPacket { - ProtocolVersion protoVersion; /* Protocol version */ + ProtocolVersion protoVersion; /* Protocol version */ char database[SM_DATABASE]; /* Database name */ /* Db_user_namespace appends dbname */ char user[SM_USER]; /* User name */ char options[SM_OPTIONS]; /* Optional additional args */ - char unused[SM_UNUSED]; /* Unused */ + char unused[SM_UNUSED]; /* Unused */ char tty[SM_TTY]; /* Tty for debug output */ } StartupPacket; @@ -192,7 +192,7 @@ typedef uint32 AuthRequest; typedef struct CancelRequestPacket { /* Note that each field is stored in network byte order! */ - MsgType cancelRequestCode; /* code to identify a cancel request */ + MsgType cancelRequestCode; /* code to identify a cancel request */ uint32 backendPID; /* PID of client's backend */ uint32 cancelAuthCode; /* secret key to authorize cancel */ } CancelRequestPacket; @@ -204,4 +204,4 @@ typedef struct CancelRequestPacket */ #define NEGOTIATE_SSL_CODE PG_PROTOCOL(1234,5679) -#endif /* PQCOMM_H */ +#endif /* PQCOMM_H */ diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h index 4df87ec8a23..32112547a0b 100644 --- a/src/include/libpq/pqformat.h +++ b/src/include/libpq/pqformat.h @@ -47,4 +47,4 @@ extern const char *pq_getmsgstring(StringInfo msg); extern const char *pq_getmsgrawstring(StringInfo msg); extern void pq_getmsgend(StringInfo msg); -#endif /* PQFORMAT_H */ +#endif /* PQFORMAT_H */ diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h index e356bd60f4b..86436d67531 100644 --- a/src/include/libpq/pqmq.h +++ b/src/include/libpq/pqmq.h @@ -21,4 +21,4 @@ extern void pq_set_parallel_master(pid_t pid, BackendId backend_id); extern void pq_parse_errornotice(StringInfo str, ErrorData *edata); -#endif /* PQMQ_H */ +#endif /* PQMQ_H */ diff --git a/src/include/libpq/pqsignal.h b/src/include/libpq/pqsignal.h index a9dbce49d19..af4e61ba4d9 100644 --- a/src/include/libpq/pqsignal.h +++ b/src/include/libpq/pqsignal.h @@ -28,7 +28,7 @@ extern int pqsigsetmask(int mask); #define sigfillset(set) (*(set) = ~0) #define sigaddset(set, signum) (*(set) |= (sigmask(signum))) #define sigdelset(set, signum) (*(set) &= ~(sigmask(signum))) -#endif /* WIN32 */ +#endif /* WIN32 */ extern sigset_t UnBlockSig, BlockSig, @@ -36,4 +36,4 @@ extern sigset_t UnBlockSig, extern void pqinitmask(void); -#endif /* PQSIGNAL_H */ +#endif /* PQSIGNAL_H */ diff --git a/src/include/libpq/scram.h b/src/include/libpq/scram.h index 14b48af12f4..0166e1945dd 100644 --- a/src/include/libpq/scram.h +++ b/src/include/libpq/scram.h @@ -31,4 +31,4 @@ extern char *pg_be_scram_build_verifier(const char *password); extern bool scram_verify_plain_password(const char *username, const char *password, const char *verifier); -#endif /* PG_SCRAM_H */ +#endif /* PG_SCRAM_H */ |
