mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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 e3860ffa4d
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
This commit is contained in:
@@ -33,4 +33,4 @@ extern void SendBaseBackup(BaseBackupCmd *cmd);
|
||||
|
||||
extern int64 sendTablespace(char *path, bool sizeonly);
|
||||
|
||||
#endif /* _BASEBACKUP_H */
|
||||
#endif /* _BASEBACKUP_H */
|
||||
|
@@ -26,4 +26,4 @@ extern void AtEOXact_ApplyLauncher(bool isCommit);
|
||||
|
||||
extern bool IsLogicalLauncher(void);
|
||||
|
||||
#endif /* LOGICALLAUNCHER_H */
|
||||
#endif /* LOGICALLAUNCHER_H */
|
||||
|
@@ -103,4 +103,4 @@ extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
|
||||
extern void logicalrep_write_typ(StringInfo out, Oid typoid);
|
||||
extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
|
||||
|
||||
#endif /* LOGICALREP_PROTO_H */
|
||||
#endif /* LOGICALREP_PROTO_H */
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
typedef struct LogicalRepRelMapEntry
|
||||
{
|
||||
LogicalRepRelation remoterel; /* key is remoterel.remoteid */
|
||||
LogicalRepRelation remoterel; /* key is remoterel.remoteid */
|
||||
|
||||
/* Mapping to local relation, filled as needed. */
|
||||
Oid localreloid; /* local relation id */
|
||||
@@ -39,4 +39,4 @@ extern void logicalrep_rel_close(LogicalRepRelMapEntry *rel,
|
||||
extern void logicalrep_typmap_update(LogicalRepTyp *remotetyp);
|
||||
extern Oid logicalrep_typmap_getid(Oid remoteid);
|
||||
|
||||
#endif /* LOGICALRELATION_H */
|
||||
#endif /* LOGICALRELATION_H */
|
||||
|
@@ -16,4 +16,4 @@ extern void ApplyWorkerMain(Datum main_arg);
|
||||
|
||||
extern bool IsLogicalWorker(void);
|
||||
|
||||
#endif /* LOGICALWORKER_H */
|
||||
#endif /* LOGICALWORKER_H */
|
||||
|
@@ -39,4 +39,4 @@ void logicalmsg_redo(XLogReaderState *record);
|
||||
void logicalmsg_desc(StringInfo buf, XLogReaderState *record);
|
||||
const char *logicalmsg_identify(uint8 info);
|
||||
|
||||
#endif /* PG_LOGICAL_MESSAGE_H */
|
||||
#endif /* PG_LOGICAL_MESSAGE_H */
|
||||
|
@@ -71,4 +71,4 @@ const char *replorigin_identify(uint8 info);
|
||||
extern Size ReplicationOriginShmemSize(void);
|
||||
extern void ReplicationOriginShmemInit(void);
|
||||
|
||||
#endif /* PG_ORIGIN_H */
|
||||
#endif /* PG_ORIGIN_H */
|
||||
|
@@ -108,4 +108,4 @@ extern void OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool la
|
||||
extern void OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write);
|
||||
extern void OutputPluginUpdateProgress(struct LogicalDecodingContext *ctx);
|
||||
|
||||
#endif /* OUTPUT_PLUGIN_H */
|
||||
#endif /* OUTPUT_PLUGIN_H */
|
||||
|
@@ -27,4 +27,4 @@ typedef struct PGOutputData
|
||||
List *publications;
|
||||
} PGOutputData;
|
||||
|
||||
#endif /* PGOUTPUT_H */
|
||||
#endif /* PGOUTPUT_H */
|
||||
|
@@ -184,4 +184,4 @@ extern void CheckPointReplicationSlots(void);
|
||||
|
||||
extern void CheckSlotRequirements(void);
|
||||
|
||||
#endif /* SLOT_H */
|
||||
#endif /* SLOT_H */
|
||||
|
@@ -87,4 +87,4 @@ extern void SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn,
|
||||
struct xl_running_xacts *running);
|
||||
extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
|
||||
|
||||
#endif /* SNAPBUILD_H */
|
||||
#endif /* SNAPBUILD_H */
|
||||
|
@@ -94,4 +94,4 @@ extern void syncrep_yyerror(const char *str);
|
||||
extern void syncrep_scanner_init(const char *query_string);
|
||||
extern void syncrep_scanner_finish(void);
|
||||
|
||||
#endif /* _SYNCREP_H */
|
||||
#endif /* _SYNCREP_H */
|
||||
|
@@ -153,7 +153,7 @@ typedef struct
|
||||
struct
|
||||
{
|
||||
uint32 proto_version; /* Logical protocol version */
|
||||
List *publication_names; /* String list of publications */
|
||||
List *publication_names; /* String list of publications */
|
||||
} logical;
|
||||
} proto;
|
||||
} WalRcvStreamOptions;
|
||||
@@ -298,4 +298,4 @@ extern int GetReplicationApplyDelay(void);
|
||||
extern int GetReplicationTransferLatency(void);
|
||||
extern void WalRcvForceReply(void);
|
||||
|
||||
#endif /* _WALRECEIVER_H */
|
||||
#endif /* _WALRECEIVER_H */
|
||||
|
@@ -72,4 +72,4 @@ extern void WalSndRqstFileReload(void);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* _WALSENDER_H */
|
||||
#endif /* _WALSENDER_H */
|
||||
|
@@ -114,4 +114,4 @@ extern void replication_scanner_finish(void);
|
||||
|
||||
extern Node *replication_parse_result;
|
||||
|
||||
#endif /* _WALSENDER_PRIVATE_H */
|
||||
#endif /* _WALSENDER_PRIVATE_H */
|
||||
|
@@ -90,4 +90,4 @@ am_tablesync_worker(void)
|
||||
return OidIsValid(MyLogicalRepWorker->relid);
|
||||
}
|
||||
|
||||
#endif /* WORKER_INTERNAL_H */
|
||||
#endif /* WORKER_INTERNAL_H */
|
||||
|
Reference in New Issue
Block a user