summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorPeter Eisentraut2023-10-26 07:16:25 +0000
committerPeter Eisentraut2023-10-26 07:20:54 +0000
commit611806cd726fc92989ac918eac48fd8d684869c7 (patch)
tree4ed4dc6fc9a1c5825bf42072e28312440484db28 /src/include/utils
parentf0efa5aec19358e2282d4968a03db1db56f0ac3f (diff)
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
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/acl.h4
-rw-r--r--src/include/utils/backend_progress.h2
-rw-r--r--src/include/utils/backend_status.h2
-rw-r--r--src/include/utils/bytea.h2
-rw-r--r--src/include/utils/elog.h2
-rw-r--r--src/include/utils/guc.h6
-rw-r--r--src/include/utils/guc_tables.h6
-rw-r--r--src/include/utils/hsearch.h2
-rw-r--r--src/include/utils/jsonb.h4
-rw-r--r--src/include/utils/lsyscache.h2
-rw-r--r--src/include/utils/memutils_internal.h2
-rw-r--r--src/include/utils/plancache.h2
-rw-r--r--src/include/utils/portal.h4
-rw-r--r--src/include/utils/queryenvironment.h2
-rw-r--r--src/include/utils/rel.h4
-rw-r--r--src/include/utils/relcache.h2
-rw-r--r--src/include/utils/resowner.h2
-rw-r--r--src/include/utils/rls.h2
-rw-r--r--src/include/utils/snapshot.h2
-rw-r--r--src/include/utils/syscache.h2
-rw-r--r--src/include/utils/timeout.h2
-rw-r--r--src/include/utils/tuplesort.h4
-rw-r--r--src/include/utils/wait_event.h2
-rw-r--r--src/include/utils/xml.h6
24 files changed, 35 insertions, 35 deletions
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 02bc4d08d6c..17f5bfcb5d9 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -173,7 +173,7 @@ typedef struct ArrayType Acl;
typedef enum
{
ACLMASK_ALL, /* normal case: compute all bits */
- ACLMASK_ANY /* return when result is known nonzero */
+ ACLMASK_ANY, /* return when result is known nonzero */
} AclMaskHow;
/* result codes for pg_*_aclcheck */
@@ -181,7 +181,7 @@ typedef enum
{
ACLCHECK_OK = 0,
ACLCHECK_NO_PRIV,
- ACLCHECK_NOT_OWNER
+ ACLCHECK_NOT_OWNER,
} AclResult;
diff --git a/src/include/utils/backend_progress.h b/src/include/utils/backend_progress.h
index 70dea55fc00..3740523b5c5 100644
--- a/src/include/utils/backend_progress.h
+++ b/src/include/utils/backend_progress.h
@@ -27,7 +27,7 @@ typedef enum ProgressCommandType
PROGRESS_COMMAND_CLUSTER,
PROGRESS_COMMAND_CREATE_INDEX,
PROGRESS_COMMAND_BASEBACKUP,
- PROGRESS_COMMAND_COPY
+ PROGRESS_COMMAND_COPY,
} ProgressCommandType;
#define PGSTAT_NUM_PROGRESS_PARAM 20
diff --git a/src/include/utils/backend_status.h b/src/include/utils/backend_status.h
index d51c840dafb..75fc18c4327 100644
--- a/src/include/utils/backend_status.h
+++ b/src/include/utils/backend_status.h
@@ -29,7 +29,7 @@ typedef enum BackendState
STATE_IDLEINTRANSACTION,
STATE_FASTPATH,
STATE_IDLEINTRANSACTION_ABORTED,
- STATE_DISABLED
+ STATE_DISABLED,
} BackendState;
diff --git a/src/include/utils/bytea.h b/src/include/utils/bytea.h
index 166dd0366e6..58f69f0538a 100644
--- a/src/include/utils/bytea.h
+++ b/src/include/utils/bytea.h
@@ -19,7 +19,7 @@
typedef enum
{
BYTEA_OUTPUT_ESCAPE,
- BYTEA_OUTPUT_HEX
+ BYTEA_OUTPUT_HEX,
} ByteaOutputType;
extern PGDLLIMPORT int bytea_output; /* ByteaOutputType, but int for GUC
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 0292e88b4f2..0971d5ce334 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -492,7 +492,7 @@ typedef enum
{
PGERROR_TERSE, /* single-line error messages */
PGERROR_DEFAULT, /* recommended style */
- PGERROR_VERBOSE /* all the facts, ma'am */
+ PGERROR_VERBOSE, /* all the facts, ma'am */
} PGErrorVerbosity;
extern PGDLLIMPORT int Log_error_verbosity;
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 902e57c0ca3..20fe13702b1 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -72,7 +72,7 @@ typedef enum
PGC_SU_BACKEND,
PGC_BACKEND,
PGC_SUSET,
- PGC_USERSET
+ PGC_USERSET,
} GucContext;
/*
@@ -119,7 +119,7 @@ typedef enum
PGC_S_OVERRIDE, /* special case to forcibly set default */
PGC_S_INTERACTIVE, /* dividing line for error reporting */
PGC_S_TEST, /* test per-database or per-user setting */
- PGC_S_SESSION /* SET command */
+ PGC_S_SESSION, /* SET command */
} GucSource;
/*
@@ -196,7 +196,7 @@ typedef enum
/* Types of set_config_option actions */
GUC_ACTION_SET, /* regular SET command */
GUC_ACTION_LOCAL, /* SET LOCAL command */
- GUC_ACTION_SAVE /* function SET option, or temp assignment */
+ GUC_ACTION_SAVE, /* function SET option, or temp assignment */
} GucAction;
#define GUC_QUALIFIER_SEPARATOR '.'
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index d5a08806782..1ec95755700 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -26,7 +26,7 @@ enum config_type
PGC_INT,
PGC_REAL,
PGC_STRING,
- PGC_ENUM
+ PGC_ENUM,
};
union config_var_val
@@ -97,7 +97,7 @@ enum config_group
ERROR_HANDLING_OPTIONS,
PRESET_OPTIONS,
CUSTOM_OPTIONS,
- DEVELOPER_OPTIONS
+ DEVELOPER_OPTIONS,
};
/*
@@ -110,7 +110,7 @@ typedef enum
GUC_SAVE, /* entry caused by function SET option */
GUC_SET, /* entry caused by plain SET command */
GUC_LOCAL, /* entry caused by SET LOCAL command */
- GUC_SET_LOCAL /* entry caused by SET then SET LOCAL */
+ GUC_SET_LOCAL, /* entry caused by SET then SET LOCAL */
} GucStackState;
typedef struct guc_stack
diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h
index bc3d5efa963..b5ed173e33b 100644
--- a/src/include/utils/hsearch.h
+++ b/src/include/utils/hsearch.h
@@ -113,7 +113,7 @@ typedef enum
HASH_FIND,
HASH_ENTER,
HASH_REMOVE,
- HASH_ENTER_NULL
+ HASH_ENTER_NULL,
} HASHACTION;
/* hash_seq status (should be considered an opaque type by callers) */
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index e62a5f2f442..addc9b608e2 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -26,7 +26,7 @@ typedef enum
WJB_BEGIN_ARRAY,
WJB_END_ARRAY,
WJB_BEGIN_OBJECT,
- WJB_END_OBJECT
+ WJB_END_OBJECT,
} JsonbIteratorToken;
/* Strategy numbers for GIN index opclasses */
@@ -335,7 +335,7 @@ typedef enum
JBI_ARRAY_ELEM,
JBI_OBJECT_START,
JBI_OBJECT_KEY,
- JBI_OBJECT_VALUE
+ JBI_OBJECT_VALUE,
} JsonbIterState;
typedef struct JsonbIterator
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index f5fdbfe116b..c22cabdf42e 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -35,7 +35,7 @@ typedef enum IOFuncSelector
IOFunc_input,
IOFunc_output,
IOFunc_receive,
- IOFunc_send
+ IOFunc_send,
} IOFuncSelector;
/* Flag bits for get_attstatsslot */
diff --git a/src/include/utils/memutils_internal.h b/src/include/utils/memutils_internal.h
index 2d107bbf9d4..a6574301753 100644
--- a/src/include/utils/memutils_internal.h
+++ b/src/include/utils/memutils_internal.h
@@ -111,7 +111,7 @@ typedef enum MemoryContextMethodID
MCTX_GENERATION_ID,
MCTX_SLAB_ID,
MCTX_ALIGNED_REDIRECT_ID,
- MCTX_UNUSED4_ID /* 111 occurs in wipe_mem'd memory */
+ MCTX_UNUSED4_ID, /* 111 occurs in wipe_mem'd memory */
} MemoryContextMethodID;
/*
diff --git a/src/include/utils/plancache.h b/src/include/utils/plancache.h
index 916e59d9fef..97e58157b7c 100644
--- a/src/include/utils/plancache.h
+++ b/src/include/utils/plancache.h
@@ -31,7 +31,7 @@ typedef enum
{
PLAN_CACHE_MODE_AUTO,
PLAN_CACHE_MODE_FORCE_GENERIC_PLAN,
- PLAN_CACHE_MODE_FORCE_CUSTOM_PLAN
+ PLAN_CACHE_MODE_FORCE_CUSTOM_PLAN,
} PlanCacheMode;
/* GUC parameter */
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index aa08b1e0fca..8b4471cbe53 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -92,7 +92,7 @@ typedef enum PortalStrategy
PORTAL_ONE_RETURNING,
PORTAL_ONE_MOD_WITH,
PORTAL_UTIL_SELECT,
- PORTAL_MULTI_QUERY
+ PORTAL_MULTI_QUERY,
} PortalStrategy;
/*
@@ -107,7 +107,7 @@ typedef enum PortalStatus
PORTAL_READY, /* PortalStart complete, can run it */
PORTAL_ACTIVE, /* portal is running (can't delete it) */
PORTAL_DONE, /* portal is finished (don't re-run it) */
- PORTAL_FAILED /* portal got error (can't re-run it) */
+ PORTAL_FAILED, /* portal got error (can't re-run it) */
} PortalStatus;
typedef struct PortalData *Portal;
diff --git a/src/include/utils/queryenvironment.h b/src/include/utils/queryenvironment.h
index 532219ade23..5587064a180 100644
--- a/src/include/utils/queryenvironment.h
+++ b/src/include/utils/queryenvironment.h
@@ -19,7 +19,7 @@
typedef enum EphemeralNameRelationType
{
- ENR_NAMED_TUPLESTORE /* named tuplestore relation; e.g., deltas */
+ ENR_NAMED_TUPLESTORE, /* named tuplestore relation; e.g., deltas */
} EphemeralNameRelationType;
/*
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 1426a353cd0..0ad613c4b88 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -329,7 +329,7 @@ typedef enum StdRdOptIndexCleanup
{
STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO = 0,
STDRD_OPTION_VACUUM_INDEX_CLEANUP_OFF,
- STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON
+ STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON,
} StdRdOptIndexCleanup;
typedef struct StdRdOptions
@@ -402,7 +402,7 @@ typedef enum ViewOptCheckOption
{
VIEW_OPTION_CHECK_OPTION_NOT_SET,
VIEW_OPTION_CHECK_OPTION_LOCAL,
- VIEW_OPTION_CHECK_OPTION_CASCADED
+ VIEW_OPTION_CHECK_OPTION_CASCADED,
} ViewOptCheckOption;
/*
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index b0955c0e623..f04b2477e34 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -62,7 +62,7 @@ typedef enum IndexAttrBitmapKind
INDEX_ATTR_BITMAP_PRIMARY_KEY,
INDEX_ATTR_BITMAP_IDENTITY_KEY,
INDEX_ATTR_BITMAP_HOT_BLOCKING,
- INDEX_ATTR_BITMAP_SUMMARIZED
+ INDEX_ATTR_BITMAP_SUMMARIZED,
} IndexAttrBitmapKind;
extern Bitmapset *RelationGetIndexAttrBitmap(Relation relation,
diff --git a/src/include/utils/resowner.h b/src/include/utils/resowner.h
index cd070b6080e..cb35e9e0904 100644
--- a/src/include/utils/resowner.h
+++ b/src/include/utils/resowner.h
@@ -47,7 +47,7 @@ typedef enum
{
RESOURCE_RELEASE_BEFORE_LOCKS,
RESOURCE_RELEASE_LOCKS,
- RESOURCE_RELEASE_AFTER_LOCKS
+ RESOURCE_RELEASE_AFTER_LOCKS,
} ResourceReleasePhase;
/*
diff --git a/src/include/utils/rls.h b/src/include/utils/rls.h
index 1e95f83ef35..08c68be1eaf 100644
--- a/src/include/utils/rls.h
+++ b/src/include/utils/rls.h
@@ -42,7 +42,7 @@ enum CheckEnableRlsResult
{
RLS_NONE,
RLS_NONE_ENV,
- RLS_ENABLED
+ RLS_ENABLED,
};
extern int check_enable_rls(Oid relid, Oid checkAsUser, bool noError);
diff --git a/src/include/utils/snapshot.h b/src/include/utils/snapshot.h
index 583a667a40a..cd9c2e6c3b6 100644
--- a/src/include/utils/snapshot.h
+++ b/src/include/utils/snapshot.h
@@ -115,7 +115,7 @@ typedef enum SnapshotType
* For visibility checks snapshot->min must have been set up with the xmin
* horizon to use.
*/
- SNAPSHOT_NON_VACUUMABLE
+ SNAPSHOT_NON_VACUUMABLE,
} SnapshotType;
typedef struct SnapshotData *Snapshot;
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 67ea6e49452..5d47a652cc1 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -113,7 +113,7 @@ enum SysCacheIdentifier
TYPENAMENSP,
TYPEOID,
USERMAPPINGOID,
- USERMAPPINGUSERSERVER
+ USERMAPPINGUSERSERVER,
#define SysCacheSize (USERMAPPINGUSERSERVER + 1)
};
diff --git a/src/include/utils/timeout.h b/src/include/utils/timeout.h
index e561a1cde92..8a618533714 100644
--- a/src/include/utils/timeout.h
+++ b/src/include/utils/timeout.h
@@ -51,7 +51,7 @@ typedef enum TimeoutType
{
TMPARAM_AFTER,
TMPARAM_AT,
- TMPARAM_EVERY
+ TMPARAM_EVERY,
} TimeoutType;
typedef struct
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index 3a49a6d2d4d..9ed2de76cd6 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -77,7 +77,7 @@ typedef enum
SORT_TYPE_TOP_N_HEAPSORT = 1 << 0,
SORT_TYPE_QUICKSORT = 1 << 1,
SORT_TYPE_EXTERNAL_SORT = 1 << 2,
- SORT_TYPE_EXTERNAL_MERGE = 1 << 3
+ SORT_TYPE_EXTERNAL_MERGE = 1 << 3,
} TuplesortMethod;
#define NUM_TUPLESORTMETHODS 4
@@ -85,7 +85,7 @@ typedef enum
typedef enum
{
SORT_SPACE_TYPE_DISK,
- SORT_SPACE_TYPE_MEMORY
+ SORT_SPACE_TYPE_MEMORY,
} TuplesortSpaceType;
/* Bitwise option flags for tuple sorts */
diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h
index 009b03a520a..00f7d620e75 100644
--- a/src/include/utils/wait_event.h
+++ b/src/include/utils/wait_event.h
@@ -56,7 +56,7 @@ extern PGDLLIMPORT uint32 *my_wait_event_info;
typedef enum
{
WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION,
- WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED
+ WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED,
} WaitEventExtension;
extern void WaitEventExtensionShmemInit(void);
diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h
index 224f6d75ffd..50f12875543 100644
--- a/src/include/utils/xml.h
+++ b/src/include/utils/xml.h
@@ -27,13 +27,13 @@ typedef enum
XML_STANDALONE_YES,
XML_STANDALONE_NO,
XML_STANDALONE_NO_VALUE,
- XML_STANDALONE_OMITTED
+ XML_STANDALONE_OMITTED,
} XmlStandaloneType;
typedef enum
{
XMLBINARY_BASE64,
- XMLBINARY_HEX
+ XMLBINARY_HEX,
} XmlBinaryType;
typedef enum
@@ -41,7 +41,7 @@ typedef enum
PG_XML_STRICTNESS_LEGACY, /* ignore errors unless function result
* indicates error condition */
PG_XML_STRICTNESS_WELLFORMED, /* ignore non-parser messages */
- PG_XML_STRICTNESS_ALL /* report all notices/warnings/errors */
+ PG_XML_STRICTNESS_ALL, /* report all notices/warnings/errors */
} PgXmlStrictness;
/* struct PgXmlErrorContext is private to xml.c */