1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +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

@@ -75,7 +75,7 @@ typedef enum
GIST_BUFFERING_STATS, /* gathering statistics of index tuple size
* before switching to the buffering build
* mode */
GIST_BUFFERING_ACTIVE /* in buffering build mode */
GIST_BUFFERING_ACTIVE, /* in buffering build mode */
} GistBuildMode;
/* Working state for gistbuild and its callback */

View File

@@ -135,7 +135,7 @@ typedef enum
VACUUM_ERRCB_PHASE_VACUUM_INDEX,
VACUUM_ERRCB_PHASE_VACUUM_HEAP,
VACUUM_ERRCB_PHASE_INDEX_CLEANUP,
VACUUM_ERRCB_PHASE_TRUNCATE
VACUUM_ERRCB_PHASE_TRUNCATE,
} VacErrPhase;
typedef struct LVRelState

View File

@@ -56,7 +56,7 @@ typedef enum
BTPARALLEL_NOT_INITIALIZED,
BTPARALLEL_ADVANCING,
BTPARALLEL_IDLE,
BTPARALLEL_DONE
BTPARALLEL_DONE,
} BTPS_State;
/*

View File

@@ -22,7 +22,7 @@ typedef enum
/* strategy for searching through materialized list of split points */
SPLIT_DEFAULT, /* give some weight to truncation */
SPLIT_MANY_DUPLICATES, /* find minimally distinguishing point */
SPLIT_SINGLE_VALUE /* leave left page almost full */
SPLIT_SINGLE_VALUE, /* leave left page almost full */
} FindSplitStrat;
typedef struct

View File

@@ -756,7 +756,7 @@ enum SpGistSpecialOffsetNumbers
{
SpGistBreakOffsetNumber = InvalidOffsetNumber,
SpGistRedirectOffsetNumber = MaxOffsetNumber + 1,
SpGistErrorOffsetNumber = MaxOffsetNumber + 2
SpGistErrorOffsetNumber = MaxOffsetNumber + 2,
};
static OffsetNumber

View File

@@ -128,7 +128,7 @@ typedef enum
SLRU_READ_FAILED,
SLRU_WRITE_FAILED,
SLRU_FSYNC_FAILED,
SLRU_CLOSE_FAILED
SLRU_CLOSE_FAILED,
} SlruErrorCause;
static SlruErrorCause slru_errcause;

View File

@@ -145,7 +145,7 @@ typedef enum TransState
TRANS_INPROGRESS, /* inside a valid transaction */
TRANS_COMMIT, /* commit in progress */
TRANS_ABORT, /* abort in progress */
TRANS_PREPARE /* prepare in progress */
TRANS_PREPARE, /* prepare in progress */
} TransState;
/*
@@ -180,7 +180,7 @@ typedef enum TBlockState
TBLOCK_SUBABORT_END, /* failed subxact, ROLLBACK received */
TBLOCK_SUBABORT_PENDING, /* live subxact, ROLLBACK received */
TBLOCK_SUBRESTART, /* live subxact, ROLLBACK TO received */
TBLOCK_SUBABORT_RESTART /* failed subxact, ROLLBACK TO received */
TBLOCK_SUBABORT_RESTART, /* failed subxact, ROLLBACK TO received */
} TBlockState;
/*

View File

@@ -88,7 +88,7 @@ typedef enum
{
LRQ_NEXT_NO_IO,
LRQ_NEXT_IO,
LRQ_NEXT_AGAIN
LRQ_NEXT_AGAIN,
} LsnReadQueueNextStatus;
/*

View File

@@ -211,7 +211,7 @@ typedef enum
XLOG_FROM_ANY = 0, /* request to read WAL from any source */
XLOG_FROM_ARCHIVE, /* restored using restore_command */
XLOG_FROM_PG_WAL, /* existing file in pg_wal */
XLOG_FROM_STREAM /* streamed from primary */
XLOG_FROM_STREAM, /* streamed from primary */
} XLogSource;
/* human-readable names for XLogSources, for debugging output */