Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit611806c

Browse files
committed
Add trailing commas to enum definitions
Since C99, there can be a trailing comma after the last value in anenum definition. A lot of new code has been introducing this style onthe fly. Some new patches are now taking an inconsistent approach tothis. Some add the last comma on the fly if they add a new lastvalue, some are trying to preserve the existing style in each place,some are even dropping the last comma if there was one. We couldnudge this all in a consistent direction if we just add the trailingcommas everywhere once.I omitted a few places where there was a fixed "last" value that willalways stay last. I also skipped the header files of libpq and ecpg,in case people want to use those with older compilers. There werealso 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
1 parentf0efa5a commit611806c

File tree

212 files changed

+390
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+390
-390
lines changed

‎contrib/amcheck/verify_heapam.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ typedef enum XidBoundsViolation
4343
XID_IN_FUTURE,
4444
XID_PRECEDES_CLUSTERMIN,
4545
XID_PRECEDES_RELMIN,
46-
XID_BOUNDS_OK
46+
XID_BOUNDS_OK,
4747
}XidBoundsViolation;
4848

4949
typedefenumXidCommitStatus
5050
{
5151
XID_COMMITTED,
5252
XID_IS_CURRENT_XID,
5353
XID_IN_PROGRESS,
54-
XID_ABORTED
54+
XID_ABORTED,
5555
}XidCommitStatus;
5656

5757
typedefenumSkipPages
5858
{
5959
SKIP_PAGES_ALL_FROZEN,
6060
SKIP_PAGES_ALL_VISIBLE,
61-
SKIP_PAGES_NONE
61+
SKIP_PAGES_NONE,
6262
}SkipPages;
6363

6464
/*

‎contrib/btree_gist/btree_gist.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum gbtree_type
3535
gbt_t_bool,
3636
gbt_t_inet,
3737
gbt_t_uuid,
38-
gbt_t_enum
38+
gbt_t_enum,
3939
};
4040

4141
#endif

‎contrib/pg_prewarm/pg_prewarm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef enum
3333
{
3434
PREWARM_PREFETCH,
3535
PREWARM_READ,
36-
PREWARM_BUFFER
36+
PREWARM_BUFFER,
3737
}PrewarmType;
3838

3939
staticPGIOAlignedBlockblockbuffer;

‎contrib/pg_stat_statements/pg_stat_statements.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ typedef enum pgssVersion
118118
PGSS_V1_8,
119119
PGSS_V1_9,
120120
PGSS_V1_10,
121-
PGSS_V1_11
121+
PGSS_V1_11,
122122
}pgssVersion;
123123

124124
typedefenumpgssStoreKind
@@ -282,7 +282,7 @@ typedef enum
282282
{
283283
PGSS_TRACK_NONE,/* track no statements */
284284
PGSS_TRACK_TOP,/* only top level statements */
285-
PGSS_TRACK_ALL/* all statements, including nested ones */
285+
PGSS_TRACK_ALL,/* all statements, including nested ones */
286286
}PGSSTrackLevel;
287287

288288
staticconststructconfig_enum_entrytrack_options[]=

‎contrib/pg_surgery/heap_surgery.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PG_MODULE_MAGIC;
2929
typedefenumHeapTupleForceOption
3030
{
3131
HEAP_FORCE_KILL,
32-
HEAP_FORCE_FREEZE
32+
HEAP_FORCE_FREEZE,
3333
}HeapTupleForceOption;
3434

3535
PG_FUNCTION_INFO_V1(heap_force_kill);

‎contrib/pgcrypto/pgp.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum PGP_S2K_TYPE
3838
{
3939
PGP_S2K_SIMPLE=0,
4040
PGP_S2K_SALTED=1,
41-
PGP_S2K_ISALTED=3
41+
PGP_S2K_ISALTED=3,
4242
};
4343

4444
enumPGP_PKT_TYPE
@@ -60,7 +60,7 @@ enum PGP_PKT_TYPE
6060
PGP_PKT_USER_ATTR=17,
6161
PGP_PKT_SYMENCRYPTED_DATA_MDC=18,
6262
PGP_PKT_MDC=19,
63-
PGP_PKT_PRIV_61=61/* occurs in gpg secring */
63+
PGP_PKT_PRIV_61=61,/* occurs in gpg secring */
6464
};
6565

6666
enumPGP_PUB_ALGO_TYPE
@@ -69,7 +69,7 @@ enum PGP_PUB_ALGO_TYPE
6969
PGP_PUB_RSA_ENCRYPT=2,
7070
PGP_PUB_RSA_SIGN=3,
7171
PGP_PUB_ELG_ENCRYPT=16,
72-
PGP_PUB_DSA_SIGN=17
72+
PGP_PUB_DSA_SIGN=17,
7373
};
7474

7575
enumPGP_SYMENC_TYPE
@@ -84,15 +84,15 @@ enum PGP_SYMENC_TYPE
8484
PGP_SYM_AES_128=7,/* should */
8585
PGP_SYM_AES_192=8,
8686
PGP_SYM_AES_256=9,
87-
PGP_SYM_TWOFISH=10
87+
PGP_SYM_TWOFISH=10,
8888
};
8989

9090
enumPGP_COMPR_TYPE
9191
{
9292
PGP_COMPR_NONE=0,/* must */
9393
PGP_COMPR_ZIP=1,/* should */
9494
PGP_COMPR_ZLIB=2,
95-
PGP_COMPR_BZIP2=3
95+
PGP_COMPR_BZIP2=3,
9696
};
9797

9898
enumPGP_DIGEST_TYPE
@@ -106,7 +106,7 @@ enum PGP_DIGEST_TYPE
106106
PGP_DIGEST_HAVAL5_160=7,/* obsolete */
107107
PGP_DIGEST_SHA256=8,
108108
PGP_DIGEST_SHA384=9,
109-
PGP_DIGEST_SHA512=10
109+
PGP_DIGEST_SHA512=10,
110110
};
111111

112112
#definePGP_MAX_KEY (256/8)

‎contrib/postgres_fdw/deparse.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ typedef enum
8383
* it has default collation that is not
8484
* traceable to a foreign Var */
8585
FDW_COLLATE_SAFE,/* collation derives from a foreign Var */
86-
FDW_COLLATE_UNSAFE/* collation is non-default and derives from
86+
FDW_COLLATE_UNSAFE,/* collation is non-default and derives from
8787
* something other than a foreign Var */
8888
}FDWCollateState;
8989

‎contrib/postgres_fdw/postgres_fdw.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ enum FdwScanPrivateIndex
8282
* String describing join i.e. names of relations being joined and types
8383
* of join, added when the scan is join
8484
*/
85-
FdwScanPrivateRelations
85+
FdwScanPrivateRelations,
8686
};
8787

8888
/*
@@ -108,7 +108,7 @@ enum FdwModifyPrivateIndex
108108
/* has-returning flag (as a Boolean node) */
109109
FdwModifyPrivateHasReturning,
110110
/* Integer list of attribute numbers retrieved by RETURNING */
111-
FdwModifyPrivateRetrievedAttrs
111+
FdwModifyPrivateRetrievedAttrs,
112112
};
113113

114114
/*
@@ -129,7 +129,7 @@ enum FdwDirectModifyPrivateIndex
129129
/* Integer list of attribute numbers retrieved by RETURNING */
130130
FdwDirectModifyPrivateRetrievedAttrs,
131131
/* set-processed flag (as a Boolean node) */
132-
FdwDirectModifyPrivateSetProcessed
132+
FdwDirectModifyPrivateSetProcessed,
133133
};
134134

135135
/*
@@ -285,7 +285,7 @@ enum FdwPathPrivateIndex
285285
/* has-final-sort flag (as a Boolean node) */
286286
FdwPathPrivateHasFinalSort,
287287
/* has-limit flag (as a Boolean node) */
288-
FdwPathPrivateHasLimit
288+
FdwPathPrivateHasLimit,
289289
};
290290

291291
/* Struct for extra information passed to estimate_path_cost_size() */

‎contrib/postgres_fdw/postgres_fdw.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ typedef enum PgFdwSamplingMethod
143143
ANALYZE_SAMPLE_AUTO,/* choose by server version */
144144
ANALYZE_SAMPLE_RANDOM,/* remote random() */
145145
ANALYZE_SAMPLE_SYSTEM,/* TABLESAMPLE system */
146-
ANALYZE_SAMPLE_BERNOULLI/* TABLESAMPLE bernoulli */
146+
ANALYZE_SAMPLE_BERNOULLI,/* TABLESAMPLE bernoulli */
147147
}PgFdwSamplingMethod;
148148

149149
/* in postgres_fdw.c */

‎contrib/vacuumlo/vacuumlo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum trivalue
3535
{
3636
TRI_DEFAULT,
3737
TRI_NO,
38-
TRI_YES
38+
TRI_YES,
3939
};
4040

4141
struct_param

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp