diff options
| author | Peter Eisentraut | 2023-10-26 07:16:25 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2023-10-26 07:20:54 +0000 |
| commit | 611806cd726fc92989ac918eac48fd8d684869c7 (patch) | |
| tree | 4ed4dc6fc9a1c5825bf42072e28312440484db28 /src/pl | |
| parent | f0efa5aec19358e2282d4968a03db1db56f0ac3f (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/pl')
| -rw-r--r-- | src/pl/plpgsql/src/plpgsql.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h index 2b4bcd1dbee..9f0a9121150 100644 --- a/src/pl/plpgsql/src/plpgsql.h +++ b/src/pl/plpgsql/src/plpgsql.h @@ -42,7 +42,7 @@ typedef enum PLpgSQL_nsitem_type { PLPGSQL_NSTYPE_LABEL, /* block label */ PLPGSQL_NSTYPE_VAR, /* scalar variable */ - PLPGSQL_NSTYPE_REC /* composite variable */ + PLPGSQL_NSTYPE_REC, /* composite variable */ } PLpgSQL_nsitem_type; /* @@ -52,7 +52,7 @@ typedef enum PLpgSQL_label_type { PLPGSQL_LABEL_BLOCK, /* DECLARE/BEGIN block */ PLPGSQL_LABEL_LOOP, /* looping construct */ - PLPGSQL_LABEL_OTHER /* anything else */ + PLPGSQL_LABEL_OTHER, /* anything else */ } PLpgSQL_label_type; /* @@ -64,7 +64,7 @@ typedef enum PLpgSQL_datum_type PLPGSQL_DTYPE_ROW, PLPGSQL_DTYPE_REC, PLPGSQL_DTYPE_RECFIELD, - PLPGSQL_DTYPE_PROMISE + PLPGSQL_DTYPE_PROMISE, } PLpgSQL_datum_type; /* @@ -83,7 +83,7 @@ typedef enum PLpgSQL_promise_type PLPGSQL_PROMISE_TG_NARGS, PLPGSQL_PROMISE_TG_ARGV, PLPGSQL_PROMISE_TG_EVENT, - PLPGSQL_PROMISE_TG_TAG + PLPGSQL_PROMISE_TG_TAG, } PLpgSQL_promise_type; /* @@ -93,7 +93,7 @@ typedef enum PLpgSQL_type_type { PLPGSQL_TTYPE_SCALAR, /* scalar types and domains */ PLPGSQL_TTYPE_REC, /* composite types, including RECORD */ - PLPGSQL_TTYPE_PSEUDO /* pseudotypes */ + PLPGSQL_TTYPE_PSEUDO, /* pseudotypes */ } PLpgSQL_type_type; /* @@ -127,7 +127,7 @@ typedef enum PLpgSQL_stmt_type PLPGSQL_STMT_PERFORM, PLPGSQL_STMT_CALL, PLPGSQL_STMT_COMMIT, - PLPGSQL_STMT_ROLLBACK + PLPGSQL_STMT_ROLLBACK, } PLpgSQL_stmt_type; /* @@ -138,7 +138,7 @@ enum PLPGSQL_RC_OK, PLPGSQL_RC_EXIT, PLPGSQL_RC_RETURN, - PLPGSQL_RC_CONTINUE + PLPGSQL_RC_CONTINUE, }; /* @@ -158,7 +158,7 @@ typedef enum PLpgSQL_getdiag_kind PLPGSQL_GETDIAG_DATATYPE_NAME, PLPGSQL_GETDIAG_MESSAGE_TEXT, PLPGSQL_GETDIAG_TABLE_NAME, - PLPGSQL_GETDIAG_SCHEMA_NAME + PLPGSQL_GETDIAG_SCHEMA_NAME, } PLpgSQL_getdiag_kind; /* @@ -174,7 +174,7 @@ typedef enum PLpgSQL_raise_option_type PLPGSQL_RAISEOPTION_CONSTRAINT, PLPGSQL_RAISEOPTION_DATATYPE, PLPGSQL_RAISEOPTION_TABLE, - PLPGSQL_RAISEOPTION_SCHEMA + PLPGSQL_RAISEOPTION_SCHEMA, } PLpgSQL_raise_option_type; /* @@ -184,7 +184,7 @@ typedef enum PLpgSQL_resolve_option { PLPGSQL_RESOLVE_ERROR, /* throw error if ambiguous */ PLPGSQL_RESOLVE_VARIABLE, /* prefer plpgsql var to table column */ - PLPGSQL_RESOLVE_COLUMN /* prefer table column to plpgsql var */ + PLPGSQL_RESOLVE_COLUMN, /* prefer table column to plpgsql var */ } PLpgSQL_resolve_option; @@ -957,7 +957,7 @@ typedef enum PLpgSQL_trigtype { PLPGSQL_DML_TRIGGER, PLPGSQL_EVENT_TRIGGER, - PLPGSQL_NOT_TRIGGER + PLPGSQL_NOT_TRIGGER, } PLpgSQL_trigtype; /* @@ -1188,7 +1188,7 @@ typedef enum { IDENTIFIER_LOOKUP_NORMAL, /* normal processing of var names */ IDENTIFIER_LOOKUP_DECLARE, /* In DECLARE --- don't look up names */ - IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */ + IDENTIFIER_LOOKUP_EXPR, /* In SQL expression --- special case */ } IdentifierLookup; extern IdentifierLookup plpgsql_IdentifierLookup; |
