1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-29 22:49:41 +03:00

Add trailing commas to enum definitions

Since C99, there can be a trailing comma after the last value in an
enum definition.  A lot of new code has been introducing this style on
the fly.  Some new patches are now taking an inconsistent approach to
this.  Some add the last comma on the fly if they add a new last
value, some are trying to preserve the existing style in each place,
some are even dropping the last comma if there was one.  We could
nudge this all in a consistent direction if we just add the trailing
commas everywhere once.

I omitted a few places where there was a fixed "last" value that will
always stay last.  I also skipped the header files of libpq and ecpg,
in case people want to use those with older compilers.  There were
also a small number of cases where the enum type wasn't used anywhere
(but the enum values were), which ended up confusing pgindent a bit,
so I left those alone.

Discussion: https://www.postgresql.org/message-id/flat/386f8c45-c8ac-4681-8add-e3b0852c1620%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2023-10-26 09:16:25 +02:00
parent f0efa5aec1
commit 611806cd72
212 changed files with 390 additions and 390 deletions

View File

@@ -74,7 +74,7 @@ typedef enum LogicalRepMsgType
LOGICAL_REP_MSG_STREAM_STOP = 'E',
LOGICAL_REP_MSG_STREAM_COMMIT = 'c',
LOGICAL_REP_MSG_STREAM_ABORT = 'A',
LOGICAL_REP_MSG_STREAM_PREPARE = 'p'
LOGICAL_REP_MSG_STREAM_PREPARE = 'p',
} LogicalRepMsgType;
/*

View File

@@ -17,7 +17,7 @@ struct OutputPluginCallbacks;
typedef enum OutputPluginOutputType
{
OUTPUT_PLUGIN_BINARY_OUTPUT,
OUTPUT_PLUGIN_TEXTUAL_OUTPUT
OUTPUT_PLUGIN_TEXTUAL_OUTPUT,
} OutputPluginOutputType;
/*

View File

@@ -25,7 +25,7 @@ extern PGDLLIMPORT int debug_logical_replication_streaming;
typedef enum
{
DEBUG_LOGICAL_REP_STREAMING_BUFFERED,
DEBUG_LOGICAL_REP_STREAMING_IMMEDIATE
DEBUG_LOGICAL_REP_STREAMING_IMMEDIATE,
} DebugLogicalRepStreamingMode;
/* an individual tuple, stored in one chunk of memory */
@@ -73,7 +73,7 @@ typedef enum ReorderBufferChangeType
REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT,
REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM,
REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT,
REORDER_BUFFER_CHANGE_TRUNCATE
REORDER_BUFFER_CHANGE_TRUNCATE,
} ReorderBufferChangeType;
/* forward declaration */

View File

@@ -34,7 +34,7 @@ typedef enum ReplicationSlotPersistency
{
RS_PERSISTENT,
RS_EPHEMERAL,
RS_TEMPORARY
RS_TEMPORARY,
} ReplicationSlotPersistency;
/*

View File

@@ -43,7 +43,7 @@ typedef enum
* were running at that point finished. Till we reach that we hold off
* calling any commit callbacks.
*/
SNAPBUILD_CONSISTENT = 2
SNAPBUILD_CONSISTENT = 2,
} SnapBuildState;
/* forward declare so we don't have to expose the struct to the public */

View File

@@ -52,7 +52,7 @@ typedef enum
WALRCV_STREAMING, /* walreceiver is streaming */
WALRCV_WAITING, /* stopped streaming, waiting for orders */
WALRCV_RESTARTING, /* asked to restart streaming */
WALRCV_STOPPING /* requested to stop, but still running */
WALRCV_STOPPING, /* requested to stop, but still running */
} WalRcvState;
/* Shared memory area for management of walreceiver process */
@@ -207,7 +207,7 @@ typedef enum
WALRCV_OK_TUPLES, /* Query returned tuples. */
WALRCV_OK_COPY_IN, /* Query started COPY FROM. */
WALRCV_OK_COPY_OUT, /* Query started COPY TO. */
WALRCV_OK_COPY_BOTH /* Query started COPY BOTH replication
WALRCV_OK_COPY_BOTH, /* Query started COPY BOTH replication
* protocol. */
} WalRcvExecStatus;

View File

@@ -21,7 +21,7 @@ typedef enum
{
CRS_EXPORT_SNAPSHOT,
CRS_NOEXPORT_SNAPSHOT,
CRS_USE_SNAPSHOT
CRS_USE_SNAPSHOT,
} CRSSnapshotAction;
/* global state */

View File

@@ -28,7 +28,7 @@ typedef enum WalSndState
WALSNDSTATE_BACKUP,
WALSNDSTATE_CATCHUP,
WALSNDSTATE_STREAMING,
WALSNDSTATE_STOPPING
WALSNDSTATE_STOPPING,
} WalSndState;
/*

View File

@@ -33,7 +33,7 @@ typedef enum LogicalRepWorkerType
WORKERTYPE_UNKNOWN = 0,
WORKERTYPE_TABLESYNC,
WORKERTYPE_APPLY,
WORKERTYPE_PARALLEL_APPLY
WORKERTYPE_PARALLEL_APPLY,
} LogicalRepWorkerType;
typedef struct LogicalRepWorker
@@ -106,7 +106,7 @@ typedef enum ParallelTransState
{
PARALLEL_TRANS_UNKNOWN,
PARALLEL_TRANS_STARTED,
PARALLEL_TRANS_FINISHED
PARALLEL_TRANS_FINISHED,
} ParallelTransState;
/*
@@ -130,7 +130,7 @@ typedef enum PartialFileSetState
FS_EMPTY,
FS_SERIALIZE_IN_PROGRESS,
FS_SERIALIZE_DONE,
FS_READY
FS_READY,
} PartialFileSetState;
/*