diff options
author | Tom Lane | 2017-06-21 19:18:54 +0000 |
---|---|---|
committer | Tom Lane | 2017-06-21 19:19:25 +0000 |
commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
tree | e85979fb1213a731b7b557f8a830df541f26b135 | |
parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) |
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
1107 files changed, 3435 insertions, 3516 deletions
diff --git a/contrib/bloom/bloom.h b/contrib/bloom/bloom.h index 0cfe49aad8..6d1b3f12a3 100644 --- a/contrib/bloom/bloom.h +++ b/contrib/bloom/bloom.h @@ -75,7 +75,7 @@ typedef BloomPageOpaqueData *BloomPageOpaque; /* Preserved page numbers */ #define BLOOM_METAPAGE_BLKNO (0) -#define BLOOM_HEAD_BLKNO (1) /* first data page */ +#define BLOOM_HEAD_BLKNO (1) /* first data page */ /* * We store Bloom signatures as arrays of uint16 words. @@ -101,8 +101,8 @@ typedef struct BloomOptions { int32 vl_len_; /* varlena header (do not touch directly!) */ int bloomLength; /* length of signature in words (not bits!) */ - int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for - * each index key */ + int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each + * index key */ } BloomOptions; /* diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h index 8aab19396c..17561fa9e4 100644 --- a/contrib/btree_gist/btree_utils_num.h +++ b/contrib/btree_gist/btree_utils_num.h @@ -42,13 +42,13 @@ typedef struct /* Methods */ - bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */ - bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */ - bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */ - bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */ - bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */ - int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */ - float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */ + bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */ + bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */ + bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */ + bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */ + bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */ + int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */ + float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */ } gbtree_ninfo; diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c index c531663f92..b2623a9583 100644 --- a/contrib/btree_gist/btree_utils_var.c +++ b/contrib/btree_gist/btree_utils_var.c @@ -488,7 +488,7 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, cur = (char *) DatumGetPointer(entryvec->vector[i].key); ro = gbt_var_key_readable((GBT_VARKEY *) cur); - if (ro.lower == ro.upper) /* leaf */ + if (ro.lower == ro.upper) /* leaf */ { sv[svcntr] = gbt_var_leaf2node((GBT_VARKEY *) cur, tinfo, flinfo); arr[i].t = sv[svcntr]; diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h index 04a356276b..15d847c139 100644 --- a/contrib/btree_gist/btree_utils_var.h +++ b/contrib/btree_gist/btree_utils_var.h @@ -40,7 +40,7 @@ typedef struct bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */ bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */ int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */ - GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */ + GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */ } gbtree_vinfo; diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index e67b8cc989..58a87decc6 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -171,7 +171,7 @@ static double uuid_2_double(const pg_uuid_t *u) { uint64 uu[2]; - const double two64 = 18446744073709551616.0; /* 2^64 */ + const double two64 = 18446744073709551616.0; /* 2^64 */ /* Source data may not be suitably aligned, so copy */ memcpy(uu, u->data, UUID_LEN); diff --git a/contrib/cube/cubedata.h b/contrib/cube/cubedata.h index af02464178..6e6ddfd3d7 100644 --- a/contrib/cube/cubedata.h +++ b/contrib/cube/cubedata.h @@ -54,10 +54,10 @@ typedef struct NDBOX #define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x) /* GiST operator strategy numbers */ -#define CubeKNNDistanceCoord 15 /* ~> */ -#define CubeKNNDistanceTaxicab 16 /* <#> */ -#define CubeKNNDistanceEuclid 17 /* <-> */ -#define CubeKNNDistanceChebyshev 18 /* <=> */ +#define CubeKNNDistanceCoord 15 /* ~> */ +#define CubeKNNDistanceTaxicab 16 /* <#> */ +#define CubeKNNDistanceEuclid 17 /* <-> */ +#define CubeKNNDistanceChebyshev 18 /* <=> */ /* in cubescan.l */ extern int cube_yylex(void); diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index f2182bc3f4..5ec3e794a2 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -67,7 +67,7 @@ typedef struct remoteConn { PGconn *conn; /* Hold the remote connection */ int openCursorCount; /* The number of open cursors */ - bool newXactForCursor; /* Opened a transaction for a cursor */ + bool newXactForCursor; /* Opened a transaction for a cursor */ } remoteConn; typedef struct storeInfo @@ -1098,7 +1098,7 @@ storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql) if (!PQsendQuery(conn, sql)) elog(ERROR, "could not send query: %s", pchomp(PQerrorMessage(conn))); - if (!PQsetSingleRowMode(conn)) /* shouldn't fail */ + if (!PQsetSingleRowMode(conn)) /* shouldn't fail */ elog(ERROR, "failed to set single-row mode for dblink query"); for (;;) diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 277639f6e9..692c7ce5f1 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -544,13 +544,13 @@ fileGetForeignPaths(PlannerInfo *root, */ add_path(baserel, (Path *) create_foreignscan_path(root, baserel, - NULL, /* default pathtarget */ + NULL, /* default pathtarget */ baserel->rows, startup_cost, total_cost, - NIL, /* no pathkeys */ - NULL, /* no outer rel either */ - NULL, /* no extra plan */ + NIL, /* no pathkeys */ + NULL, /* no outer rel either */ + NULL, /* no extra plan */ coptions)); /* diff --git a/contrib/fuzzystrmatch/dmetaphone.c b/contrib/fuzzystrmatch/dmetaphone.c index 4e89983afd..918ee0d90e 100644 --- a/contrib/fuzzystrmatch/dmetaphone.c +++ b/contrib/fuzzystrmatch/dmetaphone.c @@ -111,7 +111,7 @@ The remaining code is authored by Andrew Dunstan <[email protected]> and #include <string.h> #include <stdarg.h> -#endif /* DMETAPHONE_MAIN */ +#endif /* DMETAPHONE_MAIN */ #include <assert.h> #include <ctype.h> @@ -197,7 +197,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS) * in a case like this. */ -#define META_FREE(x) ((void)true) /* pfree((x)) */ +#define META_FREE(x) ((void)true) /* pfree((x)) */ #else /* not defined DMETAPHONE_MAIN */ /* use the standard malloc library when not running in PostgreSQL */ @@ -209,7 +209,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS) (v = (t*)realloc((v),((n)*sizeof(t)))) #define META_FREE(x) free((x)) -#endif /* defined DMETAPHONE_MAIN */ +#endif /* defined DMETAPHONE_MAIN */ @@ -977,7 +977,7 @@ DoubleMetaphone(char *str, char **codes) } } - if (GetAt(original, current + 1) == 'J') /* it could happen! */ + if (GetAt(original, current + 1) == 'J') /* it could happen! */ current += 2; else current += 1; diff --git a/contrib/hstore/hstore.h b/contrib/hstore/hstore.h index 6bab08b7de..c4862a82e1 100644 --- a/contrib/hstore/hstore.h +++ b/contrib/hstore/hstore.h @@ -181,7 +181,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs); #define HStoreExistsStrategyNumber 9 #define HStoreExistsAnyStrategyNumber 10 #define HStoreExistsAllStrategyNumber 11 -#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ +#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ /* * defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names; @@ -202,4 +202,4 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs); extern int no_such_variable #endif -#endif /* __HSTORE_H__ */ +#endif /* __HSTORE_H__ */ diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index 1cecf86004..1dd7c7c9ce 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -829,7 +829,7 @@ hstore_from_record(PG_FUNCTION_ARGS) my_extra->ncolumns = ncolumns; } - Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */ + Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */ pairs = palloc(ncolumns * sizeof(Pairs)); if (rec) diff --git a/contrib/intarray/_int.h b/contrib/intarray/_int.h index d524f0fed5..b689eb7ded 100644 --- a/contrib/intarray/_int.h +++ b/contrib/intarray/_int.h @@ -173,4 +173,4 @@ int compDESC(const void *a, const void *b); (direction) ? compASC : compDESC ); \ } while(0) -#endif /* ___INT_H__ */ +#endif /* ___INT_H__ */ diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c index 3c52912bbf..2fdfd2ec63 100644 --- a/contrib/intarray/_int_tool.c +++ b/contrib/intarray/_int_tool.c @@ -282,7 +282,7 @@ internal_size(int *a, int len) for (i = 0; i < len; i += 2) { - if (!i || a[i] != a[i - 1]) /* do not count repeated range */ + if (!i || a[i] != a[i - 1]) /* do not count repeated range */ size += a[i + 1] - a[i] + 1; } diff --git a/contrib/isn/isn.c b/contrib/isn/isn.c index c3c10e14bc..d018ec6af5 100644 --- a/contrib/isn/isn.c +++ b/contrib/isn/isn.c @@ -131,7 +131,7 @@ invalidindex: elog(DEBUG1, "index %d is invalid", j); return false; } -#endif /* ISN_DEBUG */ +#endif /* ISN_DEBUG */ /*---------------------------------------------------------- * Formatting and conversion routines. @@ -699,11 +699,11 @@ string2ean(const char *str, bool errorOK, ean13 *result, /* recognize and validate the number: */ while (*aux2 && length <= 13) { - last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */ + last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */ digit = (isdigit((unsigned char) *aux2) != 0); /* is current character * a digit? */ - if (*aux2 == '?' && last) /* automagically calculate check digit - * if it's '?' */ + if (*aux2 == '?' && last) /* automagically calculate check digit if + * it's '?' */ magic = digit = true; if (length == 0 && (*aux2 == 'M' || *aux2 == 'm')) { @@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result, goto eanwrongtype; break; case ISMN: - memcpy(buf, "9790", 4); /* this isn't for sure yet, for now - * ISMN it's only 9790 */ + memcpy(buf, "9790", 4); /* this isn't for sure yet, for now ISMN + * it's only 9790 */ valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic)); break; case ISBN: @@ -1123,7 +1123,7 @@ accept_weak_input(PG_FUNCTION_ARGS) g_weak = PG_GETARG_BOOL(0); #else /* function has no effect */ -#endif /* ISN_WEAK_MODE */ +#endif /* ISN_WEAK_MODE */ PG_RETURN_BOOL(g_weak); } diff --git a/contrib/isn/isn.h b/contrib/isn/isn.h index 09dc7c6575..e2c8a26234 100644 --- a/contrib/isn/isn.h +++ b/contrib/isn/isn.h @@ -32,4 +32,4 @@ typedef uint64 ean13; extern void initialize(void); -#endif /* ISN_H */ +#endif /* ISN_H */ diff --git a/contrib/lo/lo.c b/contrib/lo/lo.c index 6bd2430931..4585923ee2 100644 --- a/contrib/lo/lo.c +++ b/contrib/lo/lo.c @@ -32,11 +32,11 @@ lo_manage(PG_FUNCTION_ARGS) HeapTuple newtuple; /* The new value for tuple */ HeapTuple trigtuple; /* The original value of tuple */ - if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ + if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ elog(ERROR, "%s: not fired by trigger manager", trigdata->tg_trigger->tgname); - if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ elog(ERROR, "%s: must be fired for row", trigdata->tg_trigger->tgname); diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h index c604357dbf..7a7a154097 100644 --- a/contrib/ltree/ltree.h +++ b/contrib/ltree/ltree.h @@ -125,7 +125,7 @@ typedef struct #define OPR 3 #define OPEN 4 #define CLOSE 5 -#define VALTRUE 6 /* for stop words */ +#define VALTRUE 6 /* for stop words */ #define VALFALSE 7 diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 033a477c61..37ee3377ff 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -302,7 +302,7 @@ ltree_picksplit(PG_FUNCTION_ARGS) for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j)) { array[j].index = j; - lu = GETENTRY(entryvec, j); /* use as tmp val */ + lu = GETENTRY(entryvec, j); /* use as tmp val */ array[j].r = LTG_GETLNODE(lu); } @@ -312,7 +312,7 @@ ltree_picksplit(PG_FUNCTION_ARGS) lu_l = lu_r = ru_l = ru_r = NULL; for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j)) { - lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */ + lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */ if (j <= (maxoff - FirstOffsetNumber + 1) / 2) { v->spl_left[v->spl_nleft] = array[j].index; diff --git a/contrib/pageinspect/pageinspect.h b/contrib/pageinspect/pageinspect.h index 55ca68fab3..f49cf9e892 100644 --- a/contrib/pageinspect/pageinspect.h +++ b/contrib/pageinspect/pageinspect.h @@ -18,4 +18,4 @@ /* in rawpage.c */ extern Page get_page_from_raw(bytea *raw_page); -#endif /* _PAGEINSPECT_H_ */ +#endif /* _PAGEINSPECT_H_ */ diff --git a/contrib/pg_buffercache/pg_buffercache_pages.c b/contrib/pg_buffercache/pg_buffercache_pages.c index 8bebf2384d..b410aafa5a 100644 --- a/contrib/pg_buffercache/pg_buffercache_pages.c +++ b/contrib/pg_buffercache/pg_buffercache_pages.c @@ -66,7 +66,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS) FuncCallContext *funcctx; Datum result; MemoryContext oldcontext; - BufferCachePagesContext *fctx; /* User function context. */ + BufferCachePagesContext *fctx; /* User function context. */ TupleDesc tupledesc; TupleDesc expected_tupledesc; HeapTuple tuple; diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c index c37eaa395d..db40231089 100644 --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -44,8 +44,8 @@ int maxwaittime = 0; /* how long are we prepared to wait for? */ int keepfiles = 0; /* number of WAL files to keep, 0 keep all */ int maxretries = 3; /* number of retries on restore command */ bool debug = false; /* are we debugging? */ -bool need_cleanup = false; /* do we need to remove files from - * archive? */ +bool need_cleanup = false; /* do we need to remove files from + * archive? */ #ifndef WIN32 static volatile sig_atomic_t signaled = false; @@ -59,8 +59,8 @@ char *restartWALFileName; /* the file from which we can restart restore */ char *priorWALFileName; /* the file we need to get from archive */ char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char restoreCommand[MAXPGPATH]; /* run this to restore */ -char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to - * get from archive */ +char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get + * from archive */ /* * Two types of failover are supported (smart and fast failover). @@ -582,7 +582,7 @@ main(int argc, char **argv) * There's no way to trigger failover via signal on Windows. */ (void) pqsignal(SIGUSR1, sighandler); - (void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */ + (void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */ (void) pqsignal(SIGQUIT, sigquit_handler); #endif diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 1febdca16f..d1ed74b45e 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -107,7 +107,7 @@ static const uint32 PGSS_PG_MAJOR_VERSION = PG_VERSION_NUM / 100; #define ASSUMED_LENGTH_INIT 1024 /* initial assumed mean query length */ #define USAGE_DECREASE_FACTOR (0.99) /* decreased every entry_dealloc */ #define STICKY_DECREASE_FACTOR (0.50) /* factor for sticky entries */ -#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */ +#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */ #define JUMBLE_SIZE 1024 /* query serialization buffer size */ @@ -146,15 +146,15 @@ typedef struct Counters double sum_var_time; /* sum of variances in execution time in msec */ int64 rows; /* total # of retrieved or affected rows */ int64 shared_blks_hit; /* # of shared buffer hits */ - int64 shared_blks_read; /* # of shared disk blocks read */ + int64 shared_blks_read; /* # of shared disk blocks read */ int64 shared_blks_dirtied; /* # of shared disk blocks dirtied */ int64 shared_blks_written; /* # of shared disk blocks written */ int64 local_blks_hit; /* # of local buffer hits */ int64 local_blks_read; /* # of local disk blocks read */ - int64 local_blks_dirtied; /* # of local disk blocks dirtied */ - int64 local_blks_written; /* # of local disk blocks written */ + int64 local_blks_dirtied; /* # of local disk blocks dirtied */ + int64 local_blks_written; /* # of local disk blocks written */ int64 temp_blks_read; /* # of temp blocks read */ - int64 temp_blks_written; /* # of temp blocks written */ + int64 temp_blks_written; /* # of temp blocks written */ double blk_read_time; /* time spent reading, in msec */ double blk_write_time; /* time spent writing, in msec */ double usage; /* usage factor */ @@ -183,7 +183,7 @@ typedef struct pgssEntry typedef struct pgssSharedState { LWLock *lock; /* protects hashtable search/modification */ - double cur_median_usage; /* current median usage in hashtable */ + double cur_median_usage; /* current median usage in hashtable */ Size mean_query_len; /* current mean entry text length */ slock_t mutex; /* protects following fields only: */ Size extent; /* current extent of query file */ @@ -940,7 +940,7 @@ pgss_ExecutorEnd(QueryDesc *queryDesc) queryId, queryDesc->plannedstmt->stmt_location, queryDesc->plannedstmt->stmt_len, - queryDesc->totaltime->total * 1000.0, /* convert to msec */ + queryDesc->totaltime->total * 1000.0, /* convert to msec */ queryDesc->estate->es_processed, &queryDesc->totaltime->bufusage, NULL); @@ -1337,7 +1337,7 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS) #define PG_STAT_STATEMENTS_COLS_V1_1 18 #define PG_STAT_STATEMENTS_COLS_V1_2 19 #define PG_STAT_STATEMENTS_COLS_V1_3 23 -#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */ +#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */ /* * Retrieve statement statistics. @@ -2967,12 +2967,12 @@ generate_normalized_query(pgssJumbleState *jstate, const char *query, char *norm_query; int query_len = *query_len_p; int i, - norm_query_buflen, /* Space allowed for norm_query */ + norm_query_buflen, /* Space allowed for norm_query */ len_to_wrt, /* Length (in bytes) to write */ quer_loc = 0, /* Source query byte location */ n_quer_loc = 0, /* Normalized query byte location */ last_off = 0, /* Offset from start for previous tok */ - last_tok_len = 0; /* Length (in bytes) of that tok */ + last_tok_len = 0; /* Length (in bytes) of that tok */ /* * Get constants' lengths (core system only gives us locations). Note diff --git a/contrib/pg_trgm/trgm.h b/contrib/pg_trgm/trgm.h index 8cd88e763c..45df91875a 100644 --- a/contrib/pg_trgm/trgm.h +++ b/contrib/pg_trgm/trgm.h @@ -132,4 +132,4 @@ extern TRGM *createTrgmNFA(text *text_re, Oid collation, TrgmPackedGraph **graph, MemoryContext rcontext); extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check); -#endif /* __TRGM_H__ */ +#endif /* __TRGM_H__ */ diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c index 6ab2e49eb9..1d474e2aac 100644 --- a/contrib/pg_trgm/trgm_regexp.c +++ b/contrib/pg_trgm/trgm_regexp.c @@ -450,7 +450,7 @@ struct TrgmPackedGraph * by color trigram number. */ int colorTrigramsCount; - int *colorTrigramGroups; /* array of size colorTrigramsCount */ + int *colorTrigramGroups; /* array of size colorTrigramsCount */ /* * The states of the simplified NFA. State number 0 is always initial @@ -2350,4 +2350,4 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) pfree(buf.data); } -#endif /* TRGM_REGEXP_DEBUG */ +#endif /* TRGM_REGEXP_DEBUG */ diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index 44a5731dde..60bdbb0c91 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -734,7 +734,7 @@ px_crypt_des(const char *key, const char *setting) p = output + strlen(output); } else -#endif /* !DISABLE_XDES */ +#endif /* !DISABLE_XDES */ { /* * "old"-style: setting - 2 bytes of salt key - only up to the first 8 diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c index 41021a7ffd..cd528bfd83 100644 --- a/contrib/pgcrypto/imath.c +++ b/contrib/pgcrypto/imath.c @@ -1975,7 +1975,7 @@ mp_int_string_len(mp_int z, mp_size radix) if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX) return MP_RANGE; - len = s_outlen(z, radix) + 1; /* for terminator */ + len = s_outlen(z, radix) + 1; /* for terminator */ /* Allow for sign marker on negatives */ if (MP_SIGN(z) == MP_NEG) @@ -2512,7 +2512,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, /* Subtract corresponding digits and propagate borrow */ for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc) { - w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ + w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ (mp_word) *da) - w - (mp_word) *db; *dc = LOWER_HALF(w); @@ -2522,7 +2522,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, /* Finish the subtraction for remaining upper digits of da */ for ( /* */ ; pos < size_a; ++pos, ++da, ++dc) { - w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ + w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ (mp_word) *da) - w; *dc = LOWER_HALF(w); @@ -2594,10 +2594,10 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, * t1 and t2 are initially used as temporaries to compute the inner * product (a1 + a0)(b1 + b0) = a1b1 + a1b0 + a0b1 + a0b0 */ - carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */ + carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */ t1[bot_size] = carry; - carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */ + carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */ t2[bot_size] = carry; (void) s_kmul(t1, t2, t3, bot_size + 1, bot_size + 1); /* t3 = t1 * t2 */ @@ -2609,7 +2609,7 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, ZERO(t1, buf_size); ZERO(t2, buf_size); (void) s_kmul(da, db, t1, bot_size, bot_size); /* t1 = a0 * b0 */ - (void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */ + (void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */ /* Subtract out t1 and t2 to get the inner product */ s_usub(t3, t1, t3, buf_size + 2, buf_size); @@ -2692,10 +2692,10 @@ s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a) t3 = t2 + buf_size; ZERO(t1, 4 * buf_size); - (void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */ - (void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */ + (void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */ + (void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */ - (void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */ + (void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */ /* Quick multiply t3 by 2, shifting left (can't overflow) */ { @@ -2782,7 +2782,7 @@ s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a) w = UPPER_HALF(w); if (ov) { - w += MP_DIGIT_MAX; /* MP_RADIX */ + w += MP_DIGIT_MAX; /* MP_RADIX */ ++w; } } diff --git a/contrib/pgcrypto/imath.h b/contrib/pgcrypto/imath.h index 8ba38d3acb..2d7a5268e5 100644 --- a/contrib/pgcrypto/imath.h +++ b/contrib/pgcrypto/imath.h @@ -106,9 +106,9 @@ void mp_int_free(mp_int z); mp_result mp_int_copy(mp_int a, mp_int c); /* c = a */ void mp_int_swap(mp_int a, mp_int c); /* swap a, c */ -void mp_int_zero(mp_int z); /* z = 0 */ -mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */ -mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */ +void mp_int_zero(mp_int z); /* z = 0 */ +mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */ +mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */ mp_result mp_int_add(mp_int a, mp_int b, mp_int c); /* c = a + b */ mp_result mp_int_add_value(mp_int a, int value, mp_int c); mp_result mp_int_sub(mp_int a, mp_int b, mp_int c); /* c = a - b */ @@ -116,23 +116,23 @@ mp_result mp_int_sub_value(mp_int a, int value, mp_int c); mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */ mp_result mp_int_mul_value(mp_int a, int value, mp_int c); mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c); -mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */ +mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */ -mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */ +mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */ mp_int q, mp_int r); /* r = a % b */ -mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */ - mp_int q, int *r); /* r = a % value */ +mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */ + mp_int q, int *r); /* r = a % value */ mp_result mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */ mp_int q, mp_int r); /* r = q % 2^p2 */ mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */ #define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R)) -mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */ +mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */ mp_result mp_int_expt_value(int a, int b, mp_int c); /* c = a^b */ int mp_int_compare(mp_int a, mp_int b); /* a <=> b */ -int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */ -int mp_int_compare_zero(mp_int z); /* a <=> 0 */ +int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */ +int mp_int_compare_zero(mp_int z); /* a <=> 0 */ int mp_int_compare_value(mp_int z, int value); /* a <=> v */ /* Returns true if v|a, false otherwise (including errors) */ @@ -144,15 +144,15 @@ int mp_int_is_pow2(mp_int z); mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, mp_int c); /* c = a^b (mod m) */ mp_result mp_int_exptmod_evalue(mp_int a, int value, - mp_int m, mp_int c); /* c = a^v (mod m) */ + mp_int m, mp_int c); /* c = a^v (mod m) */ mp_result mp_int_exptmod_bvalue(int value, mp_int b, - mp_int m, mp_int c); /* c = v^b (mod m) */ + mp_int m, mp_int c); /* c = v^b (mod m) */ mp_result mp_int_exptmod_known(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c); /* c = a^b (mod m) */ mp_result mp_int_redux_const(mp_int m, mp_int c); -mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */ +mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */ mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */ @@ -207,4 +207,4 @@ void s_print(char *tag, mp_int z); void s_print_buf(char *tag, mp_digit *buf, mp_size num); #endif -#endif /* end IMATH_H_ */ +#endif /* end IMATH_H_ */ diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index c2687cfdb2..16dfe725ea 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -42,11 +42,11 @@ /* * System reseeds should be separated at least this much. */ -#define SYSTEM_RESEED_MIN (20*60) /* 20 min */ +#define SYSTEM_RESEED_MIN (20*60) /* 20 min */ /* * How often to roll dice. */ -#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */ +#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */ /* * The chance is x/256 that the reseed happens. */ diff --git a/contrib/pgcrypto/mbuf.h b/contrib/pgcrypto/mbuf.h index d413eb5276..50a989f059 100644 --- a/contrib/pgcrypto/mbuf.h +++ b/contrib/pgcrypto/mbuf.h @@ -121,4 +121,4 @@ int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf); (dst) = __b; \ } while (0) -#endif /* __PX_MBUF_H */ +#endif /* __PX_MBUF_H */ diff --git a/contrib/pgcrypto/md5.h b/contrib/pgcrypto/md5.h index 07d08c134d..3e6e8da5e7 100644 --- a/contrib/pgcrypto/md5.h +++ b/contrib/pgcrypto/md5.h @@ -76,4 +76,4 @@ do { \ md5_result((x), (y)); \ } while (0) -#endif /* ! _NETINET6_MD5_H_ */ +#endif /* ! _NETINET6_MD5_H_ */ diff --git a/contrib/pgcrypto/pgp.h b/contrib/pgcrypto/pgp.h index 804a27018a..1b6ea4c9ea 100644 --- a/contrib/pgcrypto/pgp.h +++ b/contrib/pgcrypto/pgp.h @@ -155,8 +155,8 @@ struct PGP_Context */ int mdc_checked; int corrupt_prefix; /* prefix failed RFC 4880 "quick check" */ - int unsupported_compr; /* has bzip2 compression */ - int unexpected_binary; /* binary data seen in text_mode */ + int unsupported_compr; /* has bzip2 compression */ + int unexpected_binary; /* binary data seen in text_mode */ int in_mdc_pkt; int use_mdcbuf_filter; PX_MD *mdc_ctx; diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h index 24daee743c..4ea72dcbc5 100644 --- a/contrib/pgcrypto/px-crypt.h +++ b/contrib/pgcrypto/px-crypt.h @@ -79,4 +79,4 @@ char *px_crypt_des(const char *key, const char *setting); char *px_crypt_md5(const char *pw, const char *salt, char *dst, unsigned dstlen); -#endif /* _PX_CRYPT_H */ +#endif /* _PX_CRYPT_H */ diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h index e8068317d0..cef9c4b456 100644 --- a/contrib/pgcrypto/px.h +++ b/contrib/pgcrypto/px.h @@ -154,7 +154,7 @@ struct px_hmac struct px_cipher { unsigned (*block_size) (PX_Cipher *c); - unsigned (*key_size) (PX_Cipher *c); /* max key len */ + unsigned (*key_size) (PX_Cipher *c); /* max key len */ unsigned (*iv_size) (PX_Cipher *c); int (*init) (PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv); @@ -239,4 +239,4 @@ void px_debug(const char *fmt,...) pg_attribute_printf(1, 2); (c)->decrypt(c, data, dlen, res, rlen) #define px_combo_free(c) (c)->free(c) -#endif /* __PX_H */ +#endif /* __PX_H */ diff --git a/contrib/pgcrypto/rijndael.c b/contrib/pgcrypto/rijndael.c index 4adbcc1f91..4c074efbc0 100644 --- a/contrib/pgcrypto/rijndael.c +++ b/contrib/pgcrypto/rijndael.c @@ -97,7 +97,7 @@ static u4byte il_tab[4][256]; #endif static u4byte tab_gen = 0; -#endif /* !PRE_CALC_TABLES */ +#endif /* !PRE_CALC_TABLES */ #define ff_mult(a,b) ((a) && (b) ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0) @@ -250,7 +250,7 @@ gen_tabs(void) } tab_gen = 1; -#endif /* !PRE_CALC_TABLES */ +#endif /* !PRE_CALC_TABLES */ } diff --git a/contrib/pgcrypto/rijndael.h b/contrib/pgcrypto/rijndael.h index 108ef68b76..bc9ddfaad3 100644 --- a/contrib/pgcrypto/rijndael.h +++ b/contrib/pgcrypto/rijndael.h @@ -56,4 +56,4 @@ void aes_ecb_decrypt(rijndael_ctx *ctx, uint8 *data, unsigned len); void aes_cbc_encrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len); void aes_cbc_decrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len); -#endif /* _RIJNDAEL_H_ */ +#endif /* _RIJNDAEL_H_ */ diff --git a/contrib/pgcrypto/sha1.h b/contrib/pgcrypto/sha1.h index 2f61e454ba..4300694a34 100644 --- a/contrib/pgcrypto/sha1.h +++ b/contrib/pgcrypto/sha1.h @@ -72,4 +72,4 @@ typedef struct sha1_ctxt SHA1_CTX; #define SHA1_RESULTLEN (160/8) -#endif /* _NETINET6_SHA1_H_ */ +#endif /* _NETINET6_SHA1_H_ */ diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 03b387f6b6..c3a95208c1 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -333,7 +333,7 @@ pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo) values[j++] = psprintf("%d", indexStat.version); values[j++] = psprintf("%d", indexStat.level); values[j++] = psprintf(INT64_FORMAT, - (1 + /* include the metapage in index_size */ + (1 + /* include the metapage in index_size */ indexStat.leaf_pages + indexStat.internal_pages + indexStat.deleted_pages + diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c index e24db569ea..ca496b9df7 100644 --- a/contrib/postgres_fdw/option.c +++ b/contrib/postgres_fdw/option.c @@ -258,7 +258,7 @@ is_valid_option(const char *keyword, Oid context) { PgFdwOption *opt; - Assert(postgres_fdw_options); /* must be initialized already */ + Assert(postgres_fdw_options); /* must be initialized already */ for (opt = postgres_fdw_options; opt->keyword; opt++) { @@ -277,7 +277,7 @@ is_libpq_option(const char *keyword) { PgFdwOption *opt; - Assert(postgres_fdw_options); /* must be initialized already */ + Assert(postgres_fdw_options); /* must be initialized already */ for (opt = postgres_fdw_options; opt->keyword; opt++) { diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 080cb0a074..3d18098461 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -899,14 +899,14 @@ postgresGetForeignPaths(PlannerInfo *root, * to estimate cost and size of this path. */ path = create_foreignscan_path(root, baserel, - NULL, /* default pathtarget */ + NULL, /* default pathtarget */ fpinfo->rows, fpinfo->startup_cost, fpinfo->total_cost, NIL, /* no pathkeys */ - NULL, /* no outer rel either */ - NULL, /* no extra plan */ - NIL); /* no fdw_private list */ + NULL, /* no outer rel either */ + NULL, /* no extra plan */ + NIL); /* no fdw_private list */ add_path(baserel, (Path *) path); /* Add paths with pathkeys */ @@ -1075,7 +1075,7 @@ postgresGetForeignPaths(PlannerInfo *root, rows, startup_cost, total_cost, - NIL, /* no pathkeys */ + NIL, /* no pathkeys */ param_info->ppi_req_outer, NULL, NIL); /* no fdw_private list */ @@ -1591,7 +1591,7 @@ postgresPlanForeignModify(PlannerInfo *root, /* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */ AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; - if (attno <= InvalidAttrNumber) /* shouldn't happen */ + if (attno <= InvalidAttrNumber) /* shouldn't happen */ elog(ERROR, "system-column update is not supported"); targetAttrs = lappend_int(targetAttrs, attno); } @@ -2173,7 +2173,7 @@ postgresPlanDirectModify(PlannerInfo *root, AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; TargetEntry *tle; - if (attno <= InvalidAttrNumber) /* shouldn't happen */ + if (attno <= InvalidAttrNumber) /* shouldn't happen */ elog(ERROR, "system-column update is not supported"); tle = get_tle_by_resno(subplan->targetlist, attno); @@ -4305,7 +4305,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, * Note that since this joinrel is at the end of the join_rel_list list * when we are called, we can get the position by list_length. */ - Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */ + Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */ fpinfo->relation_index = list_length(root->parse->rtable) + list_length(root->join_rel_list); @@ -4316,7 +4316,7 @@ static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel, Path *epq_path) { - List *useful_pathkeys_list = NIL; /* List of all pathkeys */ + List *useful_pathkeys_list = NIL; /* List of all pathkeys */ ListCell *lc; useful_pathkeys_list = get_useful_pathkeys_for_relation(root, rel); @@ -4568,7 +4568,7 @@ postgresGetForeignJoinPaths(PlannerInfo *root, rows, startup_cost, total_cost, - NIL, /* no pathkeys */ + NIL, /* no pathkeys */ NULL, /* no required_outer */ epq_path, NIL); /* no fdw_private */ diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 25c950dd76..f396dae7fb 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -182,4 +182,4 @@ extern bool is_builtin(Oid objectId); extern bool is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo); extern const char *get_jointype_name(JoinType jointype); -#endif /* POSTGRES_FDW_H */ +#endif /* POSTGRES_FDW_H */ diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c index 2f01c393cc..f55b9de1da 100644 --- a/contrib/sepgsql/label.c +++ b/contrib/sepgsql/label.c @@ -68,10 +68,10 @@ static fmgr_hook_type next_fmgr_hook = NULL; * labels were set during the (sub-)transactions. */ static char *client_label_peer = NULL; /* set by getpeercon(3) */ -static List *client_label_pending = NIL; /* pending list being set by - * sepgsql_setcon() */ -static char *client_label_committed = NULL; /* set by sepgsql_setcon(), - * and already committed */ +static List *client_label_pending = NIL; /* pending list being set by + * sepgsql_setcon() */ +static char *client_label_committed = NULL; /* set by sepgsql_setcon(), and + * already committed */ static char *client_label_func = NULL; /* set by trusted procedure */ typedef struct diff --git a/contrib/sepgsql/sepgsql.h b/contrib/sepgsql/sepgsql.h index fbe25e6602..d4bf0cd14a 100644 --- a/contrib/sepgsql/sepgsql.h +++ b/contrib/sepgsql/sepgsql.h @@ -324,4 +324,4 @@ extern void sepgsql_proc_relabel(Oid functionId, const char *seclabel); extern void sepgsql_proc_setattr(Oid functionId); extern void sepgsql_proc_execute(Oid functionId); -#endif /* SEPGSQL_H */ +#endif /* SEPGSQL_H */ diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index 208ff6103d..692d99ca5b 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -248,7 +248,7 @@ check_foreign_key(PG_FUNCTION_ARGS) Datum *kvals; /* key values */ char *relname; /* referencing relation name */ Relation rel; /* triggered relation */ - HeapTuple trigtuple = NULL; /* tuple to being changed */ + HeapTuple trigtuple = NULL; /* tuple to being changed */ HeapTuple newtuple = NULL; /* tuple to return */ TupleDesc tupdesc; /* tuple description */ EPlan *plan; /* prepared plan(s) */ diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c index c4b3e7d6fa..f7905e20db 100644 --- a/contrib/spi/timetravel.c +++ b/contrib/spi/timetravel.c @@ -85,7 +85,7 @@ timetravel(PG_FUNCTION_ARGS) Trigger *trigger; /* to get trigger name */ int argc; char **args; /* arguments */ - int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */ + int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */ Datum oldtimeon, oldtimeoff; Datum newtimeon, diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c index 7434ca9373..b5e1ad29e2 100644 --- a/contrib/tablefunc/tablefunc.c +++ b/contrib/tablefunc/tablefunc.c @@ -1187,8 +1187,8 @@ connectby(char *relname, branch_delim, start_with, start_with, /* current_branch */ - 0, /* initial level is 0 */ - &serial, /* initial serial is 1 */ + 0, /* initial level is 0 */ + &serial, /* initial serial is 1 */ max_depth, show_branch, show_serial, diff --git a/contrib/tablefunc/tablefunc.h b/contrib/tablefunc/tablefunc.h index 87fa1e5dcb..e88a5720fa 100644 --- a/contrib/tablefunc/tablefunc.h +++ b/contrib/tablefunc/tablefunc.h @@ -36,4 +36,4 @@ #include "fmgr.h" -#endif /* TABLEFUNC_H */ +#endif /* TABLEFUNC_H */ diff --git a/contrib/tcn/tcn.c b/contrib/tcn/tcn.c index 124110830f..5106d424b4 100644 --- a/contrib/tcn/tcn.c +++ b/contrib/tcn/tcn.c @@ -132,7 +132,7 @@ triggered_change_notification(PG_FUNCTION_ARGS) Form_pg_index index; indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid)); - if (!HeapTupleIsValid(indexTuple)) /* should not happen */ + if (!HeapTupleIsValid(indexTuple)) /* should not happen */ elog(ERROR, "cache lookup failed for index %u", indexoid); index = (Form_pg_index) GETSTRUCT(indexTuple); /* we're only interested if it is the primary key and valid */ @@ -175,5 +175,5 @@ triggered_change_notification(PG_FUNCTION_ARGS) (errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED), errmsg("triggered_change_notification: must be called on a table with a primary key"))); - return PointerGetDatum(NULL); /* after trigger; value doesn't matter */ + return PointerGetDatum(NULL); /* after trigger; value doesn't matter */ } diff --git a/contrib/uuid-ossp/uuid-ossp.c b/contrib/uuid-ossp/uuid-ossp.c index f34398f54a..55bc609415 100644 --- a/contrib/uuid-ossp/uuid-ossp.c +++ b/contrib/uuid-ossp/uuid-ossp.c @@ -110,7 +110,7 @@ do { \ uu.clock_seq_hi_and_reserved |= 0x80; \ } while(0) -#endif /* !HAVE_UUID_OSSP */ +#endif /* !HAVE_UUID_OSSP */ PG_MODULE_MAGIC; @@ -398,7 +398,7 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len) return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf)); } -#endif /* HAVE_UUID_OSSP */ +#endif /* HAVE_UUID_OSSP */ Datum diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index acf1c4a1c1..a48818d944 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -95,7 +95,7 @@ PG_FUNCTION_INFO_V1(xml_is_well_formed); Datum xml_is_well_formed(PG_FUNCTION_ARGS) { - text *t = PG_GETARG_TEXT_PP(0); /* document buffer */ + text *t = PG_GETARG_TEXT_PP(0); /* document buffer */ bool result = false; int32 docsize = VARSIZE_ANY_EXHDR(t); xmlDocPtr doctree; @@ -249,7 +249,7 @@ Datum xpath_nodeset(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *toptag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2)); xmlChar *septag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(3)); xmlChar *xpath; @@ -282,7 +282,7 @@ Datum xpath_list(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *plainsep = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2)); xmlChar *xpath; text *xpres; @@ -311,7 +311,7 @@ Datum xpath_string(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; int32 pathsize; text *xpres; @@ -352,7 +352,7 @@ Datum xpath_number(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; float4 fRes; xmlXPathObjectPtr res; @@ -384,7 +384,7 @@ Datum xpath_bool(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; int bRes; xmlXPathObjectPtr res; diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c index 391e6b593b..fb49b98f5a 100644 --- a/contrib/xml2/xslt_proc.c +++ b/contrib/xml2/xslt_proc.c @@ -29,7 +29,7 @@ #include <libxslt/security.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ #ifdef USE_LIBXSLT @@ -39,7 +39,7 @@ extern PgXmlErrorContext *pgxml_parser_init(PgXmlStrictness strictness); /* local defs */ static const char **parse_params(text *paramstr); -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ PG_FUNCTION_INFO_V1(xslt_process); @@ -189,7 +189,7 @@ xslt_process(PG_FUNCTION_ARGS) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("xslt_process() is not available without libxslt"))); PG_RETURN_NULL(); -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ } #ifdef USE_LIBXSLT @@ -253,4 +253,4 @@ parse_params(text *paramstr) return params; } -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c index 3609c8ae7c..bd08f0e396 100644 --- a/src/backend/access/brin/brin_pageops.c +++ b/src/backend/access/brin/brin_pageops.c @@ -357,7 +357,7 @@ brin_doinsert(Relation idxrel, BlockNumber pagesPerRange, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", itemsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); - return InvalidOffsetNumber; /* keep compiler quiet */ + return InvalidOffsetNumber; /* keep compiler quiet */ } /* Make sure the revmap is long enough to contain the entry we need */ @@ -823,7 +823,7 @@ brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", itemsz, freespace, RelationGetRelationName(irel)))); - return InvalidBuffer; /* keep compiler quiet */ + return InvalidBuffer; /* keep compiler quiet */ } if (newblk != oldblk) diff --git a/src/backend/access/brin/brin_revmap.c b/src/backend/access/brin/brin_revmap.c index e778cbcacd..c87bc03a9e 100644 --- a/src/backend/access/brin/brin_revmap.c +++ b/src/backend/access/brin/brin_revmap.c @@ -48,7 +48,7 @@ struct BrinRevmap { Relation rm_irel; BlockNumber rm_pagesPerRange; - BlockNumber rm_lastRevmapPage; /* cached from the metapage */ + BlockNumber rm_lastRevmapPage; /* cached from the metapage */ Buffer rm_metaBuf; Buffer rm_currBuf; }; diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index c0086ded62..584a202ab5 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -356,7 +356,7 @@ nocachegetattr(HeapTuple tuple, HeapTupleHeader tup = tuple->t_data; Form_pg_attribute *att = tupleDesc->attrs; char *tp; /* ptr to data part of tuple */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow = false; /* do we have to walk attrs? */ int off; /* current offset within data */ @@ -762,7 +762,7 @@ heap_form_tuple(TupleDesc tupleDescriptor, HeapTupleHeaderSetNatts(td, numberOfAttributes); td->t_hoff = hoff; - if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ + if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ td->t_infomask = HEAP_HASOID; heap_fill_tuple(tupleDescriptor, @@ -941,7 +941,7 @@ heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, int attnum; char *tp; /* ptr to tuple data */ long off; /* offset in tuple data */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow = false; /* can we use/set attcacheoff? */ natts = HeapTupleHeaderGetNatts(tup); @@ -1043,7 +1043,7 @@ slot_deform_tuple(TupleTableSlot *slot, int natts) int attnum; char *tp; /* ptr to tuple data */ long off; /* offset in tuple data */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow; /* can we use/set attcacheoff? */ /* @@ -1151,7 +1151,7 @@ slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull) { if (tuple == NULL) /* internal error */ elog(ERROR, "cannot extract system attribute from virtual tuple"); - if (tuple == &(slot->tts_minhdr)) /* internal error */ + if (tuple == &(slot->tts_minhdr)) /* internal error */ elog(ERROR, "cannot extract system attribute from minimal tuple"); return heap_getsysattr(tuple, attnum, tupleDesc, isnull); } @@ -1337,7 +1337,7 @@ slot_attisnull(TupleTableSlot *slot, int attnum) { if (tuple == NULL) /* internal error */ elog(ERROR, "cannot extract system attribute from virtual tuple"); - if (tuple == &(slot->tts_minhdr)) /* internal error */ + if (tuple == &(slot->tts_minhdr)) /* internal error */ elog(ERROR, "cannot extract system attribute from minimal tuple"); return heap_attisnull(tuple, attnum); } @@ -1446,7 +1446,7 @@ heap_form_minimal_tuple(TupleDesc tupleDescriptor, HeapTupleHeaderSetNatts(tuple, numberOfAttributes); tuple->t_hoff = hoff + MINIMAL_TUPLE_OFFSET; - if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ + if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ tuple->t_infomask = HEAP_HASOID; heap_fill_tuple(tupleDescriptor, diff --git a/src/backend/access/common/printsimple.c b/src/backend/access/common/printsimple.c index 851c3bf4de..c863e859fe 100644 --- a/src/backend/access/common/printsimple.c +++ b/src/backend/access/common/printsimple.c @@ -103,7 +103,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self) case INT4OID: { int32 num = DatumGetInt32(value); - char str[12]; /* sign, 10 digits and '\0' */ + char str[12]; /* sign, 10 digits and '\0' */ pg_ltoa(num, str); pq_sendcountedtext(&buf, str, strlen(str), false); @@ -113,7 +113,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self) case INT8OID: { int64 num = DatumGetInt64(value); - char str[23]; /* sign, 21 digits and '\0' */ + char str[23]; /* sign, 21 digits and '\0' */ pg_lltoa(num, str); pq_sendcountedtext(&buf, str, strlen(str), false); diff --git a/src/backend/access/common/tupconvert.c b/src/backend/access/common/tupconvert.c index 392a49b522..57e44375ea 100644 --- a/src/backend/access/common/tupconvert.c +++ b/src/backend/access/common/tupconvert.c @@ -188,7 +188,7 @@ convert_tuples_by_position(TupleDesc indesc, n = indesc->natts + 1; /* +1 for NULL */ map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->inisnull = (bool *) palloc(n * sizeof(bool)); - map->invalues[0] = (Datum) 0; /* set up the NULL entry */ + map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->inisnull[0] = true; return map; @@ -267,7 +267,7 @@ convert_tuples_by_name(TupleDesc indesc, n = indesc->natts + 1; /* +1 for NULL */ map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->inisnull = (bool *) palloc(n * sizeof(bool)); - map->invalues[0] = (Datum) 0; /* set up the NULL entry */ + map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->inisnull[0] = true; return map; diff --git a/src/backend/access/gin/ginbulk.c b/src/backend/access/gin/ginbulk.c index f07c76b90b..4ff149e59a 100644 --- a/src/backend/access/gin/ginbulk.c +++ b/src/backend/access/gin/ginbulk.c @@ -116,7 +116,7 @@ ginInitBA(BuildAccumulator *accum) cmpEntryAccumulator, ginCombineData, ginAllocEntryAccumulator, - NULL, /* no freefunc needed */ + NULL, /* no freefunc needed */ (void *) accum); } diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 0d5bb70cc9..03a54346aa 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -913,8 +913,8 @@ ginInsertCleanup(GinState *ginstate, bool full_clean, * Remember next page - it will become the new list head */ blkno = GinPageGetOpaque(page)->rightlink; - UnlockReleaseBuffer(buffer); /* shiftList will do exclusive - * locking */ + UnlockReleaseBuffer(buffer); /* shiftList will do exclusive + * locking */ /* * remove read pages from pending list, at this point all content diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c index c83375d6b4..25758b9b5d 100644 --- a/src/backend/access/gin/ginscan.c +++ b/src/backend/access/gin/ginscan.c @@ -362,7 +362,7 @@ ginNewScanKey(IndexScanDesc scan) { if (nullFlags[j]) { - nullFlags[j] = true; /* not any other nonzero value */ + nullFlags[j] = true; /* not any other nonzero value */ hasNullQuery = true; } } diff --git a/src/backend/access/gin/ginvacuum.c b/src/backend/access/gin/ginvacuum.c index 27e502a360..31425e9963 100644 --- a/src/backend/access/gin/ginvacuum.c +++ b/src/backend/access/gin/ginvacuum.c @@ -650,7 +650,7 @@ ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, vacuum_delay_point(); } - if (blkno == InvalidBlockNumber) /* rightmost page */ + if (blkno == InvalidBlockNumber) /* rightmost page */ break; buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno, diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 6593771361..afef753ede 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -1442,7 +1442,7 @@ initGISTstate(Relation index) giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE)); giststate->scanCxt = scanCxt; - giststate->tempCxt = scanCxt; /* caller must change this if needed */ + giststate->tempCxt = scanCxt; /* caller must change this if needed */ giststate->tupdesc = index->rd_att; for (i = 0; i < index->rd_att->natts; i++) diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index f1f08bb3d8..c24643df03 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -814,7 +814,7 @@ gistbufferinginserttuples(GISTBuildState *buildstate, Buffer buffer, int level, downlinks, ndownlinks, downlinkoffnum, InvalidBlockNumber, InvalidOffsetNumber); - list_free_deep(splitinfo); /* we don't need this anymore */ + list_free_deep(splitinfo); /* we don't need this anymore */ } else UnlockReleaseBuffer(buffer); diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c index ca4c32b3fe..f558729fbf 100644 --- a/src/backend/access/gist/gistbuildbuffers.c +++ b/src/backend/access/gist/gistbuildbuffers.c @@ -709,7 +709,7 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate, * page seen so far. Skip the remaining columns and move * on to the next page, if any. */ - zero_penalty = false; /* so outer loop won't exit */ + zero_penalty = false; /* so outer loop won't exit */ break; } } diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 5a4dea89ac..760ea0c997 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -147,7 +147,7 @@ gistindex_keytest(IndexScanDesc scan, { int i; - if (GistPageIsLeaf(page)) /* shouldn't happen */ + if (GistPageIsLeaf(page)) /* shouldn't happen */ elog(ERROR, "invalid GiST tuple found on leaf page"); for (i = 0; i < scan->numberOfOrderBys; i++) so->distances[i] = -get_float8_infinity(); diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index 289d766419..a127f3f8b1 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -412,7 +412,7 @@ hash_any(register const unsigned char *k, register int keylen) a += k[0]; /* case 0: nothing left to add */ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ } else { @@ -429,7 +429,7 @@ hash_any(register const unsigned char *k, register int keylen) a += (k[0] + ((uint32) k[1] << 8) + ((uint32) k[2] << 16) + ((uint32) k[3] << 24)); b += (k[4] + ((uint32) k[5] << 8) + ((uint32) k[6] << 16) + ((uint32) k[7] << 24)); c += (k[8] + ((uint32) k[9] << 8) + ((uint32) k[10] << 16) + ((uint32) k[11] << 24)); -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ mix(a, b, c); k += 12; len -= 12; @@ -492,7 +492,7 @@ hash_any(register const unsigned char *k, register int keylen) a += k[0]; /* case 0: nothing left to add */ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ } final(a, b, c); diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c index 2d9204903f..3e461ad7a0 100644 --- a/src/backend/access/hash/hashsearch.c +++ b/src/backend/access/hash/hashsearch.c @@ -462,7 +462,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) } if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup)) - break; /* yes, so exit for-loop */ + break; /* yes, so exit for-loop */ } /* Before leaving current page, deal with any killed items */ @@ -519,7 +519,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) } if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup)) - break; /* yes, so exit for-loop */ + break; /* yes, so exit for-loop */ } /* Before leaving current page, deal with any killed items */ diff --git a/src/backend/access/hash/hashutil.c b/src/backend/access/hash/hashutil.c index c513c3b842..62e37b6de5 100644 --- a/src/backend/access/hash/hashutil.c +++ b/src/backend/access/hash/hashutil.c @@ -207,7 +207,7 @@ _hash_get_totalbuckets(uint32 splitpoint_phase) /* account for buckets within splitpoint_group */ phases_within_splitpoint_group = (((splitpoint_phase - HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE) & - HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */ + HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */ total_buckets += (((1 << (splitpoint_group - 1)) >> HASH_SPLITPOINT_PHASE_BITS) * phases_within_splitpoint_group); diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index e890e08c9a..5357a77dc2 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -521,15 +521,15 @@ heapgettup(HeapScanDesc scan, } } else - page = scan->rs_startblock; /* first page */ + page = scan->rs_startblock; /* first page */ heapgetpage(scan, page); - lineoff = FirstOffsetNumber; /* first offnum */ + lineoff = FirstOffsetNumber; /* first offnum */ scan->rs_inited = true; } else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ lineoff = /* next offnum */ OffsetNumberNext(ItemPointerGetOffsetNumber(&(tuple->t_self))); } @@ -577,7 +577,7 @@ heapgettup(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ } LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE); @@ -823,7 +823,7 @@ heapgettup_pagemode(HeapScanDesc scan, } } else - page = scan->rs_startblock; /* first page */ + page = scan->rs_startblock; /* first page */ heapgetpage(scan, page); lineindex = 0; scan->rs_inited = true; @@ -831,7 +831,7 @@ heapgettup_pagemode(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ lineindex = scan->rs_cindex + 1; } @@ -876,7 +876,7 @@ heapgettup_pagemode(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ } dp = BufferGetPage(scan->rs_cbuf); @@ -1088,7 +1088,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, ) ); } -#endif /* defined(DISABLE_COMPLEX_MACRO) */ +#endif /* defined(DISABLE_COMPLEX_MACRO) */ /* ---------------------------------------------------------------- @@ -1787,7 +1787,7 @@ heap_update_snapshot(HeapScanDesc scan, Snapshot snapshot) #define HEAPDEBUG_1 #define HEAPDEBUG_2 #define HEAPDEBUG_3 -#endif /* !defined(HEAPDEBUGALL) */ +#endif /* !defined(HEAPDEBUGALL) */ HeapTuple @@ -2623,7 +2623,7 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid, HeapTupleHeaderSetXminFrozen(tup->t_data); HeapTupleHeaderSetCmin(tup->t_data, cid); - HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */ + HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */ tup->t_tableOid = RelationGetRelid(relation); /* @@ -4214,7 +4214,7 @@ l2: HeapTupleClearHeapOnly(newtup); } - RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */ + RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */ /* Clear obsolete visibility flags, possibly set by ourselves above... */ @@ -6361,7 +6361,7 @@ FreezeMultiXactId(MultiXactId multi, uint16 t_infomask, { Assert(!TransactionIdDidCommit(xid)); *flags |= FRM_INVALIDATE_XMAX; - xid = InvalidTransactionId; /* not strictly necessary */ + xid = InvalidTransactionId; /* not strictly necessary */ } else { diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index 6529fe3d6b..13e3bdca50 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -329,7 +329,7 @@ RelationGetBufferForTuple(Relation relation, Size len, if (otherBuffer != InvalidBuffer) otherBlock = BufferGetBlockNumber(otherBuffer); else - otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */ + otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */ /* * We first try to put the tuple on the same page we last inserted a tuple diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index d69a266c36..5b7c57d568 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -31,8 +31,7 @@ typedef struct { TransactionId new_prune_xid; /* new prune hint value for page */ - TransactionId latestRemovedXid; /* latest xid to be removed by this - * prune */ + TransactionId latestRemovedXid; /* latest xid to be removed by this prune */ int nredirected; /* numbers of entries in arrays below */ int ndead; int nunused; @@ -149,8 +148,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer) */ if (PageIsFull(page) || PageGetHeapFreeSpace(page) < minfree) { - TransactionId ignore = InvalidTransactionId; /* return value not - * needed */ + TransactionId ignore = InvalidTransactionId; /* return value not + * needed */ /* OK to prune */ (void) heap_page_prune(relation, buffer, OldestXmin, true, &ignore); diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c index e702af901e..bd560e47e1 100644 --- a/src/backend/access/heap/rewriteheap.c +++ b/src/backend/access/heap/rewriteheap.c @@ -146,22 +146,22 @@ typedef struct RewriteStateData BlockNumber rs_blockno; /* block where page will go */ bool rs_buffer_valid; /* T if any tuples in buffer */ bool rs_use_wal; /* must we WAL-log inserts? */ - bool rs_logical_rewrite; /* do we need to do logical rewriting */ - TransactionId rs_oldest_xmin; /* oldest xmin used by caller to - * determine tuple visibility */ + bool rs_logical_rewrite; /* do we need to do logical rewriting */ + TransactionId rs_oldest_xmin; /* oldest xmin used by caller to determine + * tuple visibility */ TransactionId rs_freeze_xid; /* Xid that will be used as freeze cutoff * point */ - TransactionId rs_logical_xmin; /* Xid that will be used as cutoff - * point for logical rewrites */ + TransactionId rs_logical_xmin; /* Xid that will be used as cutoff point + * for logical rewrites */ MultiXactId rs_cutoff_multi; /* MultiXactId that will be used as cutoff * point for multixacts */ MemoryContext rs_cxt; /* for hash tables and entries and tuples in * them */ XLogRecPtr rs_begin_lsn; /* XLogInsertLsn when starting the rewrite */ - HTAB *rs_unresolved_tups; /* unmatched A tuples */ - HTAB *rs_old_new_tid_map; /* unmatched B tuples */ + HTAB *rs_unresolved_tups; /* unmatched A tuples */ + HTAB *rs_old_new_tid_map; /* unmatched B tuples */ HTAB *rs_logical_mappings; /* logical remapping files */ - uint32 rs_num_rewrite_mappings; /* # in memory mappings */ + uint32 rs_num_rewrite_mappings; /* # in memory mappings */ } RewriteStateData; /* @@ -216,8 +216,8 @@ typedef struct RewriteMappingFile */ typedef struct RewriteMappingDataEntry { - LogicalRewriteMappingData map; /* map between old and new location of - * the tuple */ + LogicalRewriteMappingData map; /* map between old and new location of the + * tuple */ dlist_node node; } RewriteMappingDataEntry; @@ -655,7 +655,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup) else heaptup = tup; - len = MAXALIGN(heaptup->t_len); /* be conservative */ + len = MAXALIGN(heaptup->t_len); /* be conservative */ /* * If we're gonna fail for oversize tuple, do it right away diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index a2b3700750..fa5e78a067 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -1523,7 +1523,7 @@ toast_save_datum(Relation rel, Datum value, { data_p = VARDATA_SHORT(dval); data_todo = VARSIZE_SHORT(dval) - VARHDRSZ_SHORT; - toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */ + toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */ toast_pointer.va_extsize = data_todo; } else if (VARATT_IS_COMPRESSED(dval)) diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index a91fda7bcd..05d7da001a 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -83,7 +83,7 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys) scan->heapRelation = NULL; /* may be set later */ scan->indexRelation = indexRelation; - scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */ + scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */ scan->numberOfKeys = nkeys; scan->numberOfOrderBys = norderbys; diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index cc5ac8b857..cacd74a978 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -326,7 +326,7 @@ index_rescan(IndexScanDesc scan, scan->xs_continue_hot = false; - scan->kill_prior_tuple = false; /* for safety */ + scan->kill_prior_tuple = false; /* for safety */ scan->indexRelation->rd_amroutine->amrescan(scan, keys, nkeys, orderbys, norderbys); @@ -401,7 +401,7 @@ index_restrpos(IndexScanDesc scan) scan->xs_continue_hot = false; - scan->kill_prior_tuple = false; /* for safety */ + scan->kill_prior_tuple = false; /* for safety */ scan->indexRelation->rd_amroutine->amrestrpos(scan); } diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index 6dca8109fd..df8f44ae80 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -36,7 +36,7 @@ typedef struct OffsetNumber newitemoff; /* where the new item is to be inserted */ int leftspace; /* space available for items on left page */ int rightspace; /* space available for items on right page */ - int olddataitemstotal; /* space taken by old items */ + int olddataitemstotal; /* space taken by old items */ bool have_split; /* found a valid split? */ diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 5d7504040d..3dbafdd6fc 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -59,7 +59,7 @@ typedef struct IndexBulkDeleteCallback callback; void *callback_state; BTCycleId cycleid; - BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */ + BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */ BlockNumber lastBlockLocked; /* highest blkno we've cleanup-locked */ BlockNumber totFreePages; /* true total # of free pages */ MemoryContext pagedelcontext; @@ -95,9 +95,8 @@ typedef struct BTParallelScanDescData BTPS_State btps_pageStatus; /* indicates whether next page is * available for scan. see above for * possible states of parallel scan. */ - int btps_arrayKeyCount; /* count indicating number of array - * scan keys processed by parallel - * scan */ + int btps_arrayKeyCount; /* count indicating number of array scan + * keys processed by parallel scan */ slock_t btps_mutex; /* protects above variables */ ConditionVariable btps_cv; /* used to synchronize parallel scan */ } BTParallelScanDescData; @@ -187,7 +186,7 @@ btbuild(Relation heap, Relation index, IndexInfo *indexInfo) #ifdef BTREE_BUILD_STATS if (log_btree_build_stats) ResetUsage(); -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ /* * We expect to be called exactly once for any index relation. If that's @@ -234,7 +233,7 @@ btbuild(Relation heap, Relation index, IndexInfo *indexInfo) ShowUsage("BTREE BUILD STATS"); ResetUsage(); } -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ /* * Return statistics diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c index 2f32b2e78d..2de1625a12 100644 --- a/src/backend/access/nbtree/nbtsearch.c +++ b/src/backend/access/nbtree/nbtsearch.c @@ -466,7 +466,7 @@ _bt_compare(Relation rel, datum = index_getattr(itup, scankey->sk_attno, itupdesc, &isNull); /* see comments about NULLs handling in btbuild */ - if (scankey->sk_flags & SK_ISNULL) /* key is NULL */ + if (scankey->sk_flags & SK_ISNULL) /* key is NULL */ { if (isNull) result = 0; /* NULL "=" NULL */ diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 3d041c47c0..168756cc78 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -111,7 +111,7 @@ typedef struct BTPageState OffsetNumber btps_lastoff; /* last item offset loaded */ uint32 btps_level; /* tree level (0 = leaf) */ Size btps_full; /* "full" if less than this much free space */ - struct BTPageState *btps_next; /* link to parent level, if any */ + struct BTPageState *btps_next; /* link to parent level, if any */ } BTPageState; /* @@ -122,8 +122,8 @@ typedef struct BTWriteState Relation heap; Relation index; bool btws_use_wal; /* dump pages to WAL? */ - BlockNumber btws_pages_alloced; /* # pages allocated */ - BlockNumber btws_pages_written; /* # pages written out */ + BlockNumber btws_pages_alloced; /* # pages allocated */ + BlockNumber btws_pages_written; /* # pages written out */ Page btws_zeropage; /* workspace for filling zeroes */ } BTWriteState; @@ -208,7 +208,7 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2) ShowUsage("BTREE BUILD (Spool) STATISTICS"); ResetUsage(); } -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ tuplesort_performsort(btspool->sortstate); if (btspool2) @@ -566,7 +566,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup) oopaque->btpo_next = nblkno; nopaque->btpo_prev = oblkno; - nopaque->btpo_next = P_NONE; /* redundant */ + nopaque->btpo_next = P_NONE; /* redundant */ } /* diff --git a/src/backend/access/rmgrdesc/xlogdesc.c b/src/backend/access/rmgrdesc/xlogdesc.c index 5f07eb1499..2bf6de3332 100644 --- a/src/backend/access/rmgrdesc/xlogdesc.c +++ b/src/backend/access/rmgrdesc/xlogdesc.c @@ -26,7 +26,7 @@ const struct config_enum_entry wal_level_options[] = { {"minimal", WAL_LEVEL_MINIMAL, false}, {"replica", WAL_LEVEL_REPLICA, false}, - {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */ + {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */ {"hot_standby", WAL_LEVEL_REPLICA, true}, /* deprecated */ {"logical", WAL_LEVEL_LOGICAL, false}, {NULL, 0, false} diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c index 57d2612c47..8c420633f4 100644 --- a/src/backend/access/spgist/spgdoinsert.c +++ b/src/backend/access/spgist/spgdoinsert.c @@ -1004,7 +1004,7 @@ doPickSplit(Relation index, SpGistState *state, insertedNew = true; } for (i = 0; i < nToInsert; i++) - leafPageSelect[i] = 0; /* signifies current page */ + leafPageSelect[i] = 0; /* signifies current page */ } else if (in.nTuples == 1 && totalLeafSizes > SPGIST_PAGE_CAPACITY) { @@ -1076,12 +1076,12 @@ doPickSplit(Relation index, SpGistState *state, { if (leafSizes[i] <= curspace) { - nodePageSelect[i] = 0; /* signifies current page */ + nodePageSelect[i] = 0; /* signifies current page */ curspace -= leafSizes[i]; } else { - nodePageSelect[i] = 1; /* signifies new leaf page */ + nodePageSelect[i] = 1; /* signifies new leaf page */ newspace -= leafSizes[i]; } } diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index 9281050646..e1f9d87278 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -29,7 +29,7 @@ typedef void (*storeRes_func) (SpGistScanOpaque so, ItemPointer heapPtr, typedef struct ScanStackEntry { - Datum reconstructedValue; /* value reconstructed from parent */ + Datum reconstructedValue; /* value reconstructed from parent */ void *traversalValue; /* opclass-specific traverse value */ int level; /* level of items on this page */ ItemPointerData ptr; /* block and offset to scan from */ diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c index cce9b3f618..508d3e083f 100644 --- a/src/backend/access/spgist/spgvacuum.c +++ b/src/backend/access/spgist/spgvacuum.c @@ -34,7 +34,7 @@ typedef struct spgVacPendingItem { ItemPointerData tid; /* redirection target to visit */ bool done; /* have we dealt with this? */ - struct spgVacPendingItem *next; /* list link */ + struct spgVacPendingItem *next; /* list link */ } spgVacPendingItem; /* Local state for vacuum operations */ @@ -48,7 +48,7 @@ typedef struct spgBulkDeleteState /* Additional working state */ SpGistState spgstate; /* for SPGiST operations that need one */ - spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */ + spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */ TransactionId myXmin; /* for detecting newly-added redirects */ BlockNumber lastFilledBlock; /* last non-deletable block */ } spgBulkDeleteState; diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index bece57589e..ed1b1d8ce4 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -149,7 +149,7 @@ void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn) { - int pageno = TransactionIdToPage(xid); /* get page of parent */ + int pageno = TransactionIdToPage(xid); /* get page of parent */ int i; Assert(status == TRANSACTION_STATUS_COMMITTED || diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 92966d3b10..aba45b0a85 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -76,7 +76,7 @@ typedef struct SlruFlushData { int num_files; /* # files actually open */ int fd[MAX_FLUSH_BUFFERS]; /* their FD's */ - int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */ + int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */ } SlruFlushData; typedef struct SlruFlushData *SlruFlush; @@ -150,10 +150,10 @@ SimpleLruShmemSize(int nslots, int nlsns) sz = MAXALIGN(sizeof(SlruSharedData)); sz += MAXALIGN(nslots * sizeof(char *)); /* page_buffer[] */ sz += MAXALIGN(nslots * sizeof(SlruPageStatus)); /* page_status[] */ - sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */ - sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */ - sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */ - sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */ + sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */ + sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */ + sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */ + sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */ if (nlsns > 0) sz += MAXALIGN(nslots * nlsns * sizeof(XLogRecPtr)); /* group_lsn[] */ @@ -972,9 +972,9 @@ SlruSelectLRUPage(SlruCtl ctl, int pageno) int bestvalidslot = 0; /* keep compiler quiet */ int best_valid_delta = -1; int best_valid_page_number = 0; /* keep compiler quiet */ - int bestinvalidslot = 0; /* keep compiler quiet */ + int bestinvalidslot = 0; /* keep compiler quiet */ int best_invalid_delta = -1; - int best_invalid_page_number = 0; /* keep compiler quiet */ + int best_invalid_page_number = 0; /* keep compiler quiet */ /* See if page already has a buffer assigned */ for (slotno = 0; slotno < shared->num_slots; slotno++) diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c index 8cab8b9aa9..188008b4ca 100644 --- a/src/backend/access/transam/timeline.c +++ b/src/backend/access/transam/timeline.c @@ -261,7 +261,7 @@ findNewestTimeLine(TimeLineID startTLI) { if (existsTimeLineHistory(probeTLI)) { - newestTLI = probeTLI; /* probeTLI exists */ + newestTLI = probeTLI; /* probeTLI exists */ } else { diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 957457c979..9e6933e9e8 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -164,7 +164,7 @@ typedef struct GlobalTransactionData * track of the end LSN because that is the LSN we need to wait for prior * to commit. */ - XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */ + XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */ XLogRecPtr prepare_end_lsn; /* XLOG offset of prepare record end */ TransactionId xid; /* The GXACT id */ @@ -898,7 +898,7 @@ TwoPhaseGetDummyProc(TransactionId xid) /* * Header for a 2PC state file */ -#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */ +#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */ typedef struct TwoPhaseFileHeader { @@ -1024,7 +1024,7 @@ StartPrepare(GlobalTransaction gxact) hdr.nabortrels = smgrGetPendingDeletes(false, &abortrels); hdr.ninvalmsgs = xactGetCommittedInvalidationMessages(&invalmsgs, &hdr.initfileinval); - hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */ + hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */ save_state_data(&hdr, sizeof(TwoPhaseFileHeader)); save_state_data(gxact->gid, hdr.gidlen); diff --git a/src/backend/access/transam/twophase_rmgr.c b/src/backend/access/transam/twophase_rmgr.c index cdcc382f34..1cd03482d9 100644 --- a/src/backend/access/transam/twophase_rmgr.c +++ b/src/backend/access/transam/twophase_rmgr.c @@ -27,7 +27,7 @@ const TwoPhaseCallback twophase_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] = lock_twophase_recover, /* Lock */ NULL, /* pgstat */ multixact_twophase_recover, /* MultiXact */ - predicatelock_twophase_recover /* PredicateLock */ + predicatelock_twophase_recover /* PredicateLock */ }; const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] = @@ -35,7 +35,7 @@ const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] = NULL, /* END ID */ lock_twophase_postcommit, /* Lock */ pgstat_twophase_postcommit, /* pgstat */ - multixact_twophase_postcommit, /* MultiXact */ + multixact_twophase_postcommit, /* MultiXact */ NULL /* PredicateLock */ }; @@ -44,14 +44,14 @@ const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] = NULL, /* END ID */ lock_twophase_postabort, /* Lock */ pgstat_twophase_postabort, /* pgstat */ - multixact_twophase_postabort, /* MultiXact */ + multixact_twophase_postabort, /* MultiXact */ NULL /* PredicateLock */ }; const TwoPhaseCallback twophase_standby_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] = { NULL, /* END ID */ - lock_twophase_standby_recover, /* Lock */ + lock_twophase_standby_recover, /* Lock */ NULL, /* pgstat */ NULL, /* MultiXact */ NULL /* PredicateLock */ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index e09696c37f..e14be6b314 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -177,18 +177,18 @@ typedef struct TransactionStateData TBlockState blockState; /* high-level state */ int nestingLevel; /* transaction nesting depth */ int gucNestLevel; /* GUC context nesting depth */ - MemoryContext curTransactionContext; /* my xact-lifetime context */ + MemoryContext curTransactionContext; /* my xact-lifetime context */ ResourceOwner curTransactionOwner; /* my query resources */ TransactionId *childXids; /* subcommitted child XIDs, in XID order */ int nChildXids; /* # of subcommitted child XIDs */ int maxChildXids; /* allocated size of childXids[] */ Oid prevUser; /* previous CurrentUserId setting */ int prevSecContext; /* previous SecurityRestrictionContext */ - bool prevXactReadOnly; /* entry-time xact r/o state */ - bool startedInRecovery; /* did we start in recovery? */ + bool prevXactReadOnly; /* entry-time xact r/o state */ + bool startedInRecovery; /* did we start in recovery? */ bool didLogXid; /* has xid been included in WAL record? */ - int parallelModeLevel; /* Enter/ExitParallelMode counter */ - struct TransactionStateData *parent; /* back link to parent */ + int parallelModeLevel; /* Enter/ExitParallelMode counter */ + struct TransactionStateData *parent; /* back link to parent */ } TransactionStateData; typedef TransactionStateData *TransactionState; @@ -2641,8 +2641,7 @@ CleanupTransaction(void) * do abort cleanup processing */ AtCleanup_Portals(); /* now safe to release portal memory */ - AtEOXact_Snapshot(false, true); /* and release the transaction's - * snapshots */ + AtEOXact_Snapshot(false, true); /* and release the transaction's snapshots */ CurrentResourceOwner = NULL; /* and resource owner */ if (TopTransactionResourceOwner) @@ -3769,7 +3768,7 @@ DefineSavepoint(char *name) case TBLOCK_SUBINPROGRESS: /* Normal subtransaction start */ PushTransaction(); - s = CurrentTransactionState; /* changed by push */ + s = CurrentTransactionState; /* changed by push */ /* * Savepoint names, like the TransactionState block itself, live @@ -4080,7 +4079,7 @@ BeginInternalSubTransaction(char *name) case TBLOCK_SUBINPROGRESS: /* Normal subtransaction start */ PushTransaction(); - s = CurrentTransactionState; /* changed by push */ + s = CurrentTransactionState; /* changed by push */ /* * Savepoint names, like the TransactionState block itself, live diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index e386df7315..106210a883 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -86,8 +86,8 @@ extern uint32 bootstrap_data_checksum_version; /* User-settable parameters */ -int max_wal_size_mb = 1024; /* 1 GB */ -int min_wal_size_mb = 80; /* 80 MB */ +int max_wal_size_mb = 1024; /* 1 GB */ +int min_wal_size_mb = 80; /* 80 MB */ int wal_keep_segments = 0; int XLOGbuffers = -1; int XLogArchiveTimeout = 0; @@ -582,8 +582,7 @@ typedef struct XLogCtlData XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */ XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */ - XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG - * segment */ + XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG segment */ /* Fake LSN counter, for unlogged relations. Protected by ulsn_lck. */ XLogRecPtr unloggedLSN; @@ -784,7 +783,7 @@ static int readFile = -1; static XLogSegNo readSegNo = 0; static uint32 readOff = 0; static uint32 readLen = 0; -static XLogSource readSource = 0; /* XLOG_FROM_* code */ +static XLogSource readSource = 0; /* XLOG_FROM_* code */ /* * Keeps track of which source we're currently reading from. This is @@ -812,14 +811,14 @@ typedef struct XLogPageReadPrivate * XLogReceiptSource tracks where we last successfully read some WAL.) */ static TimestampTz XLogReceiptTime = 0; -static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */ +static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */ /* State information for XLOG reading */ static XLogRecPtr ReadRecPtr; /* start of last record read */ static XLogRecPtr EndRecPtr; /* end+1 of last record read */ -static XLogRecPtr minRecoveryPoint; /* local copy of - * ControlFile->minRecoveryPoint */ +static XLogRecPtr minRecoveryPoint; /* local copy of + * ControlFile->minRecoveryPoint */ static TimeLineID minRecoveryPointTLI; static bool updateMinRecoveryPoint = true; @@ -2020,7 +2019,7 @@ XLogRecPtrToBytePos(XLogRecPtr ptr) { result = fullsegs * UsableBytesInSegment + (XLOG_BLCKSZ - SizeOfXLogLongPHD) + /* account for first page */ - (fullpages - 1) * UsableBytesInPage; /* full pages */ + (fullpages - 1) * UsableBytesInPage; /* full pages */ if (offset > 0) { Assert(offset >= SizeOfXLogShortPHD); @@ -2508,7 +2507,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible) /* signal that we need to wakeup walsenders later */ WalSndWakeupRequest(); - LogwrtResult.Flush = LogwrtResult.Write; /* end of page */ + LogwrtResult.Flush = LogwrtResult.Write; /* end of page */ if (XLogArchivingActive()) XLogArchiveNotifySeg(openLogSegNo); @@ -4377,7 +4376,7 @@ static void WriteControlFile(void) { int fd; - char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ + char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ /* * Initialize version and compatibility-check fields @@ -6531,7 +6530,7 @@ StartupXLOG(void) ereport(LOG, (errmsg("using previous checkpoint record at %X/%X", (uint32) (checkPointLoc >> 32), (uint32) checkPointLoc))); - InRecovery = true; /* force recovery even if SHUTDOWNED */ + InRecovery = true; /* force recovery even if SHUTDOWNED */ } else ereport(PANIC, @@ -8835,7 +8834,7 @@ CreateCheckPoint(int flags) if (shutdown) { if (flags & CHECKPOINT_END_OF_RECOVERY) - LocalXLogInsertAllowed = -1; /* return to "check" state */ + LocalXLogInsertAllowed = -1; /* return to "check" state */ else LocalXLogInsertAllowed = 0; /* never again write WAL */ } @@ -9965,7 +9964,7 @@ xlog_outrec(StringInfo buf, XLogReaderState *record) appendStringInfoString(buf, " FPW"); } } -#endif /* WAL_DEBUG */ +#endif /* WAL_DEBUG */ /* * Returns a string describing an XLogRecord, consisting of its identity diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c index 6a02738479..c9cc6636d3 100644 --- a/src/backend/access/transam/xloginsert.c +++ b/src/backend/access/transam/xloginsert.c @@ -61,9 +61,9 @@ typedef struct } registered_buffer; static registered_buffer *registered_buffers; -static int max_registered_buffers; /* allocated size */ -static int max_registered_block_id = 0; /* highest block_id + 1 - * currently registered */ +static int max_registered_buffers; /* allocated size */ +static int max_registered_block_id = 0; /* highest block_id + 1 currently + * registered */ /* * A chain of XLogRecDatas to hold the "main data" of a WAL record, registered @@ -438,7 +438,7 @@ XLogInsert(RmgrId rmid, uint8 info) if (IsBootstrapProcessingMode() && rmid != RM_XLOG_ID) { XLogResetInsertion(); - EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */ + EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */ return EndPos; } diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index c3b1371764..d6b857f109 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -974,7 +974,7 @@ out: return found; } -#endif /* FRONTEND */ +#endif /* FRONTEND */ /* ---------------------------------------- diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index d2708cb33e..b9573973d2 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -46,7 +46,7 @@ #include "utils/relmapper.h" #include "utils/tqual.h" -uint32 bootstrap_data_checksum_version = 0; /* No checksum */ +uint32 bootstrap_data_checksum_version = 0; /* No checksum */ #define ALLOC(t, c) \ @@ -163,7 +163,7 @@ static struct typmap *Ap = NULL; static Datum values[MAXATTR]; /* current row's attribute values */ static bool Nulls[MAXATTR]; -static MemoryContext nogc = NULL; /* special no-gc mem context */ +static MemoryContext nogc = NULL; /* special no-gc mem context */ /* * At bootstrap time, we first declare all the indices to be built, and @@ -680,7 +680,7 @@ DefineAttr(char *name, char *type, int attnum, int nullness) namestrcpy(&attrtypes[attnum]->attname, name); elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type); - attrtypes[attnum]->attnum = attnum + 1; /* fillatt */ + attrtypes[attnum]->attnum = attnum + 1; /* fillatt */ typeoid = gettype(type); diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index 304e3c4bc3..de0a1ba833 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -157,7 +157,7 @@ dumpacl(Acl *acl) DatumGetCString(DirectFunctionCall1(aclitemout, PointerGetDatum(aip + i)))); } -#endif /* ACLDEBUG */ +#endif /* ACLDEBUG */ /* diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index cd82cb9f29..b12b36ed34 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -97,12 +97,12 @@ typedef struct } ObjectAddressExtra; /* ObjectAddressExtra flag bits */ -#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ -#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ -#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ -#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ -#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */ -#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */ +#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ +#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ +#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ +#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ +#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */ +#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */ /* expansible list of ObjectAddresses */ @@ -150,7 +150,7 @@ static const Oid object_classes[] = { OperatorClassRelationId, /* OCLASS_OPCLASS */ OperatorFamilyRelationId, /* OCLASS_OPFAMILY */ AccessMethodRelationId, /* OCLASS_AM */ - AccessMethodOperatorRelationId, /* OCLASS_AMOP */ + AccessMethodOperatorRelationId, /* OCLASS_AMOP */ AccessMethodProcedureRelationId, /* OCLASS_AMPROC */ RewriteRelationId, /* OCLASS_REWRITE */ TriggerRelationId, /* OCLASS_TRIGGER */ @@ -163,7 +163,7 @@ static const Oid object_classes[] = { AuthIdRelationId, /* OCLASS_ROLE */ DatabaseRelationId, /* OCLASS_DATABASE */ TableSpaceRelationId, /* OCLASS_TBLSPACE */ - ForeignDataWrapperRelationId, /* OCLASS_FDW */ + ForeignDataWrapperRelationId, /* OCLASS_FDW */ ForeignServerRelationId, /* OCLASS_FOREIGN_SERVER */ UserMappingRelationId, /* OCLASS_USER_MAPPING */ DefaultAclRelationId, /* OCLASS_DEFACL */ @@ -399,7 +399,7 @@ performMultipleDeletions(const ObjectAddresses *objects, findDependentObjects(thisobj, DEPFLAG_ORIGINAL, flags, - NULL, /* empty stack */ + NULL, /* empty stack */ targetObjects, objects, &depRel); @@ -1405,7 +1405,7 @@ recordDependencyOnSingleRelExpr(const ObjectAddress *depender, rte.type = T_RangeTblEntry; rte.rtekind = RTE_RELATION; rte.relid = relId; - rte.relkind = RELKIND_RELATION; /* no need for exactness here */ + rte.relkind = RELKIND_RELATION; /* no need for exactness here */ context.rtables = list_make1(list_make1(&rte)); @@ -1871,7 +1871,7 @@ find_expr_references_walker(Node *node, TargetEntry *tle = (TargetEntry *) lfirst(lc); if (tle->resjunk) - continue; /* ignore junk tlist items */ + continue; /* ignore junk tlist items */ add_object_address(OCLASS_CLASS, rte->relid, tle->resno, context->addrs); } diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 4e5b79ef94..8052dcc288 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -950,25 +950,25 @@ AddNewRelationType(const char *typeName, return TypeCreate(new_row_type, /* optional predetermined OID */ typeName, /* type name */ - typeNamespace, /* type namespace */ + typeNamespace, /* type namespace */ new_rel_oid, /* relation oid */ new_rel_kind, /* relation kind */ ownerid, /* owner's ID */ -1, /* internal size (varlena) */ TYPTYPE_COMPOSITE, /* type-type (composite) */ - TYPCATEGORY_COMPOSITE, /* type-category (ditto) */ + TYPCATEGORY_COMPOSITE, /* type-category (ditto) */ false, /* composite types are never preferred */ DEFAULT_TYPDELIM, /* default array delimiter */ F_RECORD_IN, /* input procedure */ F_RECORD_OUT, /* output procedure */ - F_RECORD_RECV, /* receive procedure */ - F_RECORD_SEND, /* send procedure */ + F_RECORD_RECV, /* receive procedure */ + F_RECORD_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ InvalidOid, /* analyze procedure - default */ InvalidOid, /* array element type - irrelevant */ false, /* this is not an array type */ - new_array_type, /* array type if any */ + new_array_type, /* array type if any */ InvalidOid, /* domain base type - irrelevant */ NULL, /* default value - none */ NULL, /* default binary representation */ @@ -1218,7 +1218,7 @@ heap_create_with_catalog(const char *relname, relarrayname = makeArrayTypeName(relname, relnamespace); - TypeCreate(new_array_oid, /* force the type's OID to this */ + TypeCreate(new_array_oid, /* force the type's OID to this */ relarrayname, /* Array type name */ relnamespace, /* Same namespace as parent */ InvalidOid, /* Not composite, no relationOid */ @@ -1560,7 +1560,7 @@ RemoveAttributeById(Oid relid, AttrNumber attnum) tuple = SearchSysCacheCopy2(ATTNUM, ObjectIdGetDatum(relid), Int16GetDatum(attnum)); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", attnum, relid); attStruct = (Form_pg_attribute) GETSTRUCT(tuple); @@ -1725,7 +1725,7 @@ RemoveAttrDefaultById(Oid attrdefId) tuple = SearchSysCacheCopy2(ATTNUM, ObjectIdGetDatum(myrelid), Int16GetDatum(myattnum)); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", myattnum, myrelid); @@ -2083,7 +2083,7 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, */ constrOid = CreateConstraintEntry(ccname, /* Constraint Name */ - RelationGetNamespace(rel), /* namespace */ + RelationGetNamespace(rel), /* namespace */ CONSTRAINT_CHECK, /* Constraint Type */ false, /* Is Deferrable */ false, /* Is Deferred */ @@ -2091,9 +2091,9 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, RelationGetRelid(rel), /* relation */ attNos, /* attrs in the constraint */ keycount, /* # attrs in the constraint */ - InvalidOid, /* not a domain constraint */ - InvalidOid, /* no associated index */ - InvalidOid, /* Foreign key fields */ + InvalidOid, /* not a domain constraint */ + InvalidOid, /* no associated index */ + InvalidOid, /* Foreign key fields */ NULL, NULL, NULL, @@ -2102,14 +2102,14 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, ' ', ' ', ' ', - NULL, /* not an exclusion constraint */ - expr, /* Tree form of check constraint */ + NULL, /* not an exclusion constraint */ + expr, /* Tree form of check constraint */ ccbin, /* Binary form of check constraint */ ccsrc, /* Source form of check constraint */ is_local, /* conislocal */ inhcount, /* coninhcount */ is_no_inherit, /* connoinherit */ - is_internal); /* internally constructed? */ + is_internal); /* internally constructed? */ pfree(ccbin); pfree(ccsrc); diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8a77444000..549a2d19c6 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -158,7 +158,7 @@ relationHasPrimaryKey(Relation rel) HeapTuple indexTuple; indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid)); - if (!HeapTupleIsValid(indexTuple)) /* should not happen */ + if (!HeapTupleIsValid(indexTuple)) /* should not happen */ elog(ERROR, "cache lookup failed for index %u", indexoid); result = ((Form_pg_index) GETSTRUCT(indexTuple))->indisprimary; ReleaseSysCache(indexTuple); @@ -332,7 +332,7 @@ ConstructTupleDescriptor(Relation heapRelation, /* * here we are indexing on a normal attribute (1...n) */ - if (atnum > natts) /* safety check */ + if (atnum > natts) /* safety check */ elog(ERROR, "invalid column number %d", atnum); from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)]; } @@ -420,7 +420,7 @@ ConstructTupleDescriptor(Relation heapRelation, /* * Set the attribute name as specified by caller. */ - if (colnames_item == NULL) /* shouldn't happen */ + if (colnames_item == NULL) /* shouldn't happen */ elog(ERROR, "too few entries in colnames list"); namestrcpy(&to->attname, (const char *) lfirst(colnames_item)); colnames_item = lnext(colnames_item); @@ -954,7 +954,7 @@ index_create(Relation heapRelation, else { elog(ERROR, "constraint must be PRIMARY, UNIQUE or EXCLUDE"); - constraintType = 0; /* keep compiler quiet */ + constraintType = 0; /* keep compiler quiet */ } index_constraint_create(heapRelation, @@ -964,9 +964,9 @@ index_create(Relation heapRelation, constraintType, deferrable, initdeferred, - false, /* already marked primary */ - false, /* pg_index entry is OK */ - false, /* no old dependencies */ + false, /* already marked primary */ + false, /* pg_index entry is OK */ + false, /* no old dependencies */ allow_system_table_mods, is_internal); } @@ -1205,7 +1205,7 @@ index_constraint_create(Relation heapRelation, indexInfo->ii_KeyAttrNumbers, indexInfo->ii_NumIndexAttrs, InvalidOid, /* no domain */ - indexRelationId, /* index OID */ + indexRelationId, /* index OID */ InvalidOid, /* no foreign key */ NULL, NULL, @@ -1216,12 +1216,12 @@ index_constraint_create(Relation heapRelation, ' ', ' ', indexInfo->ii_ExclusionOps, - NULL, /* no check constraint */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ + true, /* islocal */ 0, /* inhcount */ - true, /* noinherit */ + true, /* noinherit */ is_internal); /* @@ -2259,7 +2259,7 @@ IndexBuildHeapRangeScan(Relation heapRelation, if (IsBootstrapProcessingMode() || indexInfo->ii_Concurrent) { snapshot = RegisterSnapshot(GetTransactionSnapshot()); - OldestXmin = InvalidTransactionId; /* not used */ + OldestXmin = InvalidTransactionId; /* not used */ /* "any visible" mode is not compatible with this */ Assert(!anyvisible); @@ -2272,8 +2272,8 @@ IndexBuildHeapRangeScan(Relation heapRelation, } scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ allow_sync); /* syncscan OK? */ @@ -2524,7 +2524,7 @@ IndexBuildHeapRangeScan(Relation heapRelation, break; default: elog(ERROR, "unexpected HeapTupleSatisfiesVacuum result"); - indexIt = tupleIsAlive = false; /* keep compiler quiet */ + indexIt = tupleIsAlive = false; /* keep compiler quiet */ break; } @@ -2677,8 +2677,8 @@ IndexCheckExclusion(Relation heapRelation, */ snapshot = RegisterSnapshot(GetLatestSnapshot()); scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ true); /* syncscan OK */ @@ -2997,8 +2997,8 @@ validate_index_heapscan(Relation heapRelation, * match the sorted TIDs. */ scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ false); /* syncscan not OK */ diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c index abc344ad69..e5b6bafaff 100644 --- a/src/backend/catalog/indexing.c +++ b/src/backend/catalog/indexing.c @@ -42,7 +42,7 @@ CatalogOpenIndexes(Relation heapRel) ResultRelInfo *resultRelInfo; resultRelInfo = makeNode(ResultRelInfo); - resultRelInfo->ri_RangeTableIndex = 1; /* dummy */ + resultRelInfo->ri_RangeTableIndex = 1; /* dummy */ resultRelInfo->ri_RelationDesc = heapRel; resultRelInfo->ri_TrigDesc = NULL; /* we don't fire triggers */ @@ -136,7 +136,7 @@ CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple) index_insert(relationDescs[i], /* index relation */ values, /* array of index Datums */ isnull, /* is-null flags */ - &(heapTuple->t_self), /* tid of heap tuple */ + &(heapTuple->t_self), /* tid of heap tuple */ heapRelation, relationDescs[i]->rd_index->indisunique ? UNIQUE_CHECK_YES : UNIQUE_CHECK_NO, diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index 94755d687b..2938501917 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -157,7 +157,7 @@ static bool baseSearchPathValid = true; typedef struct { List *searchPath; /* the desired search path */ - Oid creationNamespace; /* the desired creation namespace */ + Oid creationNamespace; /* the desired creation namespace */ int nestLevel; /* subtransaction nesting level */ } OverrideStackEntry; @@ -273,7 +273,7 @@ RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, if (relation->relpersistence == RELPERSISTENCE_TEMP) { if (!OidIsValid(myTempNamespace)) - relId = InvalidOid; /* this probably can't happen? */ + relId = InvalidOid; /* this probably can't happen? */ else { if (relation->schemaname) @@ -1665,7 +1665,7 @@ OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok) /* We have a match with a previous result */ Assert(pathpos != prevResult->pathpos); if (pathpos > prevResult->pathpos) - continue; /* keep previous result */ + continue; /* keep previous result */ /* replace previous result */ prevResult->pathpos = pathpos; prevResult->oid = HeapTupleGetOid(opertup); @@ -3428,7 +3428,7 @@ PopOverrideSearchPath(void) entry = (OverrideStackEntry *) linitial(overrideStack); activeSearchPath = entry->searchPath; activeCreationNamespace = entry->creationNamespace; - activeTempCreationPending = false; /* XXX is this OK? */ + activeTempCreationPending = false; /* XXX is this OK? */ } else { @@ -3876,7 +3876,7 @@ AtEOXact_Namespace(bool isCommit, bool parallel) { myTempNamespace = InvalidOid; myTempToastNamespace = InvalidOid; - baseSearchPathValid = false; /* need to rebuild list */ + baseSearchPathValid = false; /* need to rebuild list */ } myTempNamespaceSubID = InvalidSubTransactionId; } @@ -3928,7 +3928,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, /* TEMP namespace creation failed, so reset state */ myTempNamespace = InvalidOid; myTempToastNamespace = InvalidOid; - baseSearchPathValid = false; /* need to rebuild list */ + baseSearchPathValid = false; /* need to rebuild list */ } } @@ -3953,7 +3953,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, entry = (OverrideStackEntry *) linitial(overrideStack); activeSearchPath = entry->searchPath; activeCreationNamespace = entry->creationNamespace; - activeTempCreationPending = false; /* XXX is this OK? */ + activeTempCreationPending = false; /* XXX is this OK? */ } else { diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index 791322a803..b882d5f0e1 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -97,19 +97,18 @@ typedef struct Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ int oid_catcache_id; /* id of catcache on system oid column */ - int name_catcache_id; /* id of catcache on (name,namespace), - * or (name) if the object does not - * live in a namespace */ + int name_catcache_id; /* id of catcache on (name,namespace), or + * (name) if the object does not live in a + * namespace */ AttrNumber attnum_name; /* attnum of name field */ - AttrNumber attnum_namespace; /* attnum of namespace field */ + AttrNumber attnum_namespace; /* attnum of namespace field */ AttrNumber attnum_owner; /* attnum of owner field */ AttrNumber attnum_acl; /* attnum of acl field */ AclObjectKind acl_kind; /* ACL_KIND_* of this object type */ - bool is_nsp_name_unique; /* can the nsp/name combination (or - * name alone, if there's no - * namespace) be considered a unique - * identifier for an object of this - * class? */ + bool is_nsp_name_unique; /* can the nsp/name combination (or name + * alone, if there's no namespace) be + * considered a unique identifier for an + * object of this class? */ } ObjectPropertyType; static const ObjectPropertyType ObjectProperty[] = diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c index b9cca29ea3..e563b8548b 100644 --- a/src/backend/catalog/partition.c +++ b/src/backend/catalog/partition.c @@ -1553,7 +1553,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec) */ i = 0; partexprs_item = list_head(key->partexprs); - partexprs_item_saved = partexprs_item; /* placate compiler */ + partexprs_item_saved = partexprs_item; /* placate compiler */ forboth(cell1, spec->lowerdatums, cell2, spec->upperdatums) { EState *estate; diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 65c2e88e93..aa45c141a4 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -83,9 +83,9 @@ AggregateCreate(const char *aggName, Oid finalfn = InvalidOid; /* can be omitted */ Oid combinefn = InvalidOid; /* can be omitted */ Oid serialfn = InvalidOid; /* can be omitted */ - Oid deserialfn = InvalidOid; /* can be omitted */ + Oid deserialfn = InvalidOid; /* can be omitted */ Oid mtransfn = InvalidOid; /* can be omitted */ - Oid minvtransfn = InvalidOid; /* can be omitted */ + Oid minvtransfn = InvalidOid; /* can be omitted */ Oid mfinalfn = InvalidOid; /* can be omitted */ Oid sortop = InvalidOid; /* can be omitted */ Oid *aggArgTypes = parameterTypes->values; @@ -605,30 +605,30 @@ AggregateCreate(const char *aggName, myself = ProcedureCreate(aggName, aggNamespace, - false, /* no replacement */ - false, /* doesn't return a set */ + false, /* no replacement */ + false, /* doesn't return a set */ finaltype, /* returnType */ - GetUserId(), /* proowner */ - INTERNALlanguageId, /* languageObjectId */ - InvalidOid, /* no validator */ + GetUserId(), /* proowner */ + INTERNALlanguageId, /* languageObjectId */ + InvalidOid, /* no validator */ "aggregate_dummy", /* placeholder proc */ - NULL, /* probin */ - true, /* isAgg */ - false, /* isWindowFunc */ - false, /* security invoker (currently not - * definable for agg) */ - false, /* isLeakProof */ - false, /* isStrict (not needed for agg) */ - PROVOLATILE_IMMUTABLE, /* volatility (not - * needed for agg) */ + NULL, /* probin */ + true, /* isAgg */ + false, /* isWindowFunc */ + false, /* security invoker (currently not + * definable for agg) */ + false, /* isLeakProof */ + false, /* isStrict (not needed for agg) */ + PROVOLATILE_IMMUTABLE, /* volatility (not needed + * for agg) */ proparallel, parameterTypes, /* paramTypes */ allParameterTypes, /* allParamTypes */ parameterModes, /* parameterModes */ parameterNames, /* parameterNames */ parameterDefaults, /* parameterDefaults */ - PointerGetDatum(NULL), /* trftypes */ - PointerGetDatum(NULL), /* proconfig */ + PointerGetDatum(NULL), /* trftypes */ + PointerGetDatum(NULL), /* proconfig */ 1, /* procost */ 0); /* prorows */ procOid = myself.objectId; diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index e5ae3d9292..60ccaa08b0 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -576,7 +576,7 @@ RemoveConstraintById(Oid conId) con->conrelid); classForm = (Form_pg_class) GETSTRUCT(relTup); - if (classForm->relchecks == 0) /* should not happen */ + if (classForm->relchecks == 0) /* should not happen */ elog(ERROR, "relation \"%s\" has relchecks = 0", RelationGetRelationName(rel)); classForm->relchecks--; @@ -928,7 +928,7 @@ get_primary_key_attnos(Oid relid, bool deferrableOk, Oid *constraintOid) if (isNull) elog(ERROR, "null conkey for constraint %u", HeapTupleGetOid(tuple)); - arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ + arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ numkeys = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || numkeys < 0 || diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index b5cbc04889..370683823f 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -225,7 +225,7 @@ OperatorShellMake(const char *operatorName, for (i = 0; i < Natts_pg_operator; ++i) { nulls[i] = false; - values[i] = (Datum) NULL; /* redundant, but safe */ + values[i] = (Datum) NULL; /* redundant, but safe */ } /* diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c index 6b0e4f4729..6172973343 100644 --- a/src/backend/catalog/pg_type.c +++ b/src/backend/catalog/pg_type.c @@ -79,7 +79,7 @@ TypeShellMake(const char *typeName, Oid typeNamespace, Oid ownerId) for (i = 0; i < Natts_pg_type; ++i) { nulls[i] = false; - values[i] = (Datum) NULL; /* redundant, but safe */ + values[i] = (Datum) NULL; /* redundant, but safe */ } /* @@ -214,7 +214,7 @@ TypeCreate(Oid newTypeOid, bool isImplicitArray, Oid arrayType, Oid baseType, - const char *defaultTypeValue, /* human readable rep */ + const char *defaultTypeValue, /* human readable rep */ char *defaultTypeBin, /* cooked rep */ bool passedByValue, char alignment, @@ -511,8 +511,8 @@ TypeCreate(Oid newTypeOid, void GenerateTypeDependencies(Oid typeNamespace, Oid typeObjectId, - Oid relationOid, /* only for relation rowtypes */ - char relationKind, /* ditto */ + Oid relationOid, /* only for relation rowtypes */ + char relationKind, /* ditto */ Oid owner, Oid inputProcedure, Oid outputProcedure, diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index f677916d03..9a5fde00ca 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -58,7 +58,7 @@ typedef struct PendingRelDelete BackendId backend; /* InvalidBackendId if not a temp rel */ bool atCommit; /* T=delete at commit; F=delete at abort */ int nestLevel; /* xact nesting level of request */ - struct PendingRelDelete *next; /* linked-list link */ + struct PendingRelDelete *next; /* linked-list link */ } PendingRelDelete; static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index a84c61493f..b204b19c72 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -416,8 +416,8 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List /* * Most of the argument-checking is done inside of AggregateCreate */ - return AggregateCreate(aggName, /* aggregate name */ - aggNamespace, /* namespace */ + return AggregateCreate(aggName, /* aggregate name */ + aggNamespace, /* namespace */ aggKind, numArgs, numDirectArgs, @@ -427,22 +427,22 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List PointerGetDatum(parameterNames), parameterDefaults, variadicArgType, - transfuncName, /* step function name */ - finalfuncName, /* final function name */ - combinefuncName, /* combine function name */ - serialfuncName, /* serial function name */ + transfuncName, /* step function name */ + finalfuncName, /* final function name */ + combinefuncName, /* combine function name */ + serialfuncName, /* serial function name */ deserialfuncName, /* deserial function name */ - mtransfuncName, /* fwd trans function name */ + mtransfuncName, /* fwd trans function name */ minvtransfuncName, /* inv trans function name */ - mfinalfuncName, /* final function name */ + mfinalfuncName, /* final function name */ finalfuncExtraArgs, mfinalfuncExtraArgs, sortoperatorName, /* sort operator name */ transTypeId, /* transition data type */ transSpace, /* transition space */ - mtransTypeId, /* transition data type */ + mtransTypeId, /* transition data type */ mtransSpace, /* transition space */ - initval, /* initial condition */ + initval, /* initial condition */ minitval, /* initial condition */ - proparallel); /* parallel safe? */ + proparallel); /* parallel safe? */ } diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c index 4d3fe8c745..e5f0b75a86 100644 --- a/src/backend/commands/alter.c +++ b/src/backend/commands/alter.c @@ -408,7 +408,7 @@ ExecRenameStmt(RenameStmt *stmt) default: elog(ERROR, "unrecognized rename stmt type: %d", (int) stmt->renameType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } @@ -525,7 +525,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt, default: elog(ERROR, "unrecognized AlterObjectSchemaStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } if (oldSchemaAddr) @@ -880,7 +880,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) default: elog(ERROR, "unrecognized AlterOwnerStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index ecdd8950ee..a19c6c25e6 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -452,7 +452,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params, /* Found an index expression */ Node *indexkey; - if (indexpr_item == NULL) /* shouldn't happen */ + if (indexpr_item == NULL) /* shouldn't happen */ elog(ERROR, "too few entries in indexprs list"); indexkey = (Node *) lfirst(indexpr_item); indexpr_item = lnext(indexpr_item); @@ -1545,7 +1545,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) i = Anum_pg_statistic_stakind1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { - values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ + values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ } i = Anum_pg_statistic_staop1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) @@ -1860,7 +1860,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = total_width / (double) nonnull_cnt; else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } else if (null_cnt > 0) { @@ -1871,7 +1871,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } } @@ -2224,7 +2224,7 @@ compute_distinct_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ @@ -2774,7 +2774,7 @@ compute_scalar_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 87b215d8d3..9befe0492a 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -245,7 +245,7 @@ typedef struct AsyncQueueControl QueuePosition head; /* head points to the next free location */ QueuePosition tail; /* the global tail is equivalent to the pos of * the "slowest" backend */ - TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ + TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ QueueBackendStatus backend[FLEXIBLE_ARRAY_MEMBER]; /* backend[0] is not used; used entries are from [1] to [MaxBackends] */ } AsyncQueueControl; @@ -265,7 +265,7 @@ static SlruCtlData AsyncCtlData; #define AsyncCtl (&AsyncCtlData) #define QUEUE_PAGESIZE BLCKSZ -#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ +#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ /* * slru.c currently assumes that all filenames are four characters of hex @@ -291,7 +291,7 @@ static SlruCtlData AsyncCtlData; * (ie, have committed a LISTEN on). It is a simple list of channel names, * allocated in TopMemoryContext. */ -static List *listenChannels = NIL; /* list of C strings */ +static List *listenChannels = NIL; /* list of C strings */ /* * State for pending LISTEN/UNLISTEN actions consists of an ordered list of @@ -316,7 +316,7 @@ typedef struct char channel[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */ } ListenAction; -static List *pendingActions = NIL; /* list of ListenAction */ +static List *pendingActions = NIL; /* list of ListenAction */ static List *upperPendingActions = NIL; /* list of upper-xact lists */ @@ -342,9 +342,9 @@ typedef struct Notification char *payload; /* payload string (can be empty) */ } Notification; -static List *pendingNotifies = NIL; /* list of Notifications */ +static List *pendingNotifies = NIL; /* list of Notifications */ -static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ +static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ /* * Inbound notifications are initially processed by HandleNotifyInterrupt(), @@ -1184,7 +1184,7 @@ asyncQueueUnregister(void) { bool advanceTail; - Assert(listenChannels == NIL); /* else caller error */ + Assert(listenChannels == NIL); /* else caller error */ if (!amRegisteredListener) /* nothing to do */ return; @@ -1825,7 +1825,7 @@ asyncQueueReadAllNotifications(void) /* we only want to read as far as head */ copysize = QUEUE_POS_OFFSET(head) - curoffset; if (copysize < 0) - copysize = 0; /* just for safety */ + copysize = 0; /* just for safety */ } else { diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ef1abf34ab..1cc5309426 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -325,7 +325,7 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose) * Check that the index is still the one with indisclustered set. */ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid)); - if (!HeapTupleIsValid(tuple)) /* probably can't happen */ + if (!HeapTupleIsValid(tuple)) /* probably can't happen */ { relation_close(OldHeap, AccessExclusiveLock); return; diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index 91b65b174d..e805b7cfc4 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -417,7 +417,7 @@ get_icu_locale_comment(const char *localename) return result; } -#endif /* USE_ICU */ +#endif /* USE_ICU */ Datum @@ -552,7 +552,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS) if (count == 0) ereport(WARNING, (errmsg("no usable system locales were found"))); -#endif /* not HAVE_LOCALE_T && not WIN32 */ +#endif /* not HAVE_LOCALE_T && not WIN32 */ #ifdef USE_ICU if (!is_encoding_supported_by_icu(GetDatabaseEncoding())) diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index ff32d04189..ec6011cdb8 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -102,7 +102,7 @@ typedef struct CopyStateData bool fe_eof; /* true if detected end of copy data */ EolType eol_type; /* EOL type of input */ int file_encoding; /* file or remote side's character encoding */ - bool need_transcoding; /* file encoding diff from server? */ + bool need_transcoding; /* file encoding diff from server? */ bool encoding_embeds_ascii; /* ASCII can be non-first byte? */ /* parameters from the COPY command */ @@ -119,17 +119,17 @@ typedef struct CopyStateData bool header_line; /* CSV header line? */ char *null_print; /* NULL marker string (server encoding!) */ int null_print_len; /* length of same */ - char *null_print_client; /* same converted to file encoding */ + char *null_print_client; /* same converted to file encoding */ char *delim; /* column delimiter (must be 1 byte) */ char *quote; /* CSV quote char (must be 1 byte) */ char *escape; /* CSV escape char (must be 1 byte) */ List *force_quote; /* list of column names */ bool force_quote_all; /* FORCE_QUOTE *? */ - bool *force_quote_flags; /* per-column CSV FQ flags */ + bool *force_quote_flags; /* per-column CSV FQ flags */ List *force_notnull; /* list of column names */ bool *force_notnull_flags; /* per-column CSV FNN flags */ List *force_null; /* list of column names */ - bool *force_null_flags; /* per-column CSV FN flags */ + bool *force_null_flags; /* per-column CSV FN flags */ bool convert_selectively; /* do selective binary conversion? */ List *convert_select; /* list of column names (can be NIL) */ bool *convert_select_flags; /* per-column CSV/TEXT CS flags */ @@ -162,7 +162,7 @@ typedef struct CopyStateData Oid *typioparams; /* array of element types for in_functions */ int *defmap; /* array of default att numbers */ ExprState **defexprs; /* array of default att expressions */ - bool volatile_defexprs; /* is any of defexprs volatile? */ + bool volatile_defexprs; /* is any of defexprs volatile? */ List *range_table; PartitionDispatch *partition_dispatch_info; @@ -195,7 +195,7 @@ typedef struct CopyStateData * can display it in error messages if appropriate. */ StringInfoData line_buf; - bool line_buf_converted; /* converted to server encoding? */ + bool line_buf_converted; /* converted to server encoding? */ bool line_buf_valid; /* contains the row being processed? */ /* @@ -355,10 +355,10 @@ SendCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'H'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; } @@ -388,10 +388,10 @@ ReceiveCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'G'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; cstate->fe_msgbuf = makeStringInfo(); @@ -609,20 +609,20 @@ CopyGetData(CopyState cstate, void *databuf, int minread, int maxread) RESUME_CANCEL_INTERRUPTS(); switch (mtype) { - case 'd': /* CopyData */ + case 'd': /* CopyData */ break; - case 'c': /* CopyDone */ + case 'c': /* CopyDone */ /* COPY IN correctly terminated by frontend */ cstate->fe_eof = true; return bytesread; - case 'f': /* CopyFail */ + case 'f': /* CopyFail */ ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED), errmsg("COPY from stdin failed: %s", pq_getmsgstring(cstate->fe_msgbuf)))); break; - case 'H': /* Flush */ - case 'S': /* Sync */ + case 'H': /* Flush */ + case 'S': /* Sync */ /* * Ignore Flush/Sync for the convenience of client @@ -1697,7 +1697,7 @@ BeginCopy(ParseState *pstate, /* See Multibyte encoding comment above */ cstate->encoding_embeds_ascii = PG_ENCODING_IS_CLIENT_ONLY(cstate->file_encoding); - cstate->copy_dest = COPY_FILE; /* default */ + cstate->copy_dest = COPY_FILE; /* default */ MemoryContextSwitchTo(oldcontext); @@ -1951,7 +1951,7 @@ CopyTo(CopyState cstate) tupDesc = cstate->queryDesc->tupDesc; attr = tupDesc->attrs; num_phys_attrs = tupDesc->natts; - cstate->null_print_client = cstate->null_print; /* default */ + cstate->null_print_client = cstate->null_print; /* default */ /* We use fe_msgbuf as a per-row buffer regardless of copy_dest */ cstate->fe_msgbuf = makeStringInfo(); @@ -3707,8 +3707,8 @@ CopyReadLineText(CopyState cstate) if (c == '\n') { - raw_buf_ptr++; /* eat newline */ - cstate->eol_type = EOL_CRNL; /* in case not set yet */ + raw_buf_ptr++; /* eat newline */ + cstate->eol_type = EOL_CRNL; /* in case not set yet */ } else { @@ -4458,7 +4458,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); @@ -4518,7 +4518,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 11038f6764..96ab6f23cd 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -322,7 +322,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt) * won't change underneath us. */ if (!dbtemplate) - dbtemplate = "template1"; /* Default template database name */ + dbtemplate = "template1"; /* Default template database name */ if (!get_db_info(dbtemplate, ShareLock, &src_dboid, &src_owner, &src_encoding, @@ -1284,7 +1284,7 @@ movedb(const char *dbname, const char *tblspcname) sysscan = systable_beginscan(pgdbrel, DatabaseNameIndexId, true, NULL, 1, &scankey); oldtuple = systable_getnext(sysscan); - if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ + if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_DATABASE), errmsg("database \"%s\" does not exist", dbname))); diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index 4cfab418a6..48a6375559 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -57,8 +57,8 @@ typedef struct EventTriggerQueryState bool in_sql_drop; /* table_rewrite */ - Oid table_rewrite_oid; /* InvalidOid, or set for - * table_rewrite event */ + Oid table_rewrite_oid; /* InvalidOid, or set for table_rewrite + * event */ int table_rewrite_reason; /* AT_REWRITE reason */ /* Support for command collection */ diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 91f9cac786..a40b5ec4de 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -96,7 +96,7 @@ typedef struct ExtensionVersionInfo /* working state for Dijkstra's algorithm: */ bool distance_known; /* is distance from start known yet? */ int distance; /* current worst-case distance estimate */ - struct ExtensionVersionInfo *previous; /* current best predecessor */ + struct ExtensionVersionInfo *previous; /* current best predecessor */ } ExtensionVersionInfo; /* Local functions */ @@ -2387,7 +2387,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", CurrentExtensionObject); @@ -2433,7 +2433,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) { if (arrayData[i] == tableoid) { - arrayIndex = i + 1; /* replace this element instead */ + arrayIndex = i + 1; /* replace this element instead */ break; } } @@ -2535,7 +2535,7 @@ extension_config_remove(Oid extensionoid, Oid tableoid) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionoid); @@ -2736,7 +2736,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionOid); @@ -2801,7 +2801,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o dep.objectId = pg_depend->objid; dep.objectSubId = pg_depend->objsubid; - if (dep.objectSubId != 0) /* should not happen */ + if (dep.objectSubId != 0) /* should not happen */ elog(ERROR, "extension should not have a sub-object dependency"); /* Relocate the object */ diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 2e26090bf9..1a165d5b0c 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -201,7 +201,7 @@ interpret_function_parameter_list(ParseState *pstate, ListCell *x; int i; - *variadicArgType = InvalidOid; /* default result */ + *variadicArgType = InvalidOid; /* default result */ *requiredResultType = InvalidOid; /* default result */ inTypes = (Oid *) palloc(parameterCount * sizeof(Oid)); @@ -562,7 +562,7 @@ interpret_func_parallel(DefElem *defel) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("parameter \"parallel\" must be SAFE, RESTRICTED, or UNSAFE"))); - return PROPARALLEL_UNSAFE; /* keep compiler quiet */ + return PROPARALLEL_UNSAFE; /* keep compiler quiet */ } } @@ -1090,7 +1090,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt) languageValidator, prosrc_str, /* converted to text later */ probin_str, /* converted to text later */ - false, /* not an aggregate */ + false, /* not an aggregate */ isWindowFunc, security, isLeakProof, @@ -1146,7 +1146,7 @@ RemoveFunctionById(Oid funcOid) relation = heap_open(AggregateRelationId, RowExclusiveLock); tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcOid)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for pg_aggregate tuple for function %u", funcOid); CatalogTupleDelete(relation, &tup->t_self); @@ -1326,7 +1326,7 @@ SetFunctionReturnType(Oid funcOid, Oid newRetType) elog(ERROR, "cache lookup failed for function %u", funcOid); procForm = (Form_pg_proc) GETSTRUCT(tup); - if (procForm->prorettype != OPAQUEOID) /* caller messed up */ + if (procForm->prorettype != OPAQUEOID) /* caller messed up */ elog(ERROR, "function %u doesn't return OPAQUE", funcOid); /* okay to overwrite copied tuple */ diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index c0902794e9..e3f2dcfa8c 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -645,7 +645,7 @@ DefineIndex(Oid relationId, else { elog(ERROR, "unknown constraint type"); - constraint_type = NULL; /* keep compiler quiet */ + constraint_type = NULL; /* keep compiler quiet */ } ereport(DEBUG1, @@ -909,7 +909,7 @@ DefineIndex(Oid relationId, newer_snapshots[k])) break; } - if (k >= n_newer_snapshots) /* not there anymore */ + if (k >= n_newer_snapshots) /* not there anymore */ SetInvalidVirtualTransactionId(old_snapshots[j]); } pfree(newer_snapshots); @@ -1704,9 +1704,9 @@ ChooseIndexColumnNames(List *indexElems) /* Get the preliminary name from the IndexElem */ if (ielem->indexcolname) - origname = ielem->indexcolname; /* caller-specified name */ + origname = ielem->indexcolname; /* caller-specified name */ else if (ielem->name) - origname = ielem->name; /* simple column reference */ + origname = ielem->name; /* simple column reference */ else origname = "expr"; /* default name for expression */ diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index ab51d1a417..512014438b 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -856,7 +856,7 @@ AlterOpFamilyAdd(AlterOpFamilyStmt *stmt, Oid amoid, Oid opfamilyoid, ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("operator argument types must be specified in ALTER OPERATOR FAMILY"))); - operOid = InvalidOid; /* keep compiler quiet */ + operOid = InvalidOid; /* keep compiler quiet */ } if (item->order_family) diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 739d5875eb..c7e7676611 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -70,16 +70,16 @@ DefineOperator(List *names, List *parameters) char *oprName; Oid oprNamespace; AclResult aclresult; - bool canMerge = false; /* operator merges */ + bool canMerge = false; /* operator merges */ bool canHash = false; /* operator hashes */ - List *functionName = NIL; /* function for operator */ - TypeName *typeName1 = NULL; /* first type name */ - TypeName *typeName2 = NULL; /* second type name */ + List *functionName = NIL; /* function for operator */ + TypeName *typeName1 = NULL; /* first type name */ + TypeName *typeName2 = NULL; /* second type name */ Oid typeId1 = InvalidOid; /* types converted to OID */ Oid typeId2 = InvalidOid; Oid rettype; List *commutatorName = NIL; /* optional commutator operator name */ - List *negatorName = NIL; /* optional negator operator name */ + List *negatorName = NIL; /* optional negator operator name */ List *restrictionName = NIL; /* optional restrict. sel. procedure */ List *joinName = NIL; /* optional join sel. procedure */ Oid functionOid; /* functions converted to OID */ @@ -243,9 +243,9 @@ DefineOperator(List *names, List *parameters) oprNamespace, /* namespace */ typeId1, /* left type id */ typeId2, /* right type id */ - functionOid, /* function for operator */ + functionOid, /* function for operator */ commutatorName, /* optional commutator operator name */ - negatorName, /* optional negator operator name */ + negatorName, /* optional negator operator name */ restrictionOid, /* optional restrict. sel. procedure */ joinOid, /* optional join sel. procedure name */ canMerge, /* operator merges */ diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 167910fcb5..46369cf3db 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -403,7 +403,7 @@ PersistHoldablePortal(Portal portal) /* * Now shut down the inner executor. */ - portal->queryDesc = NULL; /* prevent double shutdown */ + portal->queryDesc = NULL; /* prevent double shutdown */ ExecutorFinish(queryDesc); ExecutorEnd(queryDesc); FreeQueryDesc(queryDesc); diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index a4fbc05a12..4d555f1f5c 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -161,18 +161,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplinline, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplinline, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -204,18 +204,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplvalidator, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplvalidator, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -533,7 +533,7 @@ DropProceduralLanguageById(Oid langOid) rel = heap_open(LanguageRelationId, RowExclusiveLock); langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid)); - if (!HeapTupleIsValid(langTup)) /* should not happen */ + if (!HeapTupleIsValid(langTup)) /* should not happen */ elog(ERROR, "cache lookup failed for language %u", langOid); CatalogTupleDelete(rel, &langTup->t_self); diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 031bbc874d..58bda55837 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -611,7 +611,7 @@ nextval_internal(Oid relid, bool check_permissions) */ PreventCommandIfParallelMode("nextval()"); - if (elm->last != elm->cached) /* some numbers were cached */ + if (elm->last != elm->cached) /* some numbers were cached */ { Assert(elm->last_valid); Assert(elm->increment != 0); @@ -1455,7 +1455,7 @@ init_params(ParseState *pstate, List *options, bool for_identity, seqform->seqmax = PG_INT64_MAX; } else - seqform->seqmax = -1; /* descending seq */ + seqform->seqmax = -1; /* descending seq */ seqdataform->log_cnt = 0; } @@ -1532,9 +1532,9 @@ init_params(ParseState *pstate, List *options, bool for_identity, else if (isInit) { if (seqform->seqincrement > 0) - seqform->seqstart = seqform->seqmin; /* ascending seq */ + seqform->seqstart = seqform->seqmin; /* ascending seq */ else - seqform->seqstart = seqform->seqmax; /* descending seq */ + seqform->seqstart = seqform->seqmax; /* descending seq */ } /* crosscheck START */ diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 758c876ef3..207241cb92 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -138,17 +138,17 @@ static List *on_commits = NIL; * a pass determined by subcommand type. */ -#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ -#define AT_PASS_DROP 0 /* DROP (all flavors) */ -#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ -#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ -#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ -#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ +#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ +#define AT_PASS_DROP 0 /* DROP (all flavors) */ +#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ +#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ +#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ +#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ /* We could support a RENAME COLUMN pass here, but not currently used */ -#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ -#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ -#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ -#define AT_PASS_MISC 8 /* other stuff */ +#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ +#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ +#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ +#define AT_PASS_MISC 8 /* other stuff */ #define AT_NUM_PASSES 9 typedef struct AlteredTableInfo @@ -166,13 +166,13 @@ typedef struct AlteredTableInfo int rewrite; /* Reason for forced rewrite, if any */ Oid newTableSpace; /* new tablespace; 0 means no change */ bool chgPersistence; /* T if SET LOGGED/UNLOGGED is used */ - char newrelpersistence; /* if above is true */ + char newrelpersistence; /* if above is true */ Expr *partition_constraint; /* for attach partition validation */ /* Objects to rebuild after completing ALTER TYPE operations */ List *changedConstraintOids; /* OIDs of constraints to rebuild */ List *changedConstraintDefs; /* string definitions of same */ - List *changedIndexOids; /* OIDs of indexes to rebuild */ - List *changedIndexDefs; /* string definitions of same */ + List *changedIndexOids; /* OIDs of indexes to rebuild */ + List *changedIndexDefs; /* string definitions of same */ } AlteredTableInfo; /* Struct describing one new constraint to check in Phase 3 scan */ @@ -701,13 +701,13 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_DEFAULT; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = NULL; cooked->attnum = attnum; cooked->expr = colDef->cooked_default; cooked->skip_validation = false; cooked->is_local = true; /* not used for defaults */ - cooked->inhcount = 0; /* ditto */ + cooked->inhcount = 0; /* ditto */ cooked->is_no_inherit = false; cookedDefaults = lappend(cookedDefaults, cooked); descriptor->attrs[attnum - 1]->atthasdef = true; @@ -917,7 +917,7 @@ DropErrorMsgNonExistent(RangeVar *rel, char rightkind, bool missing_ok) } } - Assert(rentry->kind != '\0'); /* Should be impossible */ + Assert(rentry->kind != '\0'); /* Should be impossible */ } /* @@ -1629,7 +1629,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, int parentsWithOids = 0; bool have_bogus_defaults = false; int child_attno; - static Node bogus_marker = {0}; /* marks conflicting defaults */ + static Node bogus_marker = {0}; /* marks conflicting defaults */ List *saved_schema = NIL; /* @@ -1688,8 +1688,8 @@ MergeAttributes(List *schema, List *supers, char relpersistence, while (rest != NULL) { ColumnDef *restdef = lfirst(rest); - ListCell *next = lnext(rest); /* need to save it in case we - * delete it */ + ListCell *next = lnext(rest); /* need to save it in case we + * delete it */ if (strcmp(coldef->colname, restdef->colname) == 0) { @@ -2012,7 +2012,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_CHECK; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = pstrdup(name); cooked->attnum = 0; /* not used for constraints */ cooked->expr = expr; @@ -2650,7 +2650,7 @@ renameatt_internal(Oid myrelid, heap_close(attrelation, RowExclusiveLock); - relation_close(targetrelation, NoLock); /* close rel but keep lock */ + relation_close(targetrelation, NoLock); /* close rel but keep lock */ return attnum; } @@ -2701,10 +2701,10 @@ renameatt(RenameStmt *stmt) attnum = renameatt_internal(relid, - stmt->subname, /* old att name */ - stmt->newname, /* new att name */ + stmt->subname, /* old att name */ + stmt->newname, /* new att name */ stmt->relation->inh, /* recursive? */ - false, /* recursing? */ + false, /* recursing? */ 0, /* expected inhcount */ stmt->behavior); @@ -2856,8 +2856,8 @@ RenameConstraint(RenameStmt *stmt) stmt->subname, stmt->newname, (stmt->relation && - stmt->relation->inh), /* recursive? */ - false, /* recursing? */ + stmt->relation->inh), /* recursive? */ + false, /* recursing? */ 0 /* expected inhcount */ ); } @@ -2933,7 +2933,7 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal) relrelation = heap_open(RelationRelationId, RowExclusiveLock); reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid)); - if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ + if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for relation %u", myrelid); relform = (Form_pg_class) GETSTRUCT(reltup); @@ -3175,7 +3175,7 @@ AlterTableGetLockLevel(List *cmds) */ case AT_AddColumn: /* may rewrite heap, in some cases and visible * to SELECT */ - case AT_SetTableSpace: /* must rewrite heap */ + case AT_SetTableSpace: /* must rewrite heap */ case AT_AlterColumnType: /* must rewrite heap */ case AT_AddOids: /* must rewrite heap */ cmd_lockmode = AccessExclusiveLock; @@ -3196,7 +3196,7 @@ AlterTableGetLockLevel(List *cmds) * Removing constraints can affect SELECTs that have been * optimised assuming the constraint holds true. */ - case AT_DropConstraint: /* as DROP INDEX */ + case AT_DropConstraint: /* as DROP INDEX */ case AT_DropNotNull: /* may change some SQL plans */ cmd_lockmode = AccessExclusiveLock; break; @@ -3264,8 +3264,8 @@ AlterTableGetLockLevel(List *cmds) break; case AT_AddConstraint: - case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ - case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ + case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ + case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ case AT_ReAddConstraint: /* becomes AT_AddConstraint */ if (IsA(cmd->def, Constraint)) { @@ -3345,11 +3345,11 @@ AlterTableGetLockLevel(List *cmds) * applies: we don't currently allow concurrent catalog * updates. */ - case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ + case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ case AT_ClusterOn: /* Uses MVCC in getIndexes() */ case AT_DropCluster: /* Uses MVCC in getIndexes() */ case AT_SetOptions: /* Uses MVCC in getTableAttrs() */ - case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ + case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ cmd_lockmode = ShareUpdateExclusiveLock; break; @@ -3368,8 +3368,8 @@ AlterTableGetLockLevel(List *cmds) * reasons these can all be used with ALTER TABLE, so we can't * decide between them using the basic grammar. */ - case AT_SetRelOptions: /* Uses MVCC in getIndexes() and - * getTables() */ + case AT_SetRelOptions: /* Uses MVCC in getIndexes() and + * getTables() */ case AT_ResetRelOptions: /* Uses MVCC in getIndexes() and * getTables() */ cmd_lockmode = AlterTableGetRelOptionsLockLevel((List *) cmd->def); @@ -3553,7 +3553,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, cmd->subtype = AT_AddConstraintRecurse; pass = AT_PASS_ADD_CONSTR; break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ ATSimplePermissions(rel, ATT_TABLE); /* This command never recurses */ /* No command-specific prep needed */ @@ -3643,7 +3643,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* reset them all, then set just these */ + case AT_ReplaceRelOptions: /* reset them all, then set just these */ ATSimplePermissions(rel, ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX); /* This command never recurses */ /* No command-specific prep needed */ @@ -3665,7 +3665,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, ATSimplePermissions(rel, ATT_TABLE); pass = AT_PASS_MISC; break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ ATSimplePermissions(rel, ATT_TABLE | ATT_FOREIGN_TABLE); /* Recursion occurs during execution phase */ /* No command-specific prep needed except saving recurse flag */ @@ -3719,7 +3719,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, default: /* oops */ elog(ERROR, "unrecognized alter table type: %d", (int) cmd->subtype); - pass = AT_PASS_UNSET; /* keep compiler quiet */ + pass = AT_PASS_UNSET; /* keep compiler quiet */ break; } Assert(pass > AT_PASS_UNSET); @@ -3856,7 +3856,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, cmd->behavior, false, false, cmd->missing_ok, lockmode); break; - case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ + case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ address = ATExecDropColumn(wqueue, rel, cmd->name, cmd->behavior, true, false, cmd->missing_ok, lockmode); @@ -3887,19 +3887,19 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_ReAddComment: /* Re-add existing comment */ address = CommentObject((CommentStmt *) cmd->def); break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ address = ATExecAddIndexConstraint(tab, rel, (IndexStmt *) cmd->def, lockmode); break; case AT_AlterConstraint: /* ALTER CONSTRAINT */ address = ATExecAlterConstraint(rel, cmd, false, false, lockmode); break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ address = ATExecValidateConstraint(rel, cmd->name, false, false, lockmode); break; - case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with - * recursion */ + case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with + * recursion */ address = ATExecValidateConstraint(rel, cmd->name, true, false, lockmode); break; @@ -3916,7 +3916,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_AlterColumnType: /* ALTER COLUMN TYPE */ address = ATExecAlterColumnType(tab, rel, cmd, lockmode); break; - case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ + case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ address = ATExecAlterColumnGenericOptions(rel, cmd->name, (List *) cmd->def, lockmode); @@ -3966,18 +3966,18 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* replace entire option list */ + case AT_ReplaceRelOptions: /* replace entire option list */ ATExecSetRelOptions(rel, (List *) cmd->def, cmd->subtype, lockmode); break; case AT_EnableTrig: /* ENABLE TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_ORIGIN, false, lockmode); break; - case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ + case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ALWAYS, false, lockmode); break; - case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ + case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_REPLICA, false, lockmode); break; @@ -4006,11 +4006,11 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_ORIGIN, lockmode); break; - case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ + case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ALWAYS, lockmode); break; - case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ + case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_REPLICA, lockmode); break; @@ -4330,7 +4330,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode) */ oldrel = heap_open(tab->relid, NoLock); oldTupDesc = tab->oldDesc; - newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ + newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ if (OidIsValid(OIDNewHeap)) newrel = heap_open(OIDNewHeap, lockmode); @@ -6540,12 +6540,12 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName, CheckTableNotInUse(childrel, "ALTER TABLE"); tuple = SearchSysCacheCopyAttName(childrelid, colName); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute \"%s\" of relation %u", colName, childrelid); childatt = (Form_pg_attribute) GETSTRUCT(tuple); - if (childatt->attinhcount <= 0) /* shouldn't happen */ + if (childatt->attinhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited attribute \"%s\"", childrelid, colName); @@ -6767,8 +6767,8 @@ ATExecAddIndexConstraint(AlteredTableInfo *tab, Relation rel, stmt->deferrable, stmt->initdeferred, stmt->primary, - true, /* update pg_index */ - true, /* remove old dependencies */ + true, /* update pg_index */ + true, /* remove old dependencies */ allowSystemTableMods, false); /* is_internal */ @@ -6889,8 +6889,8 @@ ATAddCheckConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, newcons = AddRelationNewConstraints(rel, NIL, list_make1(copyObject(constr)), recursing | is_readd, /* allow_merge */ - !recursing, /* is_local */ - is_readd); /* is_internal */ + !recursing, /* is_local */ + is_readd); /* is_internal */ /* we don't expect more than one constraint here */ Assert(list_length(newcons) <= 1); @@ -7337,8 +7337,7 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, RelationGetRelid(rel), fkattnum, numfks, - InvalidOid, /* not a domain - * constraint */ + InvalidOid, /* not a domain constraint */ indexOid, RelationGetRelid(pkrel), pkattnum, @@ -7349,13 +7348,13 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, fkconstraint->fk_upd_action, fkconstraint->fk_del_action, fkconstraint->fk_matchtype, - NULL, /* no exclusion constraint */ - NULL, /* no check constraint */ + NULL, /* no exclusion constraint */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ false); /* is_internal */ ObjectAddressSet(address, ConstraintRelationId, constrOid); @@ -8607,7 +8606,7 @@ ATExecDropConstraint(Relation rel, const char *constrName, con = (Form_pg_constraint) GETSTRUCT(copy_tuple); - if (con->coninhcount <= 0) /* shouldn't happen */ + if (con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", childrelid, constrName); @@ -8965,7 +8964,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, /* Look up the target column */ heapTup = SearchSysCacheCopyAttName(RelationGetRelid(rel), colName); - if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ + if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("column \"%s\" of relation \"%s\" does not exist", @@ -9005,7 +9004,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, defaultexpr = build_column_default(rel, attnum); Assert(defaultexpr); defaultexpr = strip_implicit_coercions(defaultexpr); - defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ + defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ defaultexpr, exprType(defaultexpr), targettype, targettypmod, COERCION_ASSIGNMENT, @@ -9500,7 +9499,7 @@ ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode) bool conislocal; tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(oldId)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for constraint %u", oldId); con = (Form_pg_constraint) GETSTRUCT(tup); relid = con->conrelid; @@ -11647,7 +11646,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel) HeapTuple copyTuple = heap_copytuple(constraintTuple); Form_pg_constraint copy_con = (Form_pg_constraint) GETSTRUCT(copyTuple); - if (copy_con->coninhcount <= 0) /* shouldn't happen */ + if (copy_con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", RelationGetRelid(child_rel), NameStr(copy_con->conname)); @@ -12836,7 +12835,7 @@ PreCommit_on_commit_actions(void) if (oids_to_truncate != NIL) { heap_truncate(oids_to_truncate); - CommandCounterIncrement(); /* XXX needed? */ + CommandCounterIncrement(); /* XXX needed? */ } } @@ -12979,7 +12978,7 @@ RangeVarCallbackOwnsRelation(const RangeVar *relation, return; tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relId)); - if (!HeapTupleIsValid(tuple)) /* should not happen */ + if (!HeapTupleIsValid(tuple)) /* should not happen */ elog(ERROR, "cache lookup failed for relation %u", relId); if (!pg_class_ownercheck(relId, GetUserId())) diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index f9c26201d9..03bf06012a 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -388,7 +388,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); return InvalidOid; /* keep compiler quiet */ -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } /* @@ -549,7 +549,7 @@ DropTableSpace(DropTableSpaceStmt *stmt) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index d7ed71f767..191f27651c 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -593,11 +593,11 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, stmt->initdeferred, true, RelationGetRelid(rel), - NULL, /* no conkey */ + NULL, /* no conkey */ 0, - InvalidOid, /* no domain */ - InvalidOid, /* no index */ - InvalidOid, /* no foreign key */ + InvalidOid, /* no domain */ + InvalidOid, /* no index */ + InvalidOid, /* no foreign key */ NULL, NULL, NULL, @@ -606,14 +606,14 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, ' ', ' ', ' ', - NULL, /* no exclusion */ - NULL, /* no check constraint */ + NULL, /* no exclusion */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ - isInternal); /* is_internal */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ + isInternal); /* is_internal */ } /* @@ -2026,7 +2026,7 @@ equalTriggerDescs(TriggerDesc *trigdesc1, TriggerDesc *trigdesc2) return false; return true; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* * Call a trigger function. @@ -3255,8 +3255,7 @@ typedef SetConstraintStateData *SetConstraintState; */ typedef uint32 TriggerFlags; -#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order - * bits */ +#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */ #define AFTER_TRIGGER_DONE 0x10000000 #define AFTER_TRIGGER_IN_PROGRESS 0x20000000 /* bits describing the size and tuple sources of this event */ @@ -3317,7 +3316,7 @@ typedef struct AfterTriggerEventDataZeroCtids */ typedef struct AfterTriggerEventChunk { - struct AfterTriggerEventChunk *next; /* list link */ + struct AfterTriggerEventChunk *next; /* list link */ char *freeptr; /* start of free space in chunk */ char *endfree; /* end of free space in chunk */ char *endptr; /* end of chunk */ @@ -3409,7 +3408,7 @@ typedef struct AfterTriggersData { CommandId firing_counter; /* next firing ID to assign */ SetConstraintState state; /* the active S C state */ - AfterTriggerEventList events; /* deferred-event list */ + AfterTriggerEventList events; /* deferred-event list */ int query_depth; /* current query list index */ AfterTriggerEventList *query_stack; /* events pending from each query */ Tuplestorestate **fdw_tuplestores; /* foreign tuples for one row from @@ -3422,7 +3421,7 @@ typedef struct AfterTriggersData /* these fields are just for resetting at subtrans abort: */ SetConstraintState *state_stack; /* stacked S C states */ - AfterTriggerEventList *events_stack; /* stacked list pointers */ + AfterTriggerEventList *events_stack; /* stacked list pointers */ int *depth_stack; /* stacked query_depths */ CommandId *firing_stack; /* stacked firing_counters */ int maxtransdepth; /* allocated len of above arrays */ @@ -4058,7 +4057,7 @@ afterTriggerInvokeEvents(AfterTriggerEventList *events, slot1 = MakeSingleTupleTableSlot(rel->rd_att); slot2 = MakeSingleTupleTableSlot(rel->rd_att); } - if (trigdesc == NULL) /* should not happen */ + if (trigdesc == NULL) /* should not happen */ elog(ERROR, "relation %u has no triggers", evtshared->ats_relid); } @@ -4132,7 +4131,7 @@ AfterTriggerBeginXact(void) /* * Initialize after-trigger state structure to empty */ - afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ + afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ afterTriggers.query_depth = -1; /* diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c index dfb95a1ed3..cb212fdf68 100644 --- a/src/backend/commands/tsearchcmds.c +++ b/src/backend/commands/tsearchcmds.c @@ -1561,7 +1561,7 @@ serialize_deflist(List *deflist) List * deserialize_deflist(Datum txt) { - text *in = DatumGetTextPP(txt); /* in case it's toasted */ + text *in = DatumGetTextPP(txt); /* in case it's toasted */ List *result = NIL; int len = VARSIZE_ANY_EXHDR(in); char *ptr, @@ -1582,7 +1582,7 @@ deserialize_deflist(Datum txt) } ds_state; ds_state state = CS_WAITKEY; - workspace = (char *) palloc(len + 1); /* certainly enough room */ + workspace = (char *) palloc(len + 1); /* certainly enough room */ ptr = VARDATA_ANY(in); endptr = ptr + len; for (; ptr < endptr; ptr++) diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index e7ecc4ed7e..4e083eb345 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -606,11 +606,11 @@ DefineType(ParseState *pstate, List *names, List *parameters) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ + internalLength, /* internal size */ TYPTYPE_BASE, /* type-type (base type) */ category, /* type-category */ preferred, /* is it a preferred type? */ @@ -653,7 +653,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ delimiter, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -662,7 +662,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) F_ARRAY_SEND, /* send procedure */ typmodinOid, /* typmodin procedure */ typmodoutOid, /* typmodout procedure */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1033,19 +1033,19 @@ DefineDomain(CreateDomainStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ domainName, /* type name */ - domainNamespace, /* namespace */ + domainNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ - TYPTYPE_DOMAIN, /* type-type (domain type) */ + internalLength, /* internal size */ + TYPTYPE_DOMAIN, /* type-type (domain type) */ category, /* type-category */ false, /* domain types are never preferred */ delimiter, /* array element delimiter */ - inputProcedure, /* input procedure */ - outputProcedure, /* output procedure */ + inputProcedure, /* input procedure */ + outputProcedure, /* output procedure */ receiveProcedure, /* receive procedure */ - sendProcedure, /* send procedure */ + sendProcedure, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ analyzeProcedure, /* analyze procedure */ @@ -1054,7 +1054,7 @@ DefineDomain(CreateDomainStmt *stmt) InvalidOid, /* no arrays for domains (yet) */ basetypeoid, /* base type ID */ defaultValue, /* default type value (text) */ - defaultValueBin, /* default type value (binary) */ + defaultValueBin, /* default type value (binary) */ byValue, /* passed by value */ alignment, /* required alignment */ storage, /* TOAST strategy */ @@ -1145,7 +1145,7 @@ DefineEnum(CreateEnumStmt *stmt) enumTypeAddr = TypeCreate(InvalidOid, /* no predetermined type OID */ enumName, /* type name */ - enumNamespace, /* namespace */ + enumNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ @@ -1191,7 +1191,7 @@ DefineEnum(CreateEnumStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1200,7 +1200,7 @@ DefineEnum(CreateEnumStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ enumTypeAddr.objectId, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1473,12 +1473,12 @@ DefineRange(CreateRangeStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ - TYPTYPE_RANGE, /* type-type (range type) */ + TYPTYPE_RANGE, /* type-type (range type) */ TYPCATEGORY_RANGE, /* type-category (range type) */ false, /* range types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ @@ -1491,7 +1491,7 @@ DefineRange(CreateRangeStmt *stmt) F_RANGE_TYPANALYZE, /* analyze procedure */ InvalidOid, /* element type ID - none */ false, /* this is not an array type */ - rangeArrayOid, /* array type we are about to create */ + rangeArrayOid, /* array type we are about to create */ InvalidOid, /* base type ID (only for domains) */ NULL, /* never a default type value */ NULL, /* no binary form available either */ @@ -1521,7 +1521,7 @@ DefineRange(CreateRangeStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1530,7 +1530,7 @@ DefineRange(CreateRangeStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1591,14 +1591,14 @@ makeRangeConstructors(const char *name, Oid namespace, pronargs[i]); myself = ProcedureCreate(name, /* name: same as range type */ - namespace, /* namespace */ + namespace, /* namespace */ false, /* replace */ false, /* returns set */ - rangeOid, /* return type */ + rangeOid, /* return type */ BOOTSTRAP_SUPERUSERID, /* proowner */ INTERNALlanguageId, /* language */ - F_FMGR_INTERNAL_VALIDATOR, /* language validator */ - prosrc[i], /* prosrc */ + F_FMGR_INTERNAL_VALIDATOR, /* language validator */ + prosrc[i], /* prosrc */ NULL, /* probin */ false, /* isAgg */ false, /* isWindowFunc */ @@ -1606,8 +1606,8 @@ makeRangeConstructors(const char *name, Oid namespace, false, /* leakproof */ false, /* isStrict */ PROVOLATILE_IMMUTABLE, /* volatility */ - PROPARALLEL_SAFE, /* parallel safety */ - constructorArgTypesVector, /* parameterTypes */ + PROPARALLEL_SAFE, /* parallel safety */ + constructorArgTypesVector, /* parameterTypes */ PointerGetDatum(NULL), /* allParameterTypes */ PointerGetDatum(NULL), /* parameterModes */ PointerGetDatum(NULL), /* parameterNames */ @@ -2131,7 +2131,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) ParseState *pstate; Relation rel; char *defaultValue; - Node *defaultExpr = NULL; /* NULL if no default specified */ + Node *defaultExpr = NULL; /* NULL if no default specified */ Datum new_record[Natts_pg_type]; bool new_record_nulls[Natts_pg_type]; bool new_record_repl[Natts_pg_type]; @@ -2226,7 +2226,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) /* Rebuild dependencies */ GenerateTypeDependencies(typTup->typnamespace, domainoid, - InvalidOid, /* typrelid is n/a */ + InvalidOid, /* typrelid is n/a */ 0, /* relation kind is n/a */ typTup->typowner, typTup->typinput, @@ -2237,11 +2237,11 @@ AlterDomainDefault(List *names, Node *defaultRaw) typTup->typmodout, typTup->typanalyze, InvalidOid, - false, /* a domain isn't an implicit array */ + false, /* a domain isn't an implicit array */ typTup->typbasetype, typTup->typcollation, defaultExpr, - true); /* Rebuild is true */ + true); /* Rebuild is true */ InvokeObjectPostAlterHook(TypeRelationId, domainoid, 0); @@ -3065,12 +3065,12 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, false, /* Is Deferrable */ false, /* Is Deferred */ !constr->skip_validation, /* Is Validated */ - InvalidOid, /* not a relation constraint */ + InvalidOid, /* not a relation constraint */ NULL, 0, - domainOid, /* domain constraint */ - InvalidOid, /* no associated index */ - InvalidOid, /* Foreign key fields */ + domainOid, /* domain constraint */ + InvalidOid, /* no associated index */ + InvalidOid, /* Foreign key fields */ NULL, NULL, NULL, @@ -3079,11 +3079,11 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, ' ', ' ', ' ', - NULL, /* not an exclusion constraint */ - expr, /* Tree form of check constraint */ + NULL, /* not an exclusion constraint */ + expr, /* Tree form of check constraint */ ccbin, /* Binary form of check constraint */ ccsrc, /* Source form of check constraint */ - true, /* is local */ + true, /* is local */ 0, /* inhcount */ false, /* connoinherit */ false); /* is_internal */ diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 10d6ba9e04..24608c27c3 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -82,18 +82,17 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) char *password = NULL; /* user password */ bool issuper = false; /* Make the user a superuser? */ bool inherit = true; /* Auto inherit privileges? */ - bool createrole = false; /* Can this user create roles? */ - bool createdb = false; /* Can the user create databases? */ - bool canlogin = false; /* Can this user login? */ + bool createrole = false; /* Can this user create roles? */ + bool createdb = false; /* Can the user create databases? */ + bool canlogin = false; /* Can this user login? */ bool isreplication = false; /* Is this a replication role? */ - bool bypassrls = false; /* Is this a row security enabled - * role? */ + bool bypassrls = false; /* Is this a row security enabled role? */ int connlimit = -1; /* maximum connections allowed */ List *addroleto = NIL; /* roles to make this a member of */ - List *rolemembers = NIL; /* roles to be members of this role */ - List *adminmembers = NIL; /* roles to be admins of this role */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be members of this role */ + List *adminmembers = NIL; /* roles to be admins of this role */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; DefElem *dpassword = NULL; DefElem *dissuper = NULL; @@ -497,11 +496,11 @@ AlterRole(AlterRoleStmt *stmt) int createrole = -1; /* Can this user create roles? */ int createdb = -1; /* Can the user create databases? */ int canlogin = -1; /* Can this user login? */ - int isreplication = -1; /* Is this a replication role? */ + int isreplication = -1; /* Is this a replication role? */ int connlimit = -1; /* maximum connections allowed */ - List *rolemembers = NIL; /* roles to be added/removed */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be added/removed */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; int bypassrls = -1; DefElem *dpassword = NULL; diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 153a360861..7978c062d7 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -81,8 +81,8 @@ * that the potential for improvement was great enough to merit the cost of * supporting them. */ -#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ -#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ +#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ +#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ #define VACUUM_TRUNCATE_LOCK_TIMEOUT 5000 /* ms */ /* @@ -112,7 +112,7 @@ typedef struct LVRelStats BlockNumber old_rel_pages; /* previous value of pg_class.relpages */ BlockNumber rel_pages; /* total number of pages */ BlockNumber scanned_pages; /* number of pages we examined */ - BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ + BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ BlockNumber frozenskipped_pages; /* # of frozen pages we skipped */ BlockNumber tupcount_pages; /* pages whose tuples we counted */ double scanned_tuples; /* counts only tuples on tupcount_pages */ diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index a5d6574eaf..e83e4f455f 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -546,7 +546,7 @@ DefineView(ViewStmt *stmt, const char *queryString, * long as the CREATE command is consistent with that --- no explicit * schema name. */ - view = copyObject(stmt->view); /* don't corrupt original command */ + view = copyObject(stmt->view); /* don't corrupt original command */ if (view->relpersistence == RELPERSISTENCE_PERMANENT && isQueryUsingTempRelation(viewParse)) { diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index fe12326336..61c90a1600 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -344,7 +344,7 @@ ExecBuildProjectionInfo(List *targetList, attnum = variable->varattno; if (inputDesc == NULL) - isSafeVar = true; /* can't check, just assume OK */ + isSafeVar = true; /* can't check, just assume OK */ else if (attnum <= inputDesc->natts) { Form_pg_attribute attr = inputDesc->attrs[attnum - 1]; @@ -1362,7 +1362,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* If WHEN result isn't true, jump to next CASE arm */ scratch.opcode = EEOP_JUMP_IF_NOT_TRUE; - scratch.d.jump.jumpdone = -1; /* computed later */ + scratch.d.jump.jumpdone = -1; /* computed later */ ExprEvalPushStep(state, &scratch); whenstep = state->steps_len - 1; @@ -1374,7 +1374,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* Emit JUMP step to jump to end of CASE's code */ scratch.opcode = EEOP_JUMP; - scratch.d.jump.jumpdone = -1; /* computed later */ + scratch.d.jump.jumpdone = -1; /* computed later */ ExprEvalPushStep(state, &scratch); /* @@ -1720,7 +1720,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* if it's not null, skip to end of COALESCE expr */ scratch.opcode = EEOP_JUMP_IF_NOT_NULL; - scratch.d.jump.jumpdone = -1; /* adjust later */ + scratch.d.jump.jumpdone = -1; /* adjust later */ ExprEvalPushStep(state, &scratch); adjust_jumps = lappend_int(adjust_jumps, diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index fed0052fc6..146d1a0bec 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -83,7 +83,7 @@ */ #ifdef HAVE_COMPUTED_GOTO #define EEO_USE_COMPUTED_GOTO -#endif /* HAVE_COMPUTED_GOTO */ +#endif /* HAVE_COMPUTED_GOTO */ /* * Macros for opcode dispatch. @@ -112,7 +112,7 @@ static const void **dispatch_table = NULL; #define EEO_DISPATCH() goto starteval #define EEO_OPCODE(opcode) (opcode) -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ #define EEO_NEXT() \ do { \ @@ -256,7 +256,7 @@ ExecReadyInterpretedExpr(ExprState *state) state->flags |= EEO_FLAG_DIRECT_THREADED; } -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ state->evalfunc = ExecInterpExpr; } @@ -373,7 +373,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) return PointerGetDatum(dispatch_table); #else Assert(state != NULL); -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ /* setup state */ op = state->steps; @@ -1559,7 +1559,7 @@ CheckVarSlotCompatibility(TupleTableSlot *slot, int attnum, Oid vartype) TupleDesc slot_tupdesc = slot->tts_tupleDescriptor; Form_pg_attribute attr; - if (attnum > slot_tupdesc->natts) /* should never happen */ + if (attnum > slot_tupdesc->natts) /* should never happen */ elog(ERROR, "attribute number %d exceeds number of columns %d", attnum, slot_tupdesc->natts); @@ -2475,7 +2475,7 @@ ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext) if (fieldnum <= 0) /* should never happen */ elog(ERROR, "unsupported reference to system column %d in FieldSelect", fieldnum); - if (fieldnum > tupDesc->natts) /* should never happen */ + if (fieldnum > tupDesc->natts) /* should never happen */ elog(ERROR, "attribute number %d exceeds number of columns %d", fieldnum, tupDesc->natts); attr = tupDesc->attrs[fieldnum - 1]; diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c index 108060ac0f..4d81830996 100644 --- a/src/backend/executor/execIndexing.c +++ b/src/backend/executor/execIndexing.c @@ -387,7 +387,7 @@ ExecInsertIndexTuples(TupleTableSlot *slot, index_insert(indexRelation, /* index relation */ values, /* array of index Datums */ isnull, /* null flags */ - tupleid, /* tid of heap tuple */ + tupleid, /* tid of heap tuple */ heapRelation, /* heap relation */ checkUnique, /* type of uniqueness check to do */ indexInfo); /* index AM may need this */ diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 9dbe17565b..2e3717d4dd 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -2570,7 +2570,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, break; case LockWaitSkip: if (!ConditionalXactLockTableWait(SnapshotDirty.xmax)) - return NULL; /* skip instead of waiting */ + return NULL; /* skip instead of waiting */ break; case LockWaitError: if (!ConditionalXactLockTableWait(SnapshotDirty.xmax)) diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index c4a955332f..9abf0aa15d 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -244,8 +244,8 @@ ExecDropSingleTupleTableSlot(TupleTableSlot *slot) * -------------------------------- */ void -ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */ - TupleDesc tupdesc) /* new tuple descriptor */ +ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */ + TupleDesc tupdesc) /* new tuple descriptor */ { /* For safety, make sure slot is empty before changing it */ ExecClearTuple(slot); diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index cb2596cb31..25772fc603 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -102,7 +102,7 @@ CreateExecutorState(void) * Initialize all fields of the Executor State structure */ estate->es_direction = ForwardScanDirection; - estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */ + estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */ estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */ estate->es_range_table = NIL; estate->es_plannedstmt = NULL; diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index f15ff64a3b..7199ff6fd7 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -93,7 +93,7 @@ typedef struct char *fname; /* function name (for error msgs) */ char *src; /* function body text (for error msgs) */ - SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */ + SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */ Oid rettype; /* actual return type */ int16 typlen; /* length of the return type */ @@ -245,13 +245,13 @@ prepare_sql_fn_parse_info(HeapTuple procedureTuple, Anum_pg_proc_proargnames, &isNull); if (isNull) - proargnames = PointerGetDatum(NULL); /* just to be sure */ + proargnames = PointerGetDatum(NULL); /* just to be sure */ proargmodes = SysCacheGetAttr(PROCNAMEARGSNSP, procedureTuple, Anum_pg_proc_proargmodes, &isNull); if (isNull) - proargmodes = PointerGetDatum(NULL); /* just to be sure */ + proargmodes = PointerGetDatum(NULL); /* just to be sure */ n_arg_names = get_func_input_arg_names(proargnames, proargmodes, &pinfo->argnames); @@ -648,7 +648,7 @@ init_sql_fcache(FmgrInfo *finfo, Oid collation, bool lazyEvalOK) if (IsPolymorphicType(rettype)) { rettype = get_fn_expr_rettype(finfo); - if (rettype == InvalidOid) /* this probably should not happen */ + if (rettype == InvalidOid) /* this probably should not happen */ ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("could not determine actual result type for function declared to return type %s", @@ -1544,7 +1544,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, AssertArg(!IsPolymorphicType(rettype)); if (modifyTargetList) - *modifyTargetList = false; /* initialize for no change */ + *modifyTargetList = false; /* initialize for no change */ if (junkFilter) *junkFilter = NULL; /* initialize in case of VOID result */ @@ -1770,7 +1770,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); newtlist = lappend(newtlist, makeTargetEntry(null_expr, diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 96cdfb7ad2..b0f9520e53 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -511,9 +511,9 @@ typedef struct AggStatePerHashData FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ int numCols; /* number of hash key columns */ int numhashGrpCols; /* number of columns in hash table */ - int largestGrpColIdx; /* largest col required for hashing */ - AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */ - AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */ + int largestGrpColIdx; /* largest col required for hashing */ + AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */ + AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */ Agg *aggnode; /* original Agg node, for numGroups etc. */ } AggStatePerHashData; @@ -2373,8 +2373,7 @@ agg_retrieve_direct(AggState *aggstate) firstSlot, InvalidBuffer, true); - aggstate->grp_firstTuple = NULL; /* don't keep two - * pointers */ + aggstate->grp_firstTuple = NULL; /* don't keep two pointers */ /* set up for first advance_aggregates call */ tmpcontext->ecxt_outertuple = firstSlot; diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c index 77f65db0ca..7e0ba030b7 100644 --- a/src/backend/executor/nodeBitmapHeapscan.c +++ b/src/backend/executor/nodeBitmapHeapscan.c @@ -129,7 +129,7 @@ BitmapHeapNext(BitmapHeapScanState *node) node->prefetch_pages = 0; node->prefetch_target = -1; } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } else { @@ -182,7 +182,7 @@ BitmapHeapNext(BitmapHeapScanState *node) node->shared_prefetch_iterator = tbm_attach_shared_iterate(dsa, pstate->prefetch_iterator); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } node->initialized = true; } @@ -265,7 +265,7 @@ BitmapHeapNext(BitmapHeapScanState *node) pstate->prefetch_target++; SpinLockRelease(&pstate->mutex); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -514,7 +514,7 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node, tbm_shared_iterate(prefetch_iterator); } } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -558,7 +558,7 @@ BitmapAdjustPrefetchTarget(BitmapHeapScanState *node) pstate->prefetch_target++; SpinLockRelease(&pstate->mutex); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -634,7 +634,7 @@ BitmapPrefetch(BitmapHeapScanState *node, HeapScanDesc scan) } } } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* diff --git a/src/backend/executor/nodeBitmapIndexscan.c b/src/backend/executor/nodeBitmapIndexscan.c index ce2f3210a4..c9f8b7c7fb 100644 --- a/src/backend/executor/nodeBitmapIndexscan.c +++ b/src/backend/executor/nodeBitmapIndexscan.c @@ -73,7 +73,7 @@ MultiExecBitmapIndexScan(BitmapIndexScanState *node) if (node->biss_result) { tbm = node->biss_result; - node->biss_result = NULL; /* reset for next time */ + node->biss_result = NULL; /* reset for next time */ } else { diff --git a/src/backend/executor/nodeBitmapOr.c b/src/backend/executor/nodeBitmapOr.c index c0f261407b..4f0ddc6dff 100644 --- a/src/backend/executor/nodeBitmapOr.c +++ b/src/backend/executor/nodeBitmapOr.c @@ -150,7 +150,7 @@ MultiExecBitmapOr(BitmapOrState *node) elog(ERROR, "unrecognized result from subplan"); if (result == NULL) - result = subresult; /* first subplan */ + result = subresult; /* first subplan */ else { tbm_union(result, subresult); diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c index c1db2e263b..f83cd584d7 100644 --- a/src/backend/executor/nodeGather.c +++ b/src/backend/executor/nodeGather.c @@ -258,7 +258,7 @@ gather_getnext(GatherState *gatherstate) if (HeapTupleIsValid(tup)) { - ExecStoreTuple(tup, /* tuple to store */ + ExecStoreTuple(tup, /* tuple to store */ fslot, /* slot in which to store the tuple */ InvalidBuffer, /* buffer associated with this * tuple */ diff --git a/src/backend/executor/nodeGatherMerge.c b/src/backend/executor/nodeGatherMerge.c index e066574836..b1965f5e1c 100644 --- a/src/backend/executor/nodeGatherMerge.c +++ b/src/backend/executor/nodeGatherMerge.c @@ -597,7 +597,7 @@ gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait) ExecStoreTuple(tup, /* tuple to store */ gm_state->gm_slots[reader], /* slot in which to store the * tuple */ - InvalidBuffer, /* buffer associated with this tuple */ + InvalidBuffer, /* buffer associated with this tuple */ true); /* pfree this pointer if not from heap */ return true; diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index d9789d0719..6c84ad9989 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -1176,7 +1176,7 @@ ExecScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext) /* insert hashtable's tuple into exec slot */ inntuple = ExecStoreMinimalTuple(HJTUPLE_MINTUPLE(hashTuple), hjstate->hj_HashTupleSlot, - false); /* do not pfree */ + false); /* do not pfree */ econtext->ecxt_innertuple = inntuple; /* diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 907090395c..8d2325398b 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -618,7 +618,7 @@ ExecHashJoinOuterGetTuple(PlanState *outerNode, econtext->ecxt_outertuple = slot; if (ExecHashGetHashValue(hashtable, econtext, hjstate->hj_OuterHashKeys, - true, /* outer tuple */ + true, /* outer tuple */ HJ_FILL_OUTER(hjstate), hashvalue)) { diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 0fb3fb5e7e..7e123758b4 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -138,7 +138,7 @@ IndexNext(IndexScanState *node) */ ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->xs_cbuf, /* buffer containing tuple */ + scandesc->xs_cbuf, /* buffer containing tuple */ false); /* don't pfree */ /* @@ -284,7 +284,7 @@ next_indextuple: */ ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->xs_cbuf, /* buffer containing tuple */ + scandesc->xs_cbuf, /* buffer containing tuple */ false); /* don't pfree */ /* @@ -1296,7 +1296,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, flags, varattno, /* attribute number to scan */ op_strategy, /* op's strategy */ - op_righttype, /* strategy subtype */ + op_righttype, /* strategy subtype */ ((OpExpr *) clause)->inputcollid, /* collation */ opfuncid, /* reg proc to use */ scanvalue); /* constant */ @@ -1421,12 +1421,12 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, */ ScanKeyEntryInitialize(this_sub_key, flags, - varattno, /* attribute number */ - op_strategy, /* op's strategy */ + varattno, /* attribute number */ + op_strategy, /* op's strategy */ op_righttype, /* strategy subtype */ inputcollation, /* collation */ - opfuncid, /* reg proc to use */ - scanvalue); /* constant */ + opfuncid, /* reg proc to use */ + scanvalue); /* constant */ n_sub_key++; } @@ -1558,7 +1558,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, flags, varattno, /* attribute number to scan */ op_strategy, /* op's strategy */ - op_righttype, /* strategy subtype */ + op_righttype, /* strategy subtype */ saop->inputcollid, /* collation */ opfuncid, /* reg proc to use */ scanvalue); /* constant */ @@ -1608,7 +1608,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, ScanKeyEntryInitialize(this_scan_key, flags, varattno, /* attribute number to scan */ - InvalidStrategy, /* no strategy */ + InvalidStrategy, /* no strategy */ InvalidOid, /* no strategy subtype */ InvalidOid, /* no collation */ InvalidOid, /* no reg proc for this */ diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c index 5630eae53d..f519794cf3 100644 --- a/src/backend/executor/nodeLockRows.c +++ b/src/backend/executor/nodeLockRows.c @@ -172,7 +172,7 @@ lnext: break; default: elog(ERROR, "unsupported rowmark type"); - lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */ + lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */ break; } diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index 336270f02a..94a5e98e3e 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -225,7 +225,7 @@ MJExamineQuals(List *mergeclauses, &op_strategy, &op_lefttype, &op_righttype); - if (op_strategy != BTEqualStrategyNumber) /* should not happen */ + if (op_strategy != BTEqualStrategyNumber) /* should not happen */ elog(ERROR, "cannot merge using non-equality operator %u", qual->opno); @@ -849,7 +849,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -951,7 +951,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) @@ -1212,7 +1212,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) @@ -1274,7 +1274,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -1344,7 +1344,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -1390,7 +1390,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index ff5ad98a91..11594b58b5 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1561,8 +1561,7 @@ ExecModifyTable(ModifyTableState *node) elog(ERROR, "ctid is NULL"); tupleid = (ItemPointer) DatumGetPointer(datum); - tuple_ctid = *tupleid; /* be sure we don't free - * ctid!! */ + tuple_ctid = *tupleid; /* be sure we don't free ctid!! */ tupleid = &tuple_ctid; } @@ -1775,7 +1774,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) root_rti = linitial_int(node->partitioned_rels); root_oid = getrelid(root_rti, estate->es_range_table); - rel = heap_open(root_oid, NoLock); /* locked by InitPlan */ + rel = heap_open(root_oid, NoLock); /* locked by InitPlan */ } else rel = mtstate->resultRelInfo->ri_RelationDesc; diff --git a/src/backend/executor/nodeSamplescan.c b/src/backend/executor/nodeSamplescan.c index 0247bd2347..428fd98665 100644 --- a/src/backend/executor/nodeSamplescan.c +++ b/src/backend/executor/nodeSamplescan.c @@ -415,7 +415,7 @@ tablesample_getnext(SampleScanState *scanstate) else { /* continue from previously returned page/tuple */ - blockno = scan->rs_cblock; /* current page */ + blockno = scan->rs_cblock; /* current page */ } /* diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c index c0e37dcd83..822c6bf20a 100644 --- a/src/backend/executor/nodeSeqscan.c +++ b/src/backend/executor/nodeSeqscan.c @@ -90,8 +90,8 @@ SeqNext(SeqScanState *node) if (tuple) ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->rs_cbuf, /* buffer associated with this - * tuple */ + scandesc->rs_cbuf, /* buffer associated with this + * tuple */ false); /* don't pfree this pointer */ else ExecClearTuple(slot); diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c index 0fb5615da3..9c7812e519 100644 --- a/src/backend/executor/nodeSetOp.c +++ b/src/backend/executor/nodeSetOp.c @@ -263,7 +263,7 @@ setop_retrieve_direct(SetOpState *setopstate) resultTupleSlot, InvalidBuffer, true); - setopstate->grp_firstTuple = NULL; /* don't keep two pointers */ + setopstate->grp_firstTuple = NULL; /* don't keep two pointers */ /* Initialize working state for a new input tuple group */ initialize_counts(pergroup); diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index 4860ec0f4d..64be613693 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -382,10 +382,10 @@ TidNext(TidScanState *node) * pointers onto disk pages and were not created with palloc() and * so should not be pfree()'d. */ - ExecStoreTuple(tuple, /* tuple to store */ + ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - buffer, /* buffer associated with tuple */ - false); /* don't pfree */ + buffer, /* buffer associated with tuple */ + false); /* don't pfree */ /* * At this point we have an extra pin on the buffer, because @@ -551,7 +551,7 @@ ExecInitTidScan(TidScan *node, EState *estate, int eflags) currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags); tidstate->ss.ss_currentRelation = currentRelation; - tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */ + tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */ /* * get the scan type from the relation descriptor. diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 433d97c8b4..1f2cbdde36 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -1895,7 +1895,7 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) AclResult aclresult; int i; - if (wfunc->winref != node->winref) /* planner screwed up? */ + if (wfunc->winref != node->winref) /* planner screwed up? */ elog(ERROR, "WindowFunc with winref %u assigned to WindowAgg with winref %u", wfunc->winref, node->winref); @@ -2209,7 +2209,7 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, /* build expression trees using actual argument & result types */ build_aggregate_transfn_expr(inputTypes, numArguments, - 0, /* no ordered-set window functions yet */ + 0, /* no ordered-set window functions yet */ false, /* no variadic window functions yet */ aggtranstype, wfunc->inputcollid, diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 97c3925874..9db41813d5 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -43,7 +43,7 @@ int SPI_result; static _SPI_connection *_SPI_stack = NULL; static _SPI_connection *_SPI_current = NULL; -static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */ +static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */ static int _SPI_connected = -1; /* current stack index */ static Portal SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, @@ -119,7 +119,7 @@ SPI_connect(void) _SPI_current->lastoid = InvalidOid; _SPI_current->tuptable = NULL; slist_init(&_SPI_current->tuptables); - _SPI_current->procCxt = NULL; /* in case we fail to create 'em */ + _SPI_current->procCxt = NULL; /* in case we fail to create 'em */ _SPI_current->execCxt = NULL; _SPI_current->connectSubid = GetCurrentSubTransactionId(); _SPI_current->queryEnv = NULL; @@ -149,7 +149,7 @@ SPI_finish(void) { int res; - res = _SPI_begin_call(false); /* live in procedure memory */ + res = _SPI_begin_call(false); /* live in procedure memory */ if (res < 0) return res; @@ -594,7 +594,7 @@ SPI_saveplan(SPIPlanPtr plan) return NULL; } - SPI_result = _SPI_begin_call(false); /* don't change context */ + SPI_result = _SPI_begin_call(false); /* don't change context */ if (SPI_result < 0) return NULL; @@ -1813,7 +1813,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan) plan->parserSetup, plan->parserSetupArg, plan->cursor_options, - false); /* not fixed result */ + false); /* not fixed result */ plancache_list = lappend(plancache_list, plansource); } @@ -2668,7 +2668,7 @@ SPI_register_relation(EphemeralNamedRelation enr) if (enr == NULL || enr->md.name == NULL) return SPI_ERROR_ARGUMENT; - res = _SPI_begin_call(false); /* keep current memory context */ + res = _SPI_begin_call(false); /* keep current memory context */ if (res < 0) return res; @@ -2702,7 +2702,7 @@ SPI_unregister_relation(const char *name) if (name == NULL) return SPI_ERROR_ARGUMENT; - res = _SPI_begin_call(false); /* keep current memory context */ + res = _SPI_begin_call(false); /* keep current memory context */ if (res < 0) return res; diff --git a/src/backend/executor/tqueue.c b/src/backend/executor/tqueue.c index 8d7e711b3b..c086b5b682 100644 --- a/src/backend/executor/tqueue.c +++ b/src/backend/executor/tqueue.c @@ -95,7 +95,7 @@ typedef struct ArrayRemapInfo int16 typlen; /* array element type's storage properties */ bool typbyval; char typalign; - TupleRemapInfo *element_remap; /* array element type's remap info */ + TupleRemapInfo *element_remap; /* array element type's remap info */ } ArrayRemapInfo; typedef struct RangeRemapInfo @@ -113,7 +113,7 @@ typedef struct RecordRemapInfo int32 localtypmod; /* If no fields of the record require remapping, these are NULL: */ TupleDesc tupledesc; /* copy of record's tupdesc */ - TupleRemapInfo **field_remap; /* each field's remap info */ + TupleRemapInfo **field_remap; /* each field's remap info */ } RecordRemapInfo; struct TupleRemapInfo diff --git a/src/backend/lib/ilist.c b/src/backend/lib/ilist.c index a108cd150b..af8d656d3e 100644 --- a/src/backend/lib/ilist.c +++ b/src/backend/lib/ilist.c @@ -108,4 +108,4 @@ slist_check(slist_head *head) ; } -#endif /* ILIST_DEBUG */ +#endif /* ILIST_DEBUG */ diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 28893d3519..b348bce3e2 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -103,7 +103,7 @@ static struct pam_conv pam_passw_conv = { static char *pam_passwd = NULL; /* Workaround for Solaris 2.6 brokenness */ static Port *pam_port_cludge; /* Workaround for passing "Port *port" into * pam_passwd_conv_proc */ -#endif /* USE_PAM */ +#endif /* USE_PAM */ /*---------------------------------------------------------------- @@ -114,7 +114,7 @@ static Port *pam_port_cludge; /* Workaround for passing "Port *port" into #include <bsd_auth.h> static int CheckBSDAuth(Port *port, char *user); -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ /*---------------------------------------------------------------- @@ -141,7 +141,7 @@ ULONG (*__ldap_start_tls_sA) ( #endif static int CheckLDAPAuth(Port *port); -#endif /* USE_LDAP */ +#endif /* USE_LDAP */ /*---------------------------------------------------------------- * Cert authentication @@ -172,7 +172,7 @@ bool pg_krb_caseins_users; #endif static int pg_GSS_recvauth(Port *port); -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /*---------------------------------------------------------------- @@ -558,7 +558,7 @@ ClientAuthentication(Port *port) status = CheckPAMAuth(port, port->user_name, ""); #else Assert(false); -#endif /* USE_PAM */ +#endif /* USE_PAM */ break; case uaBSD: @@ -566,7 +566,7 @@ ClientAuthentication(Port *port) status = CheckBSDAuth(port, port->user_name); #else Assert(false); -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ break; case uaLDAP: @@ -671,7 +671,7 @@ recv_password_packet(Port *port) } initStringInfo(&buf); - if (pq_getmessage(&buf, 1000)) /* receive password */ + if (pq_getmessage(&buf, 1000)) /* receive password */ { /* EOF - pq_getmessage already logged a suitable message */ pfree(buf.data); @@ -1287,7 +1287,7 @@ pg_GSS_recvauth(Port *port) return ret; } -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /*---------------------------------------------------------------- @@ -1696,7 +1696,7 @@ pg_SSPI_make_upn(char *accountname, pfree(upname); return STATUS_OK; } -#endif /* ENABLE_SSPI */ +#endif /* ENABLE_SSPI */ @@ -1715,7 +1715,7 @@ static bool interpret_ident_response(const char *ident_response, char *ident_user) { - const char *cursor = ident_response; /* Cursor into *ident_response */ + const char *cursor = ident_response; /* Cursor into *ident_response */ /* * Ident's response, in the telnet tradition, should end in crlf (\r\n). @@ -1769,7 +1769,7 @@ interpret_ident_response(const char *ident_response, { int i; /* Index into *ident_user */ - cursor++; /* Go over colon */ + cursor++; /* Go over colon */ while (pg_isblank(*cursor)) cursor++; /* skip blanks */ /* Rest of line is user name. Copy it over. */ @@ -1805,7 +1805,7 @@ ident_inet(hbaPort *port) const SockAddr remote_addr = port->raddr; const SockAddr local_addr = port->laddr; char ident_user[IDENT_USERNAME_MAX + 1]; - pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */ + pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */ int rc; /* Return code from a locally called function */ bool ident_return; char remote_addr_s[NI_MAXHOST]; @@ -2010,7 +2010,7 @@ auth_peer(hbaPort *port) return check_usermap(port->hba->usermap, port->user_name, ident_user, false); } -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ /*---------------------------------------------------------------- @@ -2161,8 +2161,8 @@ CheckPAMAuth(Port *port, char *user, char *password) * later used inside the PAM conversation to pass the password to the * authentication module. */ - pam_passw_conv.appdata_ptr = (char *) password; /* from password above, - * not allocated */ + pam_passw_conv.appdata_ptr = (char *) password; /* from password above, + * not allocated */ /* Optionally, one can set the service name in pg_hba.conf */ if (port->hba->pamservice && port->hba->pamservice[0] != '\0') @@ -2249,7 +2249,7 @@ CheckPAMAuth(Port *port, char *user, char *password) return (retval == PAM_SUCCESS ? STATUS_OK : STATUS_ERROR); } -#endif /* USE_PAM */ +#endif /* USE_PAM */ /*---------------------------------------------------------------- @@ -2282,7 +2282,7 @@ CheckBSDAuth(Port *port, char *user) return STATUS_OK; } -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ /*---------------------------------------------------------------- @@ -2581,7 +2581,7 @@ CheckLDAPAuth(Port *port) return STATUS_OK; } -#endif /* USE_LDAP */ +#endif /* USE_LDAP */ /*---------------------------------------------------------------- @@ -3071,8 +3071,8 @@ PerformRadiusTransaction(char *server, char *secret, char *portstr, char *identi memcpy(cryptvector + 4, packet->vector, RADIUS_VECTOR_LENGTH); /* request * authenticator, from * original packet */ - if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no - * attributes at all */ + if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no + * attributes at all */ memcpy(cryptvector + RADIUS_HEADER_LENGTH, receive_buffer + RADIUS_HEADER_LENGTH, packetlength - RADIUS_HEADER_LENGTH); memcpy(cryptvector + packetlength, secret, strlen(secret)); diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c index 9033dd4da8..3a0bb4ca0a 100644 --- a/src/backend/libpq/be-fsstubs.c +++ b/src/backend/libpq/be-fsstubs.c @@ -796,7 +796,7 @@ lo_get_fragment_internal(Oid loOid, int64 offset, int32 nbytes) if (loSize > offset) { if (nbytes >= 0 && nbytes <= loSize - offset) - result_length = nbytes; /* request is wholly inside LO */ + result_length = nbytes; /* request is wholly inside LO */ else result_length = loSize - offset; /* adjust to end of LO */ } diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 4532434140..a1d77969cc 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -664,7 +664,7 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) return true; } -#endif /* HAVE_IPV6 */ +#endif /* HAVE_IPV6 */ /* * Check whether host name matches pattern. @@ -1022,7 +1022,7 @@ parse_hba_line(TokenizedLine *tok_line, int elevel) *err_msg = "hostssl record cannot match because SSL is not supported by this build"; #endif } - else if (token->string[4] == 'n') /* "hostnossl" */ + else if (token->string[4] == 'n') /* "hostnossl" */ { parsedline->conntype = ctHostNoSSL; } @@ -1726,7 +1726,7 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, hbaline->ldapbasedn = pstrdup(urldata->lud_dn); if (urldata->lud_attrs) - hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */ + hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */ hbaline->ldapscope = urldata->lud_scope; if (urldata->lud_filter) { @@ -1743,7 +1743,7 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("LDAP URLs not supported on this platform"))); *err_msg = "LDAP URLs not supported on this platform"; -#endif /* not OpenLDAP */ +#endif /* not OpenLDAP */ } else if (strcmp(name, "ldaptls") == 0) { diff --git a/src/backend/libpq/ifaddr.c b/src/backend/libpq/ifaddr.c index b5f3243410..53bf6bcd80 100644 --- a/src/backend/libpq/ifaddr.c +++ b/src/backend/libpq/ifaddr.c @@ -99,7 +99,7 @@ range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr, return 1; } -#endif /* HAVE_IPV6 */ +#endif /* HAVE_IPV6 */ /* * pg_sockaddr_cidr_mask - make a network mask of the appropriate family @@ -471,7 +471,7 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) #define _SIZEOF_ADDR_IFREQ(ifr) \ sizeof (struct ifreq) #endif -#endif /* !_SIZEOF_ADDR_IFREQ */ +#endif /* !_SIZEOF_ADDR_IFREQ */ /* * Enumerate the system's network interface addresses and call the callback @@ -589,6 +589,6 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) return 0; } -#endif /* !defined(SIOCGIFCONF) */ +#endif /* !defined(SIOCGIFCONF) */ -#endif /* !HAVE_GETIFADDRS */ +#endif /* !HAVE_GETIFADDRS */ diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 1dffa98c44..98e408100d 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -149,7 +149,7 @@ static int internal_flush(void); #ifdef HAVE_UNIX_SOCKETS static int Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath); static int Setup_AF_UNIX(char *sock_path); -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ static PQcommMethods PqCommSocketMethods = { socket_comm_reset, @@ -253,7 +253,7 @@ socket_close(int code, Datum arg) if (MyProcPort->gss->cred != GSS_C_NO_CREDENTIAL) gss_release_cred(&min_s, &MyProcPort->gss->cred); -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /* * GSS and SSPI share the port->gss struct. Since nowhere else does a @@ -261,7 +261,7 @@ socket_close(int code, Datum arg) * BackendInitialize(). */ free(MyProcPort->gss); -#endif /* ENABLE_GSS || ENABLE_SSPI */ +#endif /* ENABLE_GSS || ENABLE_SSPI */ /* * Cleanly shut down SSL layer. Nowhere else does a postmaster child @@ -362,7 +362,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber, service = unixSocketPath; } else -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ { snprintf(portNumberStr, sizeof(portNumberStr), "%d", portNumber); service = portNumberStr; @@ -680,7 +680,7 @@ Setup_AF_UNIX(char *sock_path) } return STATUS_OK; } -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ /* @@ -858,8 +858,8 @@ TouchSocketFiles(void) #else /* !HAVE_UTIME */ #ifdef HAVE_UTIMES utimes(sock_path, NULL); -#endif /* HAVE_UTIMES */ -#endif /* HAVE_UTIME */ +#endif /* HAVE_UTIMES */ +#endif /* HAVE_UTIME */ } } @@ -1704,11 +1704,11 @@ pq_getkeepalivesidle(Port *port) elog(LOG, "getsockopt(TCP_KEEPALIVE) failed: %m"); port->default_keepalives_idle = -1; /* don't know */ } -#endif /* TCP_KEEPIDLE */ +#endif /* TCP_KEEPIDLE */ #else /* WIN32 */ /* We can't get the defaults on Windows, so return "don't know" */ port->default_keepalives_idle = -1; -#endif /* WIN32 */ +#endif /* WIN32 */ } return port->default_keepalives_idle; @@ -1733,7 +1733,7 @@ pq_setkeepalivesidle(int idle, Port *port) if (pq_getkeepalivesidle(port) < 0) { if (idle == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } @@ -1792,12 +1792,12 @@ pq_getkeepalivesinterval(Port *port) &size) < 0) { elog(LOG, "getsockopt(TCP_KEEPINTVL) failed: %m"); - port->default_keepalives_interval = -1; /* don't know */ + port->default_keepalives_interval = -1; /* don't know */ } #else /* We can't get the defaults on Windows, so return "don't know" */ port->default_keepalives_interval = -1; -#endif /* WIN32 */ +#endif /* WIN32 */ } return port->default_keepalives_interval; @@ -1822,7 +1822,7 @@ pq_setkeepalivesinterval(int interval, Port *port) if (pq_getkeepalivesinterval(port) < 0) { if (interval == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } @@ -1872,7 +1872,7 @@ pq_getkeepalivescount(Port *port) &size) < 0) { elog(LOG, "getsockopt(TCP_KEEPCNT) failed: %m"); - port->default_keepalives_count = -1; /* don't know */ + port->default_keepalives_count = -1; /* don't know */ } } @@ -1897,7 +1897,7 @@ pq_setkeepalivescount(int count, Port *port) if (pq_getkeepalivescount(port) < 0) { if (count == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 8846865ba3..7c7cddbdb1 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -217,7 +217,7 @@ main(int argc, char *argv[]) #endif if (argc > 1 && strcmp(argv[1], "--boot") == 0) - AuxiliaryProcessMain(argc, argv); /* does not return */ + AuxiliaryProcessMain(argc, argv); /* does not return */ else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0) GucInfoMain(); /* does not return */ else if (argc > 1 && strcmp(argv[1], "--single") == 0) @@ -225,7 +225,7 @@ main(int argc, char *argv[]) NULL, /* no dbname */ strdup(get_user_name_or_exit(progname))); /* does not return */ else - PostmasterMain(argc, argv); /* does not return */ + PostmasterMain(argc, argv); /* does not return */ abort(); /* should not get here */ } @@ -283,10 +283,10 @@ startup_hacks(const char *progname) { _set_FMA3_enable(0); } -#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */ +#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */ } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Initialize dummy_spinlock, in case we are on a platform where we have @@ -419,5 +419,5 @@ check_root(const char *progname) "more information on how to properly start the server.\n"); exit(1); } -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index ed51e1f6e0..91d64b7331 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -2311,7 +2311,7 @@ _equalParamRef(const ParamRef *a, const ParamRef *b) static bool _equalAConst(const A_Const *a, const A_Const *b) { - if (!equal(&a->val, &b->val)) /* hack for in-line Value field */ + if (!equal(&a->val, &b->val)) /* hack for in-line Value field */ return false; COMPARE_LOCATION_FIELD(location); diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c index f09aa248d8..acaf4b5315 100644 --- a/src/backend/nodes/list.c +++ b/src/backend/nodes/list.c @@ -52,7 +52,7 @@ check_list_invariants(const List *list) } #else #define check_list_invariants(l) -#endif /* USE_ASSERT_CHECKING */ +#endif /* USE_ASSERT_CHECKING */ /* * Return a freshly allocated List. Since empty non-NIL lists are diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c index f5fde1533f..0755039da9 100644 --- a/src/backend/nodes/makefuncs.c +++ b/src/backend/nodes/makefuncs.c @@ -522,8 +522,8 @@ makeFuncExpr(Oid funcid, Oid rettype, List *args, funcexpr = makeNode(FuncExpr); funcexpr->funcid = funcid; funcexpr->funcresulttype = rettype; - funcexpr->funcretset = false; /* only allowed case here */ - funcexpr->funcvariadic = false; /* only allowed case here */ + funcexpr->funcretset = false; /* only allowed case here */ + funcexpr->funcvariadic = false; /* only allowed case here */ funcexpr->funcformat = fformat; funcexpr->funccollid = funccollid; funcexpr->inputcollid = inputcollid; diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 2cceb99fd9..c87fb300d6 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -1007,10 +1007,10 @@ exprSetCollation(Node *expr, Oid collation) ((NullIfExpr *) expr)->opcollid = collation; break; case T_ScalarArrayOpExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_BoolExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_SubLink: #ifdef USE_ASSERT_CHECKING @@ -1036,13 +1036,13 @@ exprSetCollation(Node *expr, Oid collation) Assert(!OidIsValid(collation)); } } -#endif /* USE_ASSERT_CHECKING */ +#endif /* USE_ASSERT_CHECKING */ break; case T_FieldSelect: ((FieldSelect *) expr)->resultcollid = collation; break; case T_FieldStore: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_RelabelType: ((RelabelType *) expr)->resultcollid = collation; @@ -1054,7 +1054,7 @@ exprSetCollation(Node *expr, Oid collation) ((ArrayCoerceExpr *) expr)->resultcollid = collation; break; case T_ConvertRowtypeExpr: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_CaseExpr: ((CaseExpr *) expr)->casecollid = collation; @@ -1063,10 +1063,10 @@ exprSetCollation(Node *expr, Oid collation) ((ArrayExpr *) expr)->array_collid = collation; break; case T_RowExpr: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_RowCompareExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_CoalesceExpr: ((CoalesceExpr *) expr)->coalescecollid = collation; @@ -1075,7 +1075,7 @@ exprSetCollation(Node *expr, Oid collation) ((MinMaxExpr *) expr)->minmaxcollid = collation; break; case T_SQLValueFunction: - Assert(!OidIsValid(collation)); /* no collatable results */ + Assert(!OidIsValid(collation)); /* no collatable results */ break; case T_XmlExpr: Assert((((XmlExpr *) expr)->op == IS_XMLSERIALIZE) ? @@ -1083,10 +1083,10 @@ exprSetCollation(Node *expr, Oid collation) (collation == InvalidOid)); break; case T_NullTest: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_BooleanTest: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_CoerceToDomain: ((CoerceToDomain *) expr)->resultcollid = collation; @@ -1098,11 +1098,11 @@ exprSetCollation(Node *expr, Oid collation) ((SetToDefault *) expr)->collation = collation; break; case T_CurrentOfExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_NextValueExpr: - Assert(!OidIsValid(collation)); /* result is always an integer - * type */ + Assert(!OidIsValid(collation)); /* result is always an integer + * type */ break; default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr)); diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 0fb08b94db..ac0cb3bc22 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -120,7 +120,7 @@ EstimateParamListSpace(ParamListInfo paramLI) } sz = add_size(sz, sizeof(Oid)); /* space for type OID */ - sz = add_size(sz, sizeof(uint16)); /* space for pflags */ + sz = add_size(sz, sizeof(uint16)); /* space for pflags */ /* space for datum/isnull */ if (OidIsValid(typeOid)) diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 84147f9754..2988e8bd16 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -446,8 +446,7 @@ _readRangeVar(void) { READ_LOCALS(RangeVar); - local_node->catalogname = NULL; /* not currently saved in output - * format */ + local_node->catalogname = NULL; /* not currently saved in output format */ READ_STRING_FIELD(schemaname); READ_STRING_FIELD(relname); @@ -539,7 +538,7 @@ _readConst(void) token = pg_strtok(&length); /* skip :constvalue */ if (local_node->constisnull) - token = pg_strtok(&length); /* skip "<>" */ + token = pg_strtok(&length); /* skip "<>" */ else local_node->constvalue = readDatum(local_node->constbyval); diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c index bbd39a2ed9..06f20a2148 100644 --- a/src/backend/nodes/tidbitmap.c +++ b/src/backend/nodes/tidbitmap.c @@ -216,7 +216,7 @@ typedef struct PTIterationArray */ struct TBMSharedIterator { - TBMSharedIteratorState *state; /* shared state */ + TBMSharedIteratorState *state; /* shared state */ PTEntryArray *ptbase; /* pagetable element array */ PTIterationArray *ptpages; /* sorted exact page index list */ PTIterationArray *ptchunks; /* sorted lossy page index list */ @@ -297,8 +297,8 @@ tbm_create(long maxbytes, dsa_area *dsa) */ nbuckets = maxbytes / (sizeof(PagetableEntry) + sizeof(Pointer) + sizeof(Pointer)); - nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */ - nbuckets = Max(nbuckets, 16); /* sanity limit */ + nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */ + nbuckets = Max(nbuckets, 16); /* sanity limit */ tbm->maxentries = (int) nbuckets; tbm->lossify_start = 0; tbm->dsa = dsa; diff --git a/src/backend/optimizer/geqo/geqo_cx.c b/src/backend/optimizer/geqo/geqo_cx.c index c72081e81a..d05327d8ab 100644 --- a/src/backend/optimizer/geqo/geqo_cx.c +++ b/src/backend/optimizer/geqo/geqo_cx.c @@ -121,4 +121,4 @@ cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, return num_diffs; } -#endif /* defined(CX) */ +#endif /* defined(CX) */ diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c index 173be44409..fbabe2e25a 100644 --- a/src/backend/optimizer/geqo/geqo_erx.c +++ b/src/backend/optimizer/geqo/geqo_erx.c @@ -468,4 +468,4 @@ edge_failure(PlannerInfo *root, Gene *gene, int index, Edge *edge_table, int num return 0; /* to keep the compiler quiet */ } -#endif /* defined(ERX) */ +#endif /* defined(ERX) */ diff --git a/src/backend/optimizer/geqo/geqo_misc.c b/src/backend/optimizer/geqo/geqo_misc.c index 503a19f6d6..937cb5fe0f 100644 --- a/src/backend/optimizer/geqo/geqo_misc.c +++ b/src/backend/optimizer/geqo/geqo_misc.c @@ -129,4 +129,4 @@ print_edge_table(FILE *fp, Edge *edge_table, int num_gene) fflush(fp); } -#endif /* GEQO_DEBUG */ +#endif /* GEQO_DEBUG */ diff --git a/src/backend/optimizer/geqo/geqo_mutation.c b/src/backend/optimizer/geqo/geqo_mutation.c index c6af00a2a7..2af0295d69 100644 --- a/src/backend/optimizer/geqo/geqo_mutation.c +++ b/src/backend/optimizer/geqo/geqo_mutation.c @@ -63,4 +63,4 @@ geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene) } } -#endif /* defined(CX) */ +#endif /* defined(CX) */ diff --git a/src/backend/optimizer/geqo/geqo_ox1.c b/src/backend/optimizer/geqo/geqo_ox1.c index 891cfa2403..53dacb811f 100644 --- a/src/backend/optimizer/geqo/geqo_ox1.c +++ b/src/backend/optimizer/geqo/geqo_ox1.c @@ -92,4 +92,4 @@ ox1(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(OX1) */ +#endif /* defined(OX1) */ diff --git a/src/backend/optimizer/geqo/geqo_ox2.c b/src/backend/optimizer/geqo/geqo_ox2.c index b43455d3eb..8d5baa9826 100644 --- a/src/backend/optimizer/geqo/geqo_ox2.c +++ b/src/backend/optimizer/geqo/geqo_ox2.c @@ -109,4 +109,4 @@ ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(OX2) */ +#endif /* defined(OX2) */ diff --git a/src/backend/optimizer/geqo/geqo_pmx.c b/src/backend/optimizer/geqo/geqo_pmx.c index e9485cc8b5..ddbc78172c 100644 --- a/src/backend/optimizer/geqo/geqo_pmx.c +++ b/src/backend/optimizer/geqo/geqo_pmx.c @@ -221,4 +221,4 @@ pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene) pfree(check_list); } -#endif /* defined(PMX) */ +#endif /* defined(PMX) */ diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c index 0f7a26c9a1..596a2cda20 100644 --- a/src/backend/optimizer/geqo/geqo_pool.c +++ b/src/backend/optimizer/geqo/geqo_pool.c @@ -54,7 +54,7 @@ alloc_pool(PlannerInfo *root, int pool_size, int string_length) new_pool->data = (Chromosome *) palloc(pool_size * sizeof(Chromosome)); /* all gene */ - chromo = (Chromosome *) new_pool->data; /* vector of all chromos */ + chromo = (Chromosome *) new_pool->data; /* vector of all chromos */ for (i = 0; i < pool_size; i++) chromo[i].string = palloc((string_length + 1) * sizeof(Gene)); diff --git a/src/backend/optimizer/geqo/geqo_px.c b/src/backend/optimizer/geqo/geqo_px.c index f7f615462c..2e7748c5aa 100644 --- a/src/backend/optimizer/geqo/geqo_px.c +++ b/src/backend/optimizer/geqo/geqo_px.c @@ -107,4 +107,4 @@ px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(PX) */ +#endif /* defined(PX) */ diff --git a/src/backend/optimizer/geqo/geqo_recombination.c b/src/backend/optimizer/geqo/geqo_recombination.c index a61547c16d..eb6ab42808 100644 --- a/src/backend/optimizer/geqo/geqo_recombination.c +++ b/src/backend/optimizer/geqo/geqo_recombination.c @@ -89,4 +89,4 @@ free_city_table(PlannerInfo *root, City *city_table) pfree(city_table); } -#endif /* CX || PX || OX1 || OX2 */ +#endif /* CX || PX || OX1 || OX2 */ diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 78ca55bbd6..23b524fce5 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -159,7 +159,7 @@ make_one_rel(PlannerInfo *root, List *joinlist) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (brel->reloptkind != RELOPT_BASEREL) @@ -258,7 +258,7 @@ set_base_rel_sizes(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) @@ -300,7 +300,7 @@ set_base_rel_pathlists(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) @@ -3442,4 +3442,4 @@ debug_print_rel(PlannerInfo *root, RelOptInfo *rel) fflush(stdout); } -#endif /* OPTIMIZER_DEBUG */ +#endif /* OPTIMIZER_DEBUG */ diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c index 758ddea4a5..8d09f0b32b 100644 --- a/src/backend/optimizer/path/clausesel.c +++ b/src/backend/optimizer/path/clausesel.c @@ -31,7 +31,7 @@ */ typedef struct RangeQueryClause { - struct RangeQueryClause *next; /* next in linked list */ + struct RangeQueryClause *next; /* next in linked list */ Node *var; /* The common variable of the clauses */ bool have_lobound; /* found a low-bound clause yet? */ bool have_hibound; /* found a high-bound clause yet? */ @@ -848,7 +848,7 @@ clause_selectivity(PlannerInfo *root, #ifdef SELECTIVITY_DEBUG elog(DEBUG4, "clause_selectivity: s1 %f", s1); -#endif /* SELECTIVITY_DEBUG */ +#endif /* SELECTIVITY_DEBUG */ return s1; } diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 6ed3c634b8..c5c4580bc0 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -2963,7 +2963,7 @@ initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace, */ ExecChooseHashTableSize(inner_path_rows, inner_path->pathtarget->width, - true, /* useskew */ + true, /* useskew */ &numbuckets, &numbatches, &num_skew_mcvs); @@ -4047,7 +4047,7 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel, nrows = rel->tuples * clauselist_selectivity(root, allclauses, - rel->relid, /* do not use 0! */ + rel->relid, /* do not use 0! */ JOIN_INNER, NULL); nrows = clamp_row_est(nrows); diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c index 67bd760fb4..b65bf818b5 100644 --- a/src/backend/optimizer/path/equivclass.c +++ b/src/backend/optimizer/path/equivclass.c @@ -244,7 +244,7 @@ process_equivalence(PlannerInfo *root, RestrictInfo *restrictinfo, { EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2); - Assert(!cur_em->em_is_child); /* no children yet */ + Assert(!cur_em->em_is_child); /* no children yet */ /* * If below an outer join, don't match constants: they're not as @@ -1704,7 +1704,7 @@ reconsider_outer_join_clause(PlannerInfo *root, RestrictInfo *rinfo, { EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2); - Assert(!cur_em->em_is_child); /* no children yet */ + Assert(!cur_em->em_is_child); /* no children yet */ if (equal(outervar, cur_em->em_expr)) { match = true; @@ -1834,7 +1834,7 @@ reconsider_full_join_clause(PlannerInfo *root, RestrictInfo *rinfo) foreach(lc2, cur_ec->ec_members) { coal_em = (EquivalenceMember *) lfirst(lc2); - Assert(!coal_em->em_is_child); /* no children yet */ + Assert(!coal_em->em_is_child); /* no children yet */ if (IsA(coal_em->em_expr, CoalesceExpr)) { CoalesceExpr *cexpr = (CoalesceExpr *) coal_em->em_expr; @@ -1997,7 +1997,7 @@ match_eclasses_to_foreign_key_col(PlannerInfo *root, Index var2varno = fkinfo->ref_relid; AttrNumber var2attno = fkinfo->confkey[colno]; Oid eqop = fkinfo->conpfeqop[colno]; - List *opfamilies = NIL; /* compute only if needed */ + List *opfamilies = NIL; /* compute only if needed */ ListCell *lc1; foreach(lc1, root->eq_classes) diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 07ab33902b..97611211f0 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -1170,7 +1170,7 @@ build_paths_for_OR(PlannerInfo *root, RelOptInfo *rel, List *clauses, List *other_clauses) { List *result = NIL; - List *all_clauses = NIL; /* not computed till needed */ + List *all_clauses = NIL; /* not computed till needed */ ListCell *lc; foreach(lc, rel->indexlist) @@ -1383,7 +1383,7 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths) Assert(npaths > 0); /* else caller error */ if (npaths == 1) - return (Path *) linitial(paths); /* easy case */ + return (Path *) linitial(paths); /* easy case */ /* * In theory we should consider every nonempty subset of the given paths. @@ -1650,7 +1650,7 @@ bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths) apath.path.pathtype = T_BitmapAnd; apath.path.parent = rel; apath.path.pathtarget = rel->reltarget; - apath.path.param_info = NULL; /* not used in bitmap trees */ + apath.path.param_info = NULL; /* not used in bitmap trees */ apath.path.pathkeys = NIL; apath.bitmapquals = paths; cost_bitmap_and_node(&apath, root); @@ -1982,7 +1982,7 @@ get_loop_count(PlannerInfo *root, Index cur_relid, Relids outer_relids) outer_rel = root->simple_rel_array[outer_relid]; if (outer_rel == NULL) continue; - Assert(outer_rel->relid == outer_relid); /* sanity check on array */ + Assert(outer_rel->relid == outer_relid); /* sanity check on array */ /* Other relation could be proven empty, if so ignore */ if (IS_DUMMY_REL(outer_rel)) @@ -2632,7 +2632,7 @@ match_pathkeys_to_index(IndexOptInfo *index, List *pathkeys, return; } - *orderby_clauses_p = orderby_clauses; /* success! */ + *orderby_clauses_p = orderby_clauses; /* success! */ *clause_columns_p = clause_columns; } @@ -3062,7 +3062,7 @@ relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel, if (match_index_to_operand(rexpr, c, ind)) { - matched = true; /* column is unique */ + matched = true; /* column is unique */ break; } } @@ -3983,7 +3983,7 @@ adjust_rowcompare_for_index(RowCompareExpr *clause, if (!var_on_left) { expr_op = get_commutator(expr_op); - if (!OidIsValid(expr_op)) /* should not happen */ + if (!OidIsValid(expr_op)) /* should not happen */ elog(ERROR, "could not find commutator of member %d(%u,%u) of opfamily %u", op_strategy, lefttype, righttype, opfam); } diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index c130d2f17f..23aa735296 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -1104,7 +1104,7 @@ generate_mergejoin_paths(PlannerInfo *root, } num_sortkeys = list_length(innersortkeys); if (num_sortkeys > 1 && !useallclauses) - trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */ + trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */ else trialsortkeys = innersortkeys; /* won't really truncate */ @@ -1732,7 +1732,7 @@ hash_inner_and_outer(PlannerInfo *root, if (outerpath == cheapest_startup_outer && innerpath == cheapest_total_inner) - continue; /* already tried it */ + continue; /* already tried it */ try_hashjoin_path(root, joinrel, diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index 2c269062ec..6933e73018 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -196,7 +196,7 @@ make_pathkey_from_sortinfo(PlannerInfo *root, opcintype, opcintype, BTEqualStrategyNumber); - if (!OidIsValid(equality_op)) /* shouldn't happen */ + if (!OidIsValid(equality_op)) /* shouldn't happen */ elog(ERROR, "could not find equality operator for opfamily %u", opfamily); opfamilies = get_mergejoin_opfamilies(equality_op); diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 19aa4575a9..b510faa3e1 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -63,9 +63,9 @@ * ressortgroupref labels. This is passed down by parent nodes such as Sort * and Group, which need these values to be available in their inputs. */ -#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ -#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ -#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ +#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ +#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ +#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ static Plan *create_plan_recurse(PlannerInfo *root, Path *best_path, @@ -1418,7 +1418,7 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path, int flags) * for the IN clause operators' RHS datatype. */ eqop = get_equality_op_for_ordering_op(sortop, NULL); - if (!OidIsValid(eqop)) /* shouldn't happen */ + if (!OidIsValid(eqop)) /* shouldn't happen */ elog(ERROR, "could not find equality operator for ordering operator %u", sortop); @@ -2908,7 +2908,7 @@ create_bitmap_subplan(PlannerInfo *root, Path *bitmapqual, plan->total_cost = opath->path.total_cost; plan->plan_rows = clamp_row_est(opath->bitmapselectivity * opath->path.parent->tuples); - plan->plan_width = 0; /* meaningless */ + plan->plan_width = 0; /* meaningless */ plan->parallel_aware = false; plan->parallel_safe = opath->path.parallel_safe; } @@ -3394,7 +3394,7 @@ create_worktablescan_plan(PlannerInfo *root, Path *best_path, if (!cteroot) /* shouldn't happen */ elog(ERROR, "bad levelsup for CTE \"%s\"", rte->ctename); } - if (cteroot->wt_param_id < 0) /* shouldn't happen */ + if (cteroot->wt_param_id < 0) /* shouldn't happen */ elog(ERROR, "could not find param ID for CTE \"%s\"", rte->ctename); /* Sort clauses into best execution order */ @@ -5726,7 +5726,7 @@ prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys, NULL, true); tlist = lappend(tlist, tle); - lefttree->targetlist = tlist; /* just in case NIL before */ + lefttree->targetlist = tlist; /* just in case NIL before */ } /* @@ -6426,7 +6426,7 @@ make_modifytable(PlannerInfo *root, node->partitioned_rels = partitioned_rels; node->resultRelations = resultRelations; node->resultRelIndex = -1; /* will be set correctly in setrefs.c */ - node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */ + node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */ node->plans = subplans; if (!onconflict) { diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c index ebd442ad4d..63cb055ef0 100644 --- a/src/backend/optimizer/plan/initsplan.c +++ b/src/backend/optimizer/plan/initsplan.c @@ -287,7 +287,7 @@ find_lateral_references(PlannerInfo *root) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* * This bit is less obvious than it might look. We ignore appendrel @@ -436,7 +436,7 @@ create_lateral_join_info(PlannerInfo *root) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (brel->reloptkind != RELOPT_BASEREL) @@ -945,7 +945,7 @@ deconstruct_recurse(PlannerInfo *root, Node *jtnode, bool below_outer_join, /* JOIN_RIGHT was eliminated during reduce_outer_joins() */ elog(ERROR, "unrecognized join type: %d", (int) j->jointype); - nonnullable_rels = NULL; /* keep compiler quiet */ + nonnullable_rels = NULL; /* keep compiler quiet */ nullable_rels = NULL; leftjoinlist = rightjoinlist = NIL; break; @@ -1214,7 +1214,7 @@ make_outerjoininfo(PlannerInfo *root, { sjinfo->min_lefthand = bms_copy(left_rels); sjinfo->min_righthand = bms_copy(right_rels); - sjinfo->lhs_strict = false; /* don't care about this */ + sjinfo->lhs_strict = false; /* don't care about this */ return sjinfo; } @@ -2047,7 +2047,7 @@ distribute_qual_to_rels(PlannerInfo *root, Node *clause, static bool check_outerjoin_delay(PlannerInfo *root, Relids *relids_p, /* in/out parameter */ - Relids *nullable_relids_p, /* output parameter */ + Relids *nullable_relids_p, /* output parameter */ bool is_pushed_down) { Relids relids; @@ -2304,8 +2304,8 @@ process_implied_equality(PlannerInfo *root, * original (this is necessary in case there are subselects in there...) */ clause = make_opclause(opno, - BOOLOID, /* opresulttype */ - false, /* opretset */ + BOOLOID, /* opresulttype */ + false, /* opretset */ copyObject(item1), copyObject(item2), InvalidOid, @@ -2367,8 +2367,8 @@ build_implied_join_equality(Oid opno, * original (this is necessary in case there are subselects in there...) */ clause = make_opclause(opno, - BOOLOID, /* opresulttype */ - false, /* opretset */ + BOOLOID, /* opresulttype */ + false, /* opretset */ copyObject(item1), copyObject(item2), InvalidOid, @@ -2378,12 +2378,12 @@ build_implied_join_equality(Oid opno, * Build the RestrictInfo node itself. */ restrictinfo = make_restrictinfo(clause, - true, /* is_pushed_down */ - false, /* outerjoin_delayed */ - false, /* pseudoconstant */ + true, /* is_pushed_down */ + false, /* outerjoin_delayed */ + false, /* pseudoconstant */ security_level, /* security_level */ qualscope, /* required_relids */ - NULL, /* outer_relids */ + NULL, /* outer_relids */ nullable_relids); /* nullable_relids */ /* Set mergejoinability/hashjoinability flags */ diff --git a/src/backend/optimizer/plan/planagg.c b/src/backend/optimizer/plan/planagg.c index 55657360fc..6d5969cd44 100644 --- a/src/backend/optimizer/plan/planagg.c +++ b/src/backend/optimizer/plan/planagg.c @@ -89,8 +89,8 @@ preprocess_minmax_aggregates(PlannerInfo *root, List *tlist) if (!parse->hasAggs) return; - Assert(!parse->setOperations); /* shouldn't get here if a setop */ - Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */ + Assert(!parse->setOperations); /* shouldn't get here if a setop */ + Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */ /* * Reject unoptimizable cases. diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 74de3b818f..f4e0a6ea3d 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -246,7 +246,7 @@ query_planner(PlannerInfo *root, List *tlist, if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ if (IS_SIMPLE_REL(brel)) total_pages += (double) brel->pages; diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 40cb79d4cd..4b32f59128 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -2412,7 +2412,7 @@ preprocess_rowmarks(PlannerInfo *root) newrc->markType = select_rowmark_type(rte, LCS_NONE); newrc->allMarkTypes = (1 << newrc->markType); newrc->strength = LCS_NONE; - newrc->waitPolicy = LockWaitBlock; /* doesn't matter */ + newrc->waitPolicy = LockWaitBlock; /* doesn't matter */ newrc->isParent = false; prowmarks = lappend(prowmarks, newrc); @@ -2469,7 +2469,7 @@ select_rowmark_type(RangeTblEntry *rte, LockClauseStrength strength) break; } elog(ERROR, "unrecognized LockClauseStrength %d", (int) strength); - return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */ + return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */ } } @@ -2519,7 +2519,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction, { *count_est = DatumGetInt64(((Const *) est)->constvalue); if (*count_est <= 0) - *count_est = 1; /* force to at least 1 */ + *count_est = 1; /* force to at least 1 */ } } else @@ -2653,7 +2653,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction, /* both fractional, so add them together */ tuple_fraction += limit_fraction; if (tuple_fraction >= 1.0) - tuple_fraction = 0.0; /* assume fetch all */ + tuple_fraction = 0.0; /* assume fetch all */ } } } @@ -3514,7 +3514,7 @@ create_grouping_paths(PlannerInfo *root, RelOptInfo *grouped_rel; PathTarget *partial_grouping_target = NULL; AggClauseCosts agg_partial_costs; /* parallel only */ - AggClauseCosts agg_final_costs; /* parallel only */ + AggClauseCosts agg_final_costs; /* parallel only */ Size hashaggtablesize; double dNumGroups; double dNumPartialGroups = 0; @@ -5626,7 +5626,7 @@ make_sort_input_target(PlannerInfo *root, /* Shouldn't get here unless query has ORDER BY */ Assert(parse->sortClause); - *have_postponed_srfs = false; /* default result */ + *have_postponed_srfs = false; /* default result */ /* Inspect tlist and collect per-column information */ ncols = list_length(final_target->exprs); diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 5cac171cb6..01b06848af 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -297,7 +297,7 @@ add_rtes_to_flat_rtable(PlannerInfo *root, bool recursing) if (rel != NULL) { - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* * The subquery might never have been planned at all, if it @@ -1908,7 +1908,7 @@ set_dummy_tlist_references(Plan *plan, int rtoffset) } else { - newvar->varnoold = 0; /* wasn't ever a plain Var */ + newvar->varnoold = 0; /* wasn't ever a plain Var */ newvar->varoattno = 0; } @@ -2137,7 +2137,7 @@ search_indexed_tlist_for_sortgroupref(Expr *node, Var *newvar; newvar = makeVarFromTargetEntry(newvarno, tle); - newvar->varnoold = 0; /* wasn't ever a plain Var */ + newvar->varnoold = 0; /* wasn't ever a plain Var */ newvar->varoattno = 0; return newvar; } diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index cfdd770f6a..08033183e7 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -44,7 +44,7 @@ typedef struct pullup_replace_vars_context RangeTblEntry *target_rte; /* RTE of subquery */ Relids relids; /* relids within subquery, as numbered after * pullup (set only if target_rte->lateral) */ - bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */ + bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */ int varno; /* varno of subquery */ bool need_phvs; /* do we need PlaceHolderVars? */ bool wrap_non_vars; /* do we need 'em on *all* non-Vars? */ @@ -772,7 +772,7 @@ pull_up_subqueries_recurse(PlannerInfo *root, Node *jtnode, if (deletion_ok && !have_undeleted_child) { /* OK to delete this FromExpr entirely */ - root->hasDeletedRTEs = true; /* probably is set already */ + root->hasDeletedRTEs = true; /* probably is set already */ return NULL; } } @@ -2088,7 +2088,7 @@ pullup_replace_vars_callback(Var *var, &colnames, &fields); /* Adjust the generated per-field Vars, but don't insert PHVs */ rcon->need_phvs = false; - context->sublevels_up = 0; /* to match the expandRTE output */ + context->sublevels_up = 0; /* to match the expandRTE output */ fields = (List *) replace_rte_variables_mutator((Node *) fields, context); rcon->need_phvs = save_need_phvs; @@ -2784,7 +2784,7 @@ reduce_outer_joins_pass2(Node *jtnode, if (right_state->contains_outer) { - if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */ + if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */ { /* pass appropriate constraints, per comment above */ pass_nonnullable_rels = local_nonnullable_rels; diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c index de47153bac..afc733f183 100644 --- a/src/backend/optimizer/prep/preptlist.c +++ b/src/backend/optimizer/prep/preptlist.c @@ -301,7 +301,7 @@ expand_targetlist(List *tlist, int command_type, attcollation, att_tup->attlen, (Datum) 0, - true, /* isnull */ + true, /* isnull */ att_tup->attbyval); new_expr = coerce_to_domain(new_expr, InvalidOid, -1, @@ -319,7 +319,7 @@ expand_targetlist(List *tlist, int command_type, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); } break; @@ -341,7 +341,7 @@ expand_targetlist(List *tlist, int command_type, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); } break; diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index a1dafc8e0f..b9e5dc25eb 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -1399,7 +1399,7 @@ contain_context_dependent_node(Node *clause) return contain_context_dependent_node_walker(clause, &flags); } -#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */ +#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */ static bool contain_context_dependent_node_walker(Node *node, int *flags) @@ -2434,7 +2434,7 @@ estimate_expression_value(PlannerInfo *root, Node *node) { eval_const_expressions_context context; - context.boundParams = root->glob->boundParams; /* bound Params */ + context.boundParams = root->glob->boundParams; /* bound Params */ /* we do not need to mark the plan as depending on inlined functions */ context.root = NULL; context.active_fns = NIL; /* nothing being recursively simplified */ @@ -2712,8 +2712,8 @@ eval_const_expressions_mutator(Node *node, * Need to get OID of underlying function. Okay to * scribble on input to this extent. */ - set_opfuncid((OpExpr *) expr); /* rely on struct - * equivalence */ + set_opfuncid((OpExpr *) expr); /* rely on struct + * equivalence */ /* * Code for op/func reduction is pretty bulky, so split it @@ -3114,7 +3114,7 @@ eval_const_expressions_mutator(Node *node, if (newarg && IsA(newarg, Const)) { context->case_val = newarg; - newarg = NULL; /* not needed anymore, see above */ + newarg = NULL; /* not needed anymore, see above */ } else context->case_val = NULL; @@ -3463,7 +3463,7 @@ eval_const_expressions_mutator(Node *node, default: elog(ERROR, "unrecognized nulltesttype: %d", (int) ntest->nulltesttype); - result = false; /* keep compiler quiet */ + result = false; /* keep compiler quiet */ break; } @@ -3517,7 +3517,7 @@ eval_const_expressions_mutator(Node *node, default: elog(ERROR, "unrecognized booltesttype: %d", (int) btest->booltesttype); - result = false; /* keep compiler quiet */ + result = false; /* keep compiler quiet */ break; } @@ -4263,7 +4263,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod, newexpr->funcretset = false; newexpr->funcvariadic = funcvariadic; newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */ - newexpr->funccollid = result_collid; /* doesn't matter */ + newexpr->funccollid = result_collid; /* doesn't matter */ newexpr->inputcollid = input_collid; newexpr->args = args; newexpr->location = -1; diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c index b6867e3001..dd7cfc94b8 100644 --- a/src/backend/optimizer/util/orclauses.c +++ b/src/backend/optimizer/util/orclauses.c @@ -84,7 +84,7 @@ extract_restriction_or_clauses(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index ec4a093d9f..63afc04b62 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -411,7 +411,7 @@ set_cheapest(RelOptInfo *parent_rel) void add_path(RelOptInfo *parent_rel, Path *new_path) { - bool accept_new = true; /* unless we find a superior old path */ + bool accept_new = true; /* unless we find a superior old path */ ListCell *insert_after = NULL; /* where to insert new item */ List *new_path_pathkeys; ListCell *p1; @@ -484,7 +484,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET1) && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ } else if (keyscmp == PATHKEYS_BETTER2) { @@ -492,7 +492,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET2) && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ } else /* keyscmp == PATHKEYS_EQUAL */ { @@ -534,11 +534,11 @@ add_path(RelOptInfo *parent_rel, Path *new_path) else if (outercmp == BMS_SUBSET1 && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ else if (outercmp == BMS_SUBSET2 && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ /* else different parameterizations, keep both */ } break; @@ -551,7 +551,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET1) && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ } break; case COSTS_BETTER2: @@ -563,7 +563,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET2) && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ } break; case COSTS_DIFFERENT: @@ -751,7 +751,7 @@ add_path_precheck(RelOptInfo *parent_rel, void add_partial_path(RelOptInfo *parent_rel, Path *new_path) { - bool accept_new = true; /* unless we find a superior old path */ + bool accept_new = true; /* unless we find a superior old path */ ListCell *insert_after = NULL; /* where to insert new item */ ListCell *p1; ListCell *p1_prev; @@ -1081,7 +1081,7 @@ create_bitmap_heap_path(PlannerInfo *root, pathnode->path.parallel_aware = parallel_degree > 0 ? true : false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = parallel_degree; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapqual = bitmapqual; @@ -1118,7 +1118,7 @@ create_bitmap_and_path(PlannerInfo *root, pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapquals = bitmapquals; @@ -1154,7 +1154,7 @@ create_bitmap_or_path(PlannerInfo *root, pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapquals = bitmapquals; @@ -1182,7 +1182,7 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->tidquals = tidquals; @@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = parallel_workers; - pathnode->path.pathkeys = NIL; /* result is always considered - * unsorted */ + pathnode->path.pathkeys = NIL; /* result is always considered unsorted */ pathnode->partitioned_rels = list_copy(partitioned_rels); pathnode->subpaths = subpaths; @@ -1311,7 +1310,7 @@ create_merge_append_path(PlannerInfo *root, else { /* We'll need to insert a Sort node, so include cost for that */ - Path sort_path; /* dummy for result of cost_sort */ + Path sort_path; /* dummy for result of cost_sort */ cost_sort(&sort_path, root, @@ -1743,7 +1742,7 @@ create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = false; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* Gather has unordered result */ + pathnode->path.pathkeys = NIL; /* Gather has unordered result */ pathnode->subpath = subpath; pathnode->num_workers = subpath->parallel_workers; @@ -2818,8 +2817,8 @@ create_groupingsets_path(PlannerInfo *root, } else { - Path sort_path; /* dummy for result of cost_sort */ - Path agg_path; /* dummy for result of cost_agg */ + Path sort_path; /* dummy for result of cost_sort */ + Path agg_path; /* dummy for result of cost_agg */ if (rollup->is_hashed || is_first_sort) { diff --git a/src/backend/optimizer/util/placeholder.c b/src/backend/optimizer/util/placeholder.c index 698a387ac2..970542dde5 100644 --- a/src/backend/optimizer/util/placeholder.c +++ b/src/backend/optimizer/util/placeholder.c @@ -101,7 +101,7 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv, rels_used = pull_varnos((Node *) phv->phexpr); phinfo->ph_lateral = bms_difference(rels_used, phv->phrels); if (bms_is_empty(phinfo->ph_lateral)) - phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */ + phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */ phinfo->ph_eval_at = bms_int_members(rels_used, phv->phrels); /* If no contained vars, force evaluation at syntactic location */ if (bms_is_empty(phinfo->ph_eval_at)) diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 939045dc41..9dc35c1aef 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -354,8 +354,8 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, /* Build targetlist using the completed indexprs data */ info->indextlist = build_index_tlist(root, info, relation); - info->indrestrictinfo = NIL; /* set later, in indxpath.c */ - info->predOK = false; /* set later, in indxpath.c */ + info->indrestrictinfo = NIL; /* set later, in indxpath.c */ + info->predOK = false; /* set later, in indxpath.c */ info->unique = index->indisunique; info->immediate = index->indimmediate; info->hypothetical = false; @@ -827,7 +827,7 @@ infer_collation_opclass_match(InferenceElem *elem, Relation idxRel, List *idxExprs) { AttrNumber natt; - Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */ + Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */ Oid inferopcinputtype = InvalidOid; /* OID of opclass input type */ int nplain = 0; /* # plain attrs observed */ diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 72d70d52d1..536d24b698 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -382,7 +382,7 @@ predicate_implied_by_recurse(Node *clause, Node *predicate, iterate_end(pred_info); if (!presult) { - result = false; /* doesn't imply any of B's */ + result = false; /* doesn't imply any of B's */ break; } } @@ -650,7 +650,7 @@ predicate_refuted_by_recurse(Node *clause, Node *predicate, iterate_end(pred_info); if (!presult) { - result = false; /* citem refutes nothing */ + result = false; /* citem refutes nothing */ break; } } @@ -1360,12 +1360,12 @@ static const bool BT_implies_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {TRUE, TRUE, none, none, none, TRUE}, /* LT */ - {none, TRUE, none, none, none, none}, /* LE */ - {none, TRUE, TRUE, TRUE, none, none}, /* EQ */ - {none, none, none, TRUE, none, none}, /* GE */ - {none, none, none, TRUE, TRUE, TRUE}, /* GT */ - {none, none, none, none, none, TRUE} /* NE */ + {TRUE, TRUE, none, none, none, TRUE}, /* LT */ + {none, TRUE, none, none, none, none}, /* LE */ + {none, TRUE, TRUE, TRUE, none, none}, /* EQ */ + {none, none, none, TRUE, none, none}, /* GE */ + {none, none, none, TRUE, TRUE, TRUE}, /* GT */ + {none, none, none, none, none, TRUE} /* NE */ }; static const bool BT_refutes_table[6][6] = { @@ -1373,12 +1373,12 @@ static const bool BT_refutes_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {none, none, TRUE, TRUE, TRUE, none}, /* LT */ - {none, none, none, none, TRUE, none}, /* LE */ - {TRUE, none, none, none, TRUE, TRUE}, /* EQ */ - {TRUE, none, none, none, none, none}, /* GE */ - {TRUE, TRUE, TRUE, none, none, none}, /* GT */ - {none, none, TRUE, none, none, none} /* NE */ + {none, none, TRUE, TRUE, TRUE, none}, /* LT */ + {none, none, none, none, TRUE, none}, /* LE */ + {TRUE, none, none, none, TRUE, TRUE}, /* EQ */ + {TRUE, none, none, none, none, none}, /* GE */ + {TRUE, TRUE, TRUE, none, none, none}, /* GT */ + {none, none, TRUE, none, none, none} /* NE */ }; static const StrategyNumber BT_implic_table[6][6] = { @@ -1386,12 +1386,12 @@ static const StrategyNumber BT_implic_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {BTGE, BTGE, none, none, none, BTGE}, /* LT */ - {BTGT, BTGE, none, none, none, BTGT}, /* LE */ - {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */ - {none, none, none, BTLE, BTLT, BTLT}, /* GE */ - {none, none, none, BTLE, BTLE, BTLE}, /* GT */ - {none, none, none, none, none, BTEQ} /* NE */ + {BTGE, BTGE, none, none, none, BTGE}, /* LT */ + {BTGT, BTGE, none, none, none, BTGT}, /* LE */ + {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */ + {none, none, none, BTLE, BTLT, BTLT}, /* GE */ + {none, none, none, BTLE, BTLE, BTLE}, /* GT */ + {none, none, none, none, none, BTEQ} /* NE */ }; static const StrategyNumber BT_refute_table[6][6] = { @@ -1399,12 +1399,12 @@ static const StrategyNumber BT_refute_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {none, none, BTGE, BTGE, BTGE, none}, /* LT */ - {none, none, BTGT, BTGT, BTGE, none}, /* LE */ - {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */ - {BTLE, BTLT, BTLT, none, none, none}, /* GE */ - {BTLE, BTLE, BTLE, none, none, none}, /* GT */ - {none, none, BTEQ, none, none, none} /* NE */ + {none, none, BTGE, BTGE, BTGE, none}, /* LT */ + {none, none, BTGT, BTGT, BTGE, none}, /* LE */ + {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */ + {BTLE, BTLT, BTLT, none, none, none}, /* GE */ + {BTLE, BTLE, BTLE, none, none, none}, /* GT */ + {none, none, BTEQ, none, none, none} /* NE */ }; diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c index 76a3868fa0..22f5ddac58 100644 --- a/src/backend/optimizer/util/relnode.c +++ b/src/backend/optimizer/util/relnode.c @@ -108,8 +108,8 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent) rel->rows = 0; /* cheap startup cost is interesting iff not all tuples to be retrieved */ rel->consider_startup = (root->tuple_fraction > 0); - rel->consider_param_startup = false; /* might get changed later */ - rel->consider_parallel = false; /* might get changed later */ + rel->consider_param_startup = false; /* might get changed later */ + rel->consider_parallel = false; /* might get changed later */ rel->reltarget = create_empty_pathtarget(); rel->pathlist = NIL; rel->ppilist = NIL; @@ -132,7 +132,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent) rel->allvisfrac = 0; rel->subroot = NULL; rel->subplan_params = NIL; - rel->rel_parallel_workers = -1; /* set up in get_relation_info */ + rel->rel_parallel_workers = -1; /* set up in get_relation_info */ rel->serverid = InvalidOid; rel->userid = rte->checkAsUser; rel->useridiscurrent = false; @@ -944,7 +944,7 @@ fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind, Relids relids) /* cheap startup cost is interesting iff not all tuples to be retrieved */ upperrel->consider_startup = (root->tuple_fraction > 0); upperrel->consider_param_startup = false; - upperrel->consider_parallel = false; /* might get changed later */ + upperrel->consider_parallel = false; /* might get changed later */ upperrel->reltarget = create_empty_pathtarget(); upperrel->pathlist = NIL; upperrel->cheapest_startup_path = NULL; diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimizer/util/restrictinfo.c index e946290af5..ebae0cd8ce 100644 --- a/src/backend/optimizer/util/restrictinfo.c +++ b/src/backend/optimizer/util/restrictinfo.c @@ -114,7 +114,7 @@ make_restrictinfo_internal(Expr *clause, restrictinfo->is_pushed_down = is_pushed_down; restrictinfo->outerjoin_delayed = outerjoin_delayed; restrictinfo->pseudoconstant = pseudoconstant; - restrictinfo->can_join = false; /* may get set below */ + restrictinfo->can_join = false; /* may get set below */ restrictinfo->security_level = security_level; restrictinfo->outer_relids = outer_relids; restrictinfo->nullable_relids = nullable_relids; @@ -127,7 +127,7 @@ make_restrictinfo_internal(Expr *clause, if (security_level > 0) restrictinfo->leakproof = !contain_leaked_vars((Node *) clause); else - restrictinfo->leakproof = false; /* really, "don't know" */ + restrictinfo->leakproof = false; /* really, "don't know" */ /* * If it's a binary opclause, set up left/right relids info. In any case diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 09523853d0..9345891380 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -28,12 +28,12 @@ /* Workspace for split_pathtarget_walker */ typedef struct { - List *input_target_exprs; /* exprs available from input */ + List *input_target_exprs; /* exprs available from input */ List *level_srfs; /* list of lists of SRF exprs */ - List *level_input_vars; /* vars needed by SRFs of each level */ - List *level_input_srfs; /* SRFs needed by SRFs of each level */ - List *current_input_vars; /* vars needed in current subexpr */ - List *current_input_srfs; /* SRFs needed in current subexpr */ + List *level_input_vars; /* vars needed by SRFs of each level */ + List *level_input_srfs; /* SRFs needed by SRFs of each level */ + List *current_input_vars; /* vars needed in current subexpr */ + List *current_input_srfs; /* SRFs needed in current subexpr */ int current_depth; /* max SRF depth in current subexpr */ } split_pathtarget_context; @@ -145,7 +145,7 @@ add_to_flat_tlist(List *tlist, List *exprs) { TargetEntry *tle; - tle = makeTargetEntry(copyObject(expr), /* copy needed?? */ + tle = makeTargetEntry(copyObject(expr), /* copy needed?? */ next_resno++, NULL, false); diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c index cf326ae003..45fa22f918 100644 --- a/src/backend/optimizer/util/var.c +++ b/src/backend/optimizer/util/var.c @@ -62,8 +62,8 @@ typedef struct { PlannerInfo *root; int sublevels_up; - bool possible_sublink; /* could aliases include a SubLink? */ - bool inserted_sublink; /* have we inserted a SubLink? */ + bool possible_sublink; /* could aliases include a SubLink? */ + bool inserted_sublink; /* have we inserted a SubLink? */ } flatten_join_alias_vars_context; static bool pull_varnos_walker(Node *node, diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 86482eba26..3e2f64866d 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -268,7 +268,7 @@ transformStmt(ParseState *pstate, Node *parseTree) default: break; } -#endif /* RAW_EXPRESSION_COVERAGE_TEST */ +#endif /* RAW_EXPRESSION_COVERAGE_TEST */ switch (nodeTag(parseTree)) { @@ -2103,7 +2103,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, grpcl->tleSortGroupRef = 0; grpcl->eqop = eqop; grpcl->sortop = sortop; - grpcl->nulls_first = false; /* OK with or without sortop */ + grpcl->nulls_first = false; /* OK with or without sortop */ grpcl->hashable = hashable; op->groupClauses = lappend(op->groupClauses, grpcl); @@ -2124,7 +2124,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, rescolnode->collation = rescolcoll; rescolnode->location = bestlocation; restle = makeTargetEntry((Expr *) rescolnode, - 0, /* no need to set resno */ + 0, /* no need to set resno */ NULL, false); *targetlist = lappend(*targetlist, restle); @@ -2605,7 +2605,7 @@ LCS_asString(LockClauseStrength strength) void CheckSelectLocking(Query *qry, LockClauseStrength strength) { - Assert(strength != LCS_NONE); /* else caller error */ + Assert(strength != LCS_NONE); /* else caller error */ if (qry->setOperations) ereport(ERROR, @@ -2844,7 +2844,7 @@ applyLockingClause(Query *qry, Index rtindex, { RowMarkClause *rc; - Assert(strength != LCS_NONE); /* else caller error */ + Assert(strength != LCS_NONE); /* else caller error */ /* If it's an explicit clause, make sure hasForUpdate gets set */ if (!pushedDown) @@ -2907,4 +2907,4 @@ test_raw_expression_coverage(Node *node, void *context) context); } -#endif /* RAW_EXPRESSION_COVERAGE_TEST */ +#endif /* RAW_EXPRESSION_COVERAGE_TEST */ diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c index 6218ee94fa..9f721f80a8 100644 --- a/src/backend/parser/parse_agg.c +++ b/src/backend/parser/parse_agg.c @@ -1310,7 +1310,7 @@ check_ungrouped_columns_walker(Node *node, gvar->varno == var->varno && gvar->varattno == var->varattno && gvar->varlevelsup == 0) - return false; /* acceptable, we're okay */ + return false; /* acceptable, we're okay */ } } diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 3d5b20836f..ad76108ba6 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -1323,7 +1323,7 @@ transformFromClauseItem(ParseState *pstate, Node *n, ListCell *lx, *rx; - Assert(j->usingClause == NIL); /* shouldn't have USING() too */ + Assert(j->usingClause == NIL); /* shouldn't have USING() too */ foreach(lx, l_colnames) { @@ -3389,7 +3389,7 @@ addTargetToGroupList(ParseState *pstate, TargetEntry *tle, grpcl->tleSortGroupRef = assignSortGroupRef(tle, targetlist); grpcl->eqop = eqop; grpcl->sortop = sortop; - grpcl->nulls_first = false; /* OK with or without sortop */ + grpcl->nulls_first = false; /* OK with or without sortop */ grpcl->hashable = hashable; grouplist = lappend(grouplist, grpcl); diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index 2c3f3cd9ce..aa6a16185f 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -549,7 +549,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids, /* accept if target is polymorphic, for now */ if (IsPolymorphicType(targetTypeId)) { - have_generics = true; /* do more checking later */ + have_generics = true; /* do more checking later */ continue; } @@ -1443,7 +1443,7 @@ check_generic_type_consistency(Oid *actual_arg_types, { if (actual_type == UNKNOWNOID) continue; - actual_type = getBaseType(actual_type); /* flatten domains */ + actual_type = getBaseType(actual_type); /* flatten domains */ if (OidIsValid(array_typeid) && actual_type != array_typeid) return false; array_typeid = actual_type; @@ -1452,7 +1452,7 @@ check_generic_type_consistency(Oid *actual_arg_types, { if (actual_type == UNKNOWNOID) continue; - actual_type = getBaseType(actual_type); /* flatten domains */ + actual_type = getBaseType(actual_type); /* flatten domains */ if (OidIsValid(range_typeid) && actual_type != range_typeid) return false; range_typeid = actual_type; @@ -1662,7 +1662,7 @@ enforce_generic_type_consistency(Oid *actual_arg_types, } if (allow_poly && decl_type == actual_type) continue; /* no new information here */ - actual_type = getBaseType(actual_type); /* flatten domains */ + actual_type = getBaseType(actual_type); /* flatten domains */ if (OidIsValid(array_typeid) && actual_type != array_typeid) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), @@ -1682,7 +1682,7 @@ enforce_generic_type_consistency(Oid *actual_arg_types, } if (allow_poly && decl_type == actual_type) continue; /* no new information here */ - actual_type = getBaseType(actual_type); /* flatten domains */ + actual_type = getBaseType(actual_type); /* flatten domains */ if (OidIsValid(range_typeid) && actual_type != range_typeid) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), diff --git a/src/backend/parser/parse_collate.c b/src/backend/parser/parse_collate.c index aa443f23ad..d99e4cc0f4 100644 --- a/src/backend/parser/parse_collate.c +++ b/src/backend/parser/parse_collate.c @@ -332,7 +332,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) /* Node's result type isn't collatable. */ collation = InvalidOid; strength = COLLATE_NONE; - location = -1; /* won't be used */ + location = -1; /* won't be used */ } } break; @@ -428,7 +428,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) /* Node's result type isn't collatable. */ collation = InvalidOid; strength = COLLATE_NONE; - location = -1; /* won't be used */ + location = -1; /* won't be used */ } /* @@ -711,7 +711,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) /* Node's result type isn't collatable. */ collation = InvalidOid; strength = COLLATE_NONE; - location = -1; /* won't be used */ + location = -1; /* won't be used */ } /* diff --git a/src/backend/parser/parse_cte.c b/src/backend/parser/parse_cte.c index dfbcaa2cdc..dbe4cc2393 100644 --- a/src/backend/parser/parse_cte.c +++ b/src/backend/parser/parse_cte.c @@ -331,7 +331,7 @@ analyzeCTE(ParseState *pstate, CommonTableExpr *cte) lctypmod = lnext(lctypmod); lccoll = lnext(lccoll); } - if (lctyp != NULL || lctypmod != NULL || lccoll != NULL) /* shouldn't happen */ + if (lctyp != NULL || lctypmod != NULL || lccoll != NULL) /* shouldn't happen */ elog(ERROR, "wrong number of output columns in WITH"); } } @@ -637,7 +637,7 @@ checkWellFormedRecursion(CteState *cstate) CommonTableExpr *cte = cstate->items[i].cte; SelectStmt *stmt = (SelectStmt *) cte->ctequery; - Assert(!IsA(stmt, Query)); /* not analyzed yet */ + Assert(!IsA(stmt, Query)); /* not analyzed yet */ /* Ignore items that weren't found to be recursive */ if (!cte->cterecursive) diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index e46aa60097..3a9cdb4208 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -48,20 +48,20 @@ bool Transform_null_equals = false; * Node-type groups for operator precedence warnings * We use zero for everything not otherwise classified */ -#define PREC_GROUP_POSTFIX_IS 1 /* postfix IS tests (NullTest, etc) */ -#define PREC_GROUP_INFIX_IS 2 /* infix IS (IS DISTINCT FROM, etc) */ -#define PREC_GROUP_LESS 3 /* < > */ -#define PREC_GROUP_EQUAL 4 /* = */ -#define PREC_GROUP_LESS_EQUAL 5 /* <= >= <> */ -#define PREC_GROUP_LIKE 6 /* LIKE ILIKE SIMILAR */ -#define PREC_GROUP_BETWEEN 7 /* BETWEEN */ -#define PREC_GROUP_IN 8 /* IN */ -#define PREC_GROUP_NOT_LIKE 9 /* NOT LIKE/ILIKE/SIMILAR */ -#define PREC_GROUP_NOT_BETWEEN 10 /* NOT BETWEEN */ -#define PREC_GROUP_NOT_IN 11 /* NOT IN */ -#define PREC_GROUP_POSTFIX_OP 12 /* generic postfix operators */ -#define PREC_GROUP_INFIX_OP 13 /* generic infix operators */ -#define PREC_GROUP_PREFIX_OP 14 /* generic prefix operators */ +#define PREC_GROUP_POSTFIX_IS 1 /* postfix IS tests (NullTest, etc) */ +#define PREC_GROUP_INFIX_IS 2 /* infix IS (IS DISTINCT FROM, etc) */ +#define PREC_GROUP_LESS 3 /* < > */ +#define PREC_GROUP_EQUAL 4 /* = */ +#define PREC_GROUP_LESS_EQUAL 5 /* <= >= <> */ +#define PREC_GROUP_LIKE 6 /* LIKE ILIKE SIMILAR */ +#define PREC_GROUP_BETWEEN 7 /* BETWEEN */ +#define PREC_GROUP_IN 8 /* IN */ +#define PREC_GROUP_NOT_LIKE 9 /* NOT LIKE/ILIKE/SIMILAR */ +#define PREC_GROUP_NOT_BETWEEN 10 /* NOT BETWEEN */ +#define PREC_GROUP_NOT_IN 11 /* NOT IN */ +#define PREC_GROUP_POSTFIX_OP 12 /* generic postfix operators */ +#define PREC_GROUP_INFIX_OP 13 /* generic infix operators */ +#define PREC_GROUP_PREFIX_OP 14 /* generic prefix operators */ /* * Map precedence groupings to old precedence ordering @@ -741,7 +741,7 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref) break; } default: - crerr = CRERR_TOO_MANY; /* too many dotted names */ + crerr = CRERR_TOO_MANY; /* too many dotted names */ break; } @@ -2574,7 +2574,7 @@ transformCurrentOfExpr(ParseState *pstate, CurrentOfExpr *cexpr) * If so, replace the raw name reference with a parameter reference. (This * is a hack for the convenience of plpgsql.) */ - if (cexpr->cursor_name != NULL) /* in case already transformed */ + if (cexpr->cursor_name != NULL) /* in case already transformed */ { ColumnRef *cref = makeNode(ColumnRef); Node *node = NULL; diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index eb1706a4a6..38a73ba122 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -317,7 +317,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, int catDirectArgs; tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcid)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for aggregate %u", funcid); classForm = (Form_pg_aggregate) GETSTRUCT(tup); aggkind = classForm->aggkind; @@ -658,7 +658,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, aggref->aggfnoid = funcid; aggref->aggtype = rettype; /* aggcollid and inputcollid will be set by parse_collate.c */ - aggref->aggtranstype = InvalidOid; /* will be set by planner */ + aggref->aggtranstype = InvalidOid; /* will be set by planner */ /* aggargtypes will be set by transformAggregateCall */ /* aggdirectargs and args will be set by transformAggregateCall */ /* aggorder and aggdistinct will be set by transformAggregateCall */ @@ -667,7 +667,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, aggref->aggvariadic = func_variadic; aggref->aggkind = aggkind; /* agglevelsup will be set by transformAggregateCall */ - aggref->aggsplit = AGGSPLIT_SIMPLE; /* planner might change this */ + aggref->aggsplit = AGGSPLIT_SIMPLE; /* planner might change this */ aggref->location = location; /* @@ -713,7 +713,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, WindowFunc *wfunc = makeNode(WindowFunc); Assert(over); /* lack of this was checked above */ - Assert(!agg_within_group); /* also checked above */ + Assert(!agg_within_group); /* also checked above */ wfunc->winfnoid = funcid; wfunc->wintype = rettype; @@ -811,7 +811,7 @@ int func_match_argtypes(int nargs, Oid *input_typeids, FuncCandidateList raw_candidates, - FuncCandidateList *candidates) /* return value */ + FuncCandidateList *candidates) /* return value */ { FuncCandidateList current_candidate; FuncCandidateList next_candidate; @@ -1077,7 +1077,7 @@ func_select_candidate(int nargs, if (input_base_typeids[i] != UNKNOWNOID) continue; - resolved_unknowns = true; /* assume we can do it */ + resolved_unknowns = true; /* assume we can do it */ slot_category[i] = TYPCATEGORY_INVALID; slot_has_preferred_type[i] = false; have_conflict = false; @@ -1205,7 +1205,7 @@ func_select_candidate(int nargs, { if (input_base_typeids[i] == UNKNOWNOID) continue; - if (known_type == UNKNOWNOID) /* first known arg? */ + if (known_type == UNKNOWNOID) /* first known arg? */ known_type = input_base_typeids[i]; else if (known_type != input_base_typeids[i]) { @@ -1292,8 +1292,8 @@ func_get_detail(List *funcname, bool *retset, /* return value */ int *nvargs, /* return value */ Oid *vatype, /* return value */ - Oid **true_typeids, /* return value */ - List **argdefaults) /* optional return value */ + Oid **true_typeids, /* return value */ + List **argdefaults) /* optional return value */ { FuncCandidateList raw_candidates; FuncCandidateList best_candidate; diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index fb3d117a7d..f3edc6396a 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -367,7 +367,7 @@ transformArraySubscripts(ParseState *pstate, sizeof(int32), Int32GetDatum(1), false, - true); /* pass by value */ + true); /* pass by value */ } else { @@ -511,7 +511,7 @@ make_const(ParseState *pstate, Value *value, int location) typeid = INT8OID; typelen = sizeof(int64); - typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */ + typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */ } } else diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c index 4b1db76e19..529d2bf3af 100644 --- a/src/backend/parser/parse_oper.c +++ b/src/backend/parser/parse_oper.c @@ -319,7 +319,7 @@ static FuncDetailCode oper_select_candidate(int nargs, Oid *input_typeids, FuncCandidateList candidates, - Oid *operOid) /* output argument */ + Oid *operOid) /* output argument */ { int ncandidates; diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index e412d0f9d3..84a1d79c6e 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -1249,7 +1249,7 @@ addRangeTableEntry(ParseState *pstate, rte->inFromCl = inFromCl; rte->requiredPerms = ACL_SELECT; - rte->checkAsUser = InvalidOid; /* not set-uid by default, either */ + rte->checkAsUser = InvalidOid; /* not set-uid by default, either */ rte->selectedCols = NULL; rte->insertedCols = NULL; rte->updatedCols = NULL; @@ -1304,7 +1304,7 @@ addRangeTableEntryForRelation(ParseState *pstate, rte->inFromCl = inFromCl; rte->requiredPerms = ACL_SELECT; - rte->checkAsUser = InvalidOid; /* not set-uid by default, either */ + rte->checkAsUser = InvalidOid; /* not set-uid by default, either */ rte->selectedCols = NULL; rte->insertedCols = NULL; rte->updatedCols = NULL; @@ -1471,7 +1471,7 @@ addRangeTableEntryForFunction(ParseState *pstate, rtfunc->funccoltypes = NIL; rtfunc->funccoltypmods = NIL; rtfunc->funccolcollations = NIL; - rtfunc->funcparams = NULL; /* not set until planning */ + rtfunc->funcparams = NULL; /* not set until planning */ /* * Now determine if the function returns a simple or composite type. @@ -2615,7 +2615,7 @@ expandRelAttrs(ParseState *pstate, RangeTblEntry *rte, markVarForSelectPriv(pstate, varnode, rte); } - Assert(name == NULL && var == NULL); /* lists not the same length? */ + Assert(name == NULL && var == NULL); /* lists not the same length? */ return te_list; } @@ -2684,7 +2684,7 @@ get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum, tp = SearchSysCache2(ATTNUM, ObjectIdGetDatum(rte->relid), Int16GetDatum(attnum)); - if (!HeapTupleIsValid(tp)) /* shouldn't happen */ + if (!HeapTupleIsValid(tp)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", attnum, rte->relid); att_tup = (Form_pg_attribute) GETSTRUCT(tp); @@ -2868,7 +2868,7 @@ get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum) tp = SearchSysCache2(ATTNUM, ObjectIdGetDatum(rte->relid), Int16GetDatum(attnum)); - if (!HeapTupleIsValid(tp)) /* shouldn't happen */ + if (!HeapTupleIsValid(tp)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", attnum, rte->relid); att_tup = (Form_pg_attribute) GETSTRUCT(tp); diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 6bc9c531c7..30e7caeb62 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -91,7 +91,7 @@ typedef struct * the table */ IndexStmt *pkey; /* PRIMARY KEY index, if any */ bool ispartitioned; /* true if table is partitioned */ - PartitionBoundSpec *partbound; /* transformed FOR VALUES */ + PartitionBoundSpec *partbound; /* transformed FOR VALUES */ } CreateStmtContext; /* State shared by transformCreateSchemaStmt and its subroutines */ @@ -1213,7 +1213,7 @@ transformOfType(CreateStmtContext *cxt, TypeName *ofTypename) tuple = typenameType(NULL, ofTypename, NULL); check_of_type(tuple); ofTypeId = HeapTupleGetOid(tuple); - ofTypename->typeOid = ofTypeId; /* cached for later */ + ofTypename->typeOid = ofTypeId; /* cached for later */ tupdesc = lookup_rowtype_tupdesc(ofTypeId, -1); for (i = 0; i < tupdesc->natts; i++) @@ -2403,7 +2403,7 @@ transformRuleStmt(RuleStmt *stmt, const char *queryString, assign_expr_collations(pstate, *whereClause); /* this is probably dead code without add_missing_from: */ - if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */ + if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */ ereport(ERROR, (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), errmsg("rule WHERE condition cannot contain references to other relations"))); @@ -2420,7 +2420,7 @@ transformRuleStmt(RuleStmt *stmt, const char *queryString, nothing_qry->commandType = CMD_NOTHING; nothing_qry->rtable = pstate->p_rtable; - nothing_qry->jointree = makeFromExpr(NIL, NULL); /* no join wanted */ + nothing_qry->jointree = makeFromExpr(NIL, NULL); /* no join wanted */ *actions = list_make1(nothing_qry); } diff --git a/src/backend/port/atomics.c b/src/backend/port/atomics.c index 231d847de7..c0c2b31270 100644 --- a/src/backend/port/atomics.c +++ b/src/backend/port/atomics.c @@ -82,7 +82,7 @@ pg_atomic_clear_flag_impl(volatile pg_atomic_flag *ptr) S_UNLOCK((slock_t *) &ptr->sema); } -#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */ +#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */ #ifdef PG_HAVE_ATOMIC_U32_SIMULATION void @@ -156,7 +156,7 @@ pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) return oldval; } -#endif /* PG_HAVE_ATOMIC_U32_SIMULATION */ +#endif /* PG_HAVE_ATOMIC_U32_SIMULATION */ #ifdef PG_HAVE_ATOMIC_U64_SIMULATION @@ -219,4 +219,4 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) return oldval; } -#endif /* PG_HAVE_ATOMIC_U64_SIMULATION */ +#endif /* PG_HAVE_ATOMIC_U64_SIMULATION */ diff --git a/src/backend/port/dynloader/aix.h b/src/backend/port/dynloader/aix.h index 321597dae2..4b1bad6e45 100644 --- a/src/backend/port/dynloader/aix.h +++ b/src/backend/port/dynloader/aix.h @@ -16,7 +16,7 @@ #define PORT_PROTOS_H #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * In some older systems, the RTLD_NOW flag isn't defined and the mode @@ -36,4 +36,4 @@ #define pg_dlclose(h) dlclose(h) #define pg_dlerror() dlerror() -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/cygwin.h b/src/backend/port/dynloader/cygwin.h index bb3d7a322a..5d819cfd7b 100644 --- a/src/backend/port/dynloader/cygwin.h +++ b/src/backend/port/dynloader/cygwin.h @@ -13,7 +13,7 @@ #define PORT_PROTOS_H #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * In some older systems, the RTLD_NOW flag isn't defined and the mode @@ -33,4 +33,4 @@ #define pg_dlclose dlclose #define pg_dlerror dlerror -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/darwin.c b/src/backend/port/dynloader/darwin.c index 7b6b48d14a..f8fdeaf122 100644 --- a/src/backend/port/dynloader/darwin.c +++ b/src/backend/port/dynloader/darwin.c @@ -135,4 +135,4 @@ pg_dlerror(void) return (char *) errorString; } -#endif /* HAVE_DLOPEN */ +#endif /* HAVE_DLOPEN */ diff --git a/src/backend/port/dynloader/freebsd.c b/src/backend/port/dynloader/freebsd.c index e61b1c241a..23547b06bb 100644 --- a/src/backend/port/dynloader/freebsd.c +++ b/src/backend/port/dynloader/freebsd.c @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; -#endif /* LIBC_SCCS and not lint */ +#endif /* LIBC_SCCS and not lint */ #include "postgres.h" @@ -89,7 +89,7 @@ BSD44_derived_dlsym(void *handle, const char *name) snprintf(buf, sizeof(buf), "_%s", name); name = buf; } -#endif /* !__ELF__ */ +#endif /* !__ELF__ */ if ((vp = dlsym(handle, (char *) name)) == NULL) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); diff --git a/src/backend/port/dynloader/freebsd.h b/src/backend/port/dynloader/freebsd.h index 6116d3f83f..6faf07f962 100644 --- a/src/backend/port/dynloader/freebsd.h +++ b/src/backend/port/dynloader/freebsd.h @@ -17,7 +17,7 @@ #include <link.h> #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * Dynamic Loader on NetBSD 1.0. @@ -55,4 +55,4 @@ void *BSD44_derived_dlopen(const char *filename, int num); void *BSD44_derived_dlsym(void *handle, const char *name); void BSD44_derived_dlclose(void *handle); -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/linux.c b/src/backend/port/dynloader/linux.c index 368bf0006f..38e19f7484 100644 --- a/src/backend/port/dynloader/linux.c +++ b/src/backend/port/dynloader/linux.c @@ -130,4 +130,4 @@ pg_dlerror(void) #endif } -#endif /* !HAVE_DLOPEN */ +#endif /* !HAVE_DLOPEN */ diff --git a/src/backend/port/dynloader/linux.h b/src/backend/port/dynloader/linux.h index 9d804ad955..d2c25df033 100644 --- a/src/backend/port/dynloader/linux.h +++ b/src/backend/port/dynloader/linux.h @@ -14,7 +14,7 @@ #ifndef PORT_PROTOS_H #define PORT_PROTOS_H -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ #ifdef HAVE_DLOPEN #include <dlfcn.h> #endif @@ -39,6 +39,6 @@ #define pg_dlsym dlsym #define pg_dlclose dlclose #define pg_dlerror dlerror -#endif /* HAVE_DLOPEN */ +#endif /* HAVE_DLOPEN */ -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/netbsd.c b/src/backend/port/dynloader/netbsd.c index 01a96013cb..475d746514 100644 --- a/src/backend/port/dynloader/netbsd.c +++ b/src/backend/port/dynloader/netbsd.c @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; -#endif /* LIBC_SCCS and not lint */ +#endif /* LIBC_SCCS and not lint */ #include "postgres.h" @@ -89,7 +89,7 @@ BSD44_derived_dlsym(void *handle, const char *name) snprintf(buf, sizeof(buf), "_%s", name); name = buf; } -#endif /* !__ELF__ */ +#endif /* !__ELF__ */ if ((vp = dlsym(handle, (char *) name)) == NULL) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); diff --git a/src/backend/port/dynloader/netbsd.h b/src/backend/port/dynloader/netbsd.h index 0bd406850d..2ca332256b 100644 --- a/src/backend/port/dynloader/netbsd.h +++ b/src/backend/port/dynloader/netbsd.h @@ -18,7 +18,7 @@ #include <link.h> #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * Dynamic Loader on NetBSD 1.0. @@ -56,4 +56,4 @@ void *BSD44_derived_dlopen(const char *filename, int num); void *BSD44_derived_dlsym(void *handle, const char *name); void BSD44_derived_dlclose(void *handle); -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/openbsd.c b/src/backend/port/dynloader/openbsd.c index fcd336acbe..7b481b90d1 100644 --- a/src/backend/port/dynloader/openbsd.c +++ b/src/backend/port/dynloader/openbsd.c @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; -#endif /* LIBC_SCCS and not lint */ +#endif /* LIBC_SCCS and not lint */ #include "postgres.h" @@ -89,7 +89,7 @@ BSD44_derived_dlsym(void *handle, const char *name) snprintf(buf, sizeof(buf), "_%s", name); name = buf; } -#endif /* !__ELF__ */ +#endif /* !__ELF__ */ if ((vp = dlsym(handle, (char *) name)) == NULL) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); diff --git a/src/backend/port/dynloader/openbsd.h b/src/backend/port/dynloader/openbsd.h index 25d5439633..1130f39b41 100644 --- a/src/backend/port/dynloader/openbsd.h +++ b/src/backend/port/dynloader/openbsd.h @@ -17,7 +17,7 @@ #include <link.h> #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * Dynamic Loader on NetBSD 1.0. @@ -55,4 +55,4 @@ void *BSD44_derived_dlopen(const char *filename, int num); void *BSD44_derived_dlsym(void *handle, const char *name); void BSD44_derived_dlclose(void *handle); -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/solaris.h b/src/backend/port/dynloader/solaris.h index f50ba524dc..e7638ff0fc 100644 --- a/src/backend/port/dynloader/solaris.h +++ b/src/backend/port/dynloader/solaris.h @@ -15,7 +15,7 @@ #define PORT_PROTOS_H #include <dlfcn.h> -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ /* * In some older systems, the RTLD_NOW flag isn't defined and the mode @@ -35,4 +35,4 @@ #define pg_dlclose dlclose #define pg_dlerror dlerror -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/dynloader/win32.h b/src/backend/port/dynloader/win32.h index f689dc8ff9..ddbf866520 100644 --- a/src/backend/port/dynloader/win32.h +++ b/src/backend/port/dynloader/win32.h @@ -4,7 +4,7 @@ #ifndef PORT_PROTOS_H #define PORT_PROTOS_H -#include "utils/dynamic_loader.h" /* pgrminclude ignore */ +#include "utils/dynamic_loader.h" /* pgrminclude ignore */ #define pg_dlopen(f) dlopen((f), 1) #define pg_dlsym dlsym @@ -16,4 +16,4 @@ int dlclose(void *handle); void *dlsym(void *handle, const char *symbol); void *dlopen(const char *path, int mode); -#endif /* PORT_PROTOS_H */ +#endif /* PORT_PROTOS_H */ diff --git a/src/backend/port/posix_sema.c b/src/backend/port/posix_sema.c index f251ac6788..5719caf9b5 100644 --- a/src/backend/port/posix_sema.c +++ b/src/backend/port/posix_sema.c @@ -130,7 +130,7 @@ PosixSemaphoreCreate(sem_t *sem) if (sem_init(sem, 1, 1) < 0) elog(FATAL, "sem_init failed: %m"); } -#endif /* USE_NAMED_POSIX_SEMAPHORES */ +#endif /* USE_NAMED_POSIX_SEMAPHORES */ /* diff --git a/src/backend/port/sysv_sema.c b/src/backend/port/sysv_sema.c index 4fbcc5e2b4..a68b1f4aea 100644 --- a/src/backend/port/sysv_sema.c +++ b/src/backend/port/sysv_sema.c @@ -64,10 +64,10 @@ typedef int IpcSemaphoreId; /* semaphore ID returned by semget(2) */ static PGSemaphore sharedSemas; /* array of PGSemaphoreData in shared memory */ static int numSharedSemas; /* number of PGSemaphoreDatas used so far */ static int maxSharedSemas; /* allocated size of PGSemaphoreData array */ -static IpcSemaphoreId *mySemaSets; /* IDs of sema sets acquired so far */ +static IpcSemaphoreId *mySemaSets; /* IDs of sema sets acquired so far */ static int numSemaSets; /* number of sema sets acquired so far */ static int maxSemaSets; /* allocated size of mySemaSets array */ -static IpcSemaphoreKey nextSemaKey; /* next key to try using */ +static IpcSemaphoreKey nextSemaKey; /* next key to try using */ static int nextSemaNumber; /* next free sem num in last sema set */ @@ -333,7 +333,7 @@ PGReserveSemaphores(int maxSemas, int port) elog(PANIC, "out of memory"); numSemaSets = 0; nextSemaKey = port * 1000; - nextSemaNumber = SEMAS_PER_SET; /* force sema set alloc on 1st call */ + nextSemaNumber = SEMAS_PER_SET; /* force sema set alloc on 1st call */ on_shmem_exit(ReleaseSemaphores, 0); } diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c index 124b2148de..042635afbd 100644 --- a/src/backend/port/sysv_shmem.c +++ b/src/backend/port/sysv_shmem.c @@ -440,10 +440,10 @@ GetHugePageSize(Size *hugepagesize, int *mmap_flags) FreeFile(fp); } } -#endif /* __linux__ */ +#endif /* __linux__ */ } -#endif /* MAP_HUGETLB */ +#endif /* MAP_HUGETLB */ /* * Creates an anonymous mmap()ed shared memory segment. @@ -533,7 +533,7 @@ AnonymousShmemDetach(int status, Datum arg) } } -#endif /* USE_ANONYMOUS_SHMEM */ +#endif /* USE_ANONYMOUS_SHMEM */ /* * PGSharedMemoryCreate @@ -771,7 +771,7 @@ PGSharedMemoryNoReAttach(void) UsedShmemSegID = 0; } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ /* * PGSharedMemoryDetach diff --git a/src/backend/port/win32_shmem.c b/src/backend/port/win32_shmem.c index 31489fcdb0..01f51f3158 100644 --- a/src/backend/port/win32_shmem.c +++ b/src/backend/port/win32_shmem.c @@ -49,7 +49,7 @@ GetSharedMemName(void) elog(FATAL, "could not get size for full pathname of datadir %s: error code %lu", DataDir, GetLastError()); - retptr = malloc(bufsize + 18); /* 18 for Global\PostgreSQL: */ + retptr = malloc(bufsize + 18); /* 18 for Global\PostgreSQL: */ if (retptr == NULL) elog(FATAL, "could not allocate memory for shared memory name"); @@ -163,9 +163,9 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port, hmap = CreateFileMapping(INVALID_HANDLE_VALUE, /* Use the pagefile */ NULL, /* Default security attrs */ - PAGE_READWRITE, /* Memory is Read/Write */ - size_high, /* Size Upper 32 Bits */ - size_low, /* Size Lower 32 bits */ + PAGE_READWRITE, /* Memory is Read/Write */ + size_high, /* Size Upper 32 Bits */ + size_low, /* Size Lower 32 bits */ szShareMem); if (!hmap) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 5baa6db321..e62c6ad2ed 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -129,8 +129,8 @@ int Log_autovacuum_min_duration = -1; #define STATS_READ_DELAY 1000 /* the minimum allowed time between two awakenings of the launcher */ -#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */ -#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */ +#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */ +#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */ /* Flags to tell if we are in an autovacuum process */ static bool am_autovacuum_launcher = false; @@ -516,7 +516,7 @@ AutoVacLauncherMain(int argc, char *argv[]) /* Forget any pending QueryCancel or timeout request */ disable_all_timeouts(false); - QueryCancelPending = false; /* second to avoid race condition */ + QueryCancelPending = false; /* second to avoid race condition */ /* Report the error to the server log */ EmitErrorReport(); diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 09b7fb4092..227e66b4ba 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -636,7 +636,7 @@ SanityCheckBackgroundWorker(BackgroundWorker *worker, int elevel) static void bgworker_quickdie(SIGNAL_ARGS) { - sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ + sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ PG_SETMASK(&BlockSig); /* @@ -986,7 +986,7 @@ RegisterDynamicBackgroundWorker(BackgroundWorker *worker, if (!slot->in_use) { memcpy(&slot->worker, worker, sizeof(BackgroundWorker)); - slot->pid = InvalidPid; /* indicates not started yet */ + slot->pid = InvalidPid; /* indicates not started yet */ slot->generation++; slot->terminate = false; generation = slot->generation; diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index 2674bb49ba..9ad74ee977 100644 --- a/src/backend/postmaster/bgwriter.c +++ b/src/backend/postmaster/bgwriter.c @@ -122,8 +122,8 @@ BackgroundWriterMain(void) */ pqsignal(SIGHUP, BgSigHupHandler); /* set flag to read config file */ pqsignal(SIGINT, SIG_IGN); - pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */ - pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */ + pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */ + pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */ pqsignal(SIGALRM, SIG_IGN); pqsignal(SIGPIPE, SIG_IGN); pqsignal(SIGUSR1, bgwriter_sigusr1_handler); diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index a55071900d..f37f5d5c44 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -116,7 +116,7 @@ typedef struct typedef struct { - pid_t checkpointer_pid; /* PID (0 if not started) */ + pid_t checkpointer_pid; /* PID (0 if not started) */ slock_t ckpt_lck; /* protects all the ckpt_* fields */ @@ -126,8 +126,8 @@ typedef struct int ckpt_flags; /* checkpoint flags, as defined in xlog.h */ - uint32 num_backend_writes; /* counts user backend buffer writes */ - uint32 num_backend_fsync; /* counts user backend fsync calls */ + uint32 num_backend_writes; /* counts user backend buffer writes */ + uint32 num_backend_fsync; /* counts user backend fsync calls */ int num_requests; /* current # of requests */ int max_requests; /* allocated array size */ @@ -205,15 +205,14 @@ CheckpointerMain(void) * want to wait for the backends to exit, whereupon the postmaster will * tell us it's okay to shut down (via SIGUSR2). */ - pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config - * file */ - pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */ + pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config file */ + pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */ pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */ pqsignal(SIGQUIT, chkpt_quickdie); /* hard crash time */ pqsignal(SIGALRM, SIG_IGN); pqsignal(SIGPIPE, SIG_IGN); pqsignal(SIGUSR1, chkpt_sigusr1_handler); - pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */ + pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */ /* * Reset some signals that are accepted by postmaster but not here diff --git a/src/backend/postmaster/fork_process.c b/src/backend/postmaster/fork_process.c index 0bb15d8487..65145b1205 100644 --- a/src/backend/postmaster/fork_process.c +++ b/src/backend/postmaster/fork_process.c @@ -118,4 +118,4 @@ fork_process(void) return result; } -#endif /* ! WIN32 */ +#endif /* ! WIN32 */ diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 2dce39fdef..00afce4104 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -54,11 +54,10 @@ * Timer definitions. * ---------- */ -#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the - * archive status directory; in - * seconds. */ -#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a - * failed archiver; in seconds. */ +#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the + * archive status directory; in seconds. */ +#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a + * failed archiver; in seconds. */ #define NUM_ARCHIVE_RETRIES 3 @@ -203,7 +202,7 @@ pgarch_forkexec(void) return postmaster_forkexec(ac, av); } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ /* diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 5cf9582246..68c1ee2463 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -74,21 +74,21 @@ * Timer definitions. * ---------- */ -#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file - * updates; in milliseconds. */ +#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file + * updates; in milliseconds. */ -#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for - * a new file; in milliseconds. */ +#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for a + * new file; in milliseconds. */ #define PGSTAT_MAX_WAIT_TIME 10000 /* Maximum time to wait for a stats * file update; in milliseconds. */ -#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for - * a new file; in milliseconds. */ +#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for a + * new file; in milliseconds. */ -#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a - * failed statistics collector; in - * seconds. */ +#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a + * failed statistics collector; in + * seconds. */ #define PGSTAT_POLL_LOOP_COUNT (PGSTAT_MAX_WAIT_TIME / PGSTAT_RETRY_DELAY) #define PGSTAT_INQ_LOOP_COUNT (PGSTAT_INQ_INTERVAL / PGSTAT_RETRY_DELAY) @@ -213,7 +213,7 @@ typedef struct PgStat_SubXactStatus { int nest_level; /* subtransaction nest level */ struct PgStat_SubXactStatus *prev; /* higher-level subxact if any */ - PgStat_TableXactStatus *first; /* head of list for this subxact */ + PgStat_TableXactStatus *first; /* head of list for this subxact */ } PgStat_SubXactStatus; static PgStat_SubXactStatus *pgStatXactStack = NULL; @@ -226,9 +226,9 @@ PgStat_Counter pgStatBlockWriteTime = 0; /* Record that's written to 2PC state file when pgstat state is persisted */ typedef struct TwoPhasePgStatRecord { - PgStat_Counter tuples_inserted; /* tuples inserted in xact */ - PgStat_Counter tuples_updated; /* tuples updated in xact */ - PgStat_Counter tuples_deleted; /* tuples deleted in xact */ + PgStat_Counter tuples_inserted; /* tuples inserted in xact */ + PgStat_Counter tuples_updated; /* tuples updated in xact */ + PgStat_Counter tuples_deleted; /* tuples deleted in xact */ PgStat_Counter inserted_pre_trunc; /* tuples inserted prior to truncate */ PgStat_Counter updated_pre_trunc; /* tuples updated prior to truncate */ PgStat_Counter deleted_pre_trunc; /* tuples deleted prior to truncate */ @@ -710,7 +710,7 @@ pgstat_forkexec(void) return postmaster_forkexec(ac, av); } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ /* @@ -1290,7 +1290,7 @@ pgstat_drop_relation(Oid relid) msg.m_databaseid = MyDatabaseId; pgstat_send(&msg, len); } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* ---------- diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index a5d3575b20..3c5eee0fbc 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -344,10 +344,10 @@ static time_t AbortStartTime = 0; /* Length of said timeout */ #define SIGKILL_CHILDREN_AFTER_SECS 5 -static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */ +static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */ -bool ClientAuthInProgress = false; /* T during new-client - * authentication */ +bool ClientAuthInProgress = false; /* T during new-client + * authentication */ bool redirection_done = false; /* stderr redirected for syslogger? */ @@ -455,7 +455,7 @@ typedef struct HANDLE procHandle; DWORD procId; } win32_deadchild_waitinfo; -#endif /* WIN32 */ +#endif /* WIN32 */ static pid_t backend_forkexec(Port *port); static pid_t internal_forkexec(int argc, char *argv[], Port *port); @@ -537,7 +537,7 @@ static bool save_backend_variables(BackendParameters *param, Port *port, static void ShmemBackendArrayAdd(Backend *bn); static void ShmemBackendArrayRemove(Backend *bn); -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ #define StartupDataBase() StartChildProcess(StartupProcess) #define StartBackgroundWriter() StartChildProcess(BgWriterProcess) @@ -631,20 +631,18 @@ PostmasterMain(int argc, char *argv[]) pqinitmask(); PG_SETMASK(&BlockSig); - pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file - * and have children do - * same */ + pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file and + * have children do same */ pqsignal_no_restart(SIGINT, pmdie); /* send SIGTERM and shut down */ - pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */ - pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut - * down */ + pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */ + pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut down */ pqsignal(SIGALRM, SIG_IGN); /* ignored */ pqsignal(SIGPIPE, SIG_IGN); /* ignored */ - pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child - * process */ - pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for - * children */ - pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */ + pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child + * process */ + pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for + * children */ + pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */ pqsignal(SIGTTIN, SIG_IGN); /* ignored */ pqsignal(SIGTTOU, SIG_IGN); /* ignored */ /* ignore SIGXFSZ, so that ulimit violations work like disk full */ @@ -3148,7 +3146,7 @@ CleanupBackgroundWorker(int pid, rw->rw_backend = NULL; rw->rw_pid = 0; rw->rw_child_slot = 0; - ReportBackgroundWorkerExit(&iter); /* report child death */ + ReportBackgroundWorkerExit(&iter); /* report child death */ LogChildExit(EXIT_STATUS_0(exitstatus) ? DEBUG1 : LOG, namebuf, pid, exitstatus); @@ -4003,7 +4001,7 @@ BackendStartup(Port *port) /* And run the backend */ BackendRun(port); } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ if (pid < 0) { @@ -4030,7 +4028,7 @@ BackendStartup(Port *port) * of backends. */ bn->pid = pid; - bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */ + bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */ dlist_push_head(&BackendList, &bn->elem); #ifdef EXEC_BACKEND @@ -4120,7 +4118,7 @@ BackendInitialize(Port *port) * Must do this now because authentication uses libpq to send messages. */ pq_init(); /* initialize libpq to talk to client */ - whereToSendOutput = DestRemote; /* now safe to ereport to client */ + whereToSendOutput = DestRemote; /* now safe to ereport to client */ /* * We arrange for a simple exit(1) if we receive SIGTERM or SIGQUIT or @@ -4668,7 +4666,7 @@ internal_forkexec(int argc, char *argv[], Port *port) return pi.dwProcessId; } -#endif /* WIN32 */ +#endif /* WIN32 */ /* @@ -4842,7 +4840,7 @@ SubPostmasterMain(int argc, char *argv[]) /* Attach process to shared data structures */ CreateSharedMemoryAndSemaphores(false, 0); - AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */ + AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */ } if (strcmp(argv[1], "--forkavlauncher") == 0) { @@ -4855,7 +4853,7 @@ SubPostmasterMain(int argc, char *argv[]) /* Attach process to shared data structures */ CreateSharedMemoryAndSemaphores(false, 0); - AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */ + AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */ } if (strcmp(argv[1], "--forkavworker") == 0) { @@ -4896,24 +4894,24 @@ SubPostmasterMain(int argc, char *argv[]) { /* Do not want to attach to shared memory */ - PgArchiverMain(argc, argv); /* does not return */ + PgArchiverMain(argc, argv); /* does not return */ } if (strcmp(argv[1], "--forkcol") == 0) { /* Do not want to attach to shared memory */ - PgstatCollectorMain(argc, argv); /* does not return */ + PgstatCollectorMain(argc, argv); /* does not return */ } if (strcmp(argv[1], "--forklog") == 0) { /* Do not want to attach to shared memory */ - SysLoggerMain(argc, argv); /* does not return */ + SysLoggerMain(argc, argv); /* does not return */ } abort(); /* shouldn't get here */ } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ /* @@ -5272,7 +5270,7 @@ StartChildProcess(AuxProcType type) AuxiliaryProcessMain(ac, av); ExitPostmaster(0); } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ if (pid < 0) { @@ -6228,7 +6226,7 @@ ShmemBackendArrayRemove(Backend *bn) /* Mark the slot as empty */ ShmemBackendArray[i].pid = 0; } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ #ifdef WIN32 @@ -6304,7 +6302,7 @@ pgwin32_deadchild_callback(PVOID lpParameter, BOOLEAN TimerOrWaitFired) /* Queue SIGCHLD signal */ pg_queue_signal(SIGCHLD); } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Initialize one and only handle for monitoring postmaster death. @@ -6355,5 +6353,5 @@ InitPostmasterDeathWatchHandle(void) ereport(FATAL, (errmsg_internal("could not duplicate postmaster handle: error code %lu", GetLastError()))); -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/src/backend/postmaster/startup.c b/src/backend/postmaster/startup.c index b623252475..4693a1bb86 100644 --- a/src/backend/postmaster/startup.c +++ b/src/backend/postmaster/startup.c @@ -183,7 +183,7 @@ StartupProcessMain(void) */ pqsignal(SIGHUP, StartupProcSigHupHandler); /* reload config file */ pqsignal(SIGINT, SIG_IGN); /* ignore query cancel */ - pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */ + pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */ pqsignal(SIGQUIT, startupproc_quickdie); /* hard crash time */ InitializeTimeouts(); /* establishes SIGALRM handler */ pqsignal(SIGPIPE, SIG_IGN); diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index 9828999eb8..7e4d7a9041 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -169,7 +169,7 @@ SysLoggerMain(int argc, char *argv[]) #ifdef EXEC_BACKEND syslogger_parseArgs(argc, argv); -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ am_syslogger = true; @@ -268,7 +268,7 @@ SysLoggerMain(int argc, char *argv[]) threadHandle = (HANDLE) _beginthreadex(NULL, 0, pipeThread, NULL, 0, NULL); if (threadHandle == 0) elog(FATAL, "could not create syslogger data transfer thread: %m"); -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Remember active logfile's name. We recompute this from the reference @@ -490,7 +490,7 @@ SysLoggerMain(int argc, char *argv[]) WAIT_EVENT_SYSLOGGER_MAIN); EnterCriticalSection(&sysloggerSection); -#endif /* WIN32 */ +#endif /* WIN32 */ if (pipe_eof_seen) { @@ -716,7 +716,7 @@ syslogger_forkexec(void) (long) _get_osfhandle(_fileno(syslogFile))); else strcpy(filenobuf, "0"); -#endif /* WIN32 */ +#endif /* WIN32 */ av[ac++] = filenobuf; av[ac] = NULL; @@ -756,9 +756,9 @@ syslogger_parseArgs(int argc, char *argv[]) setvbuf(syslogFile, NULL, PG_IOLBF, 0); } } -#endif /* WIN32 */ +#endif /* WIN32 */ } -#endif /* EXEC_BACKEND */ +#endif /* EXEC_BACKEND */ /* -------------------------------- @@ -1084,7 +1084,7 @@ pipeThread(void *arg) _endthread(); return 0; } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Open the csv log file - we do this opportunistically, because @@ -1103,7 +1103,7 @@ open_csvlogfile(void) csvlogFile = logfile_open(filename, "a", false); - if (last_csv_file_name != NULL) /* probably shouldn't happen */ + if (last_csv_file_name != NULL) /* probably shouldn't happen */ pfree(last_csv_file_name); last_csv_file_name = filename; diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c index a575d8f953..7b89e02428 100644 --- a/src/backend/postmaster/walwriter.c +++ b/src/backend/postmaster/walwriter.c @@ -109,8 +109,8 @@ WalWriterMain(void) * reasonable to treat like SIGTERM. */ pqsignal(SIGHUP, WalSigHupHandler); /* set flag to read config file */ - pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */ - pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */ + pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */ + pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */ pqsignal(SIGQUIT, wal_quickdie); /* hard crash time */ pqsignal(SIGALRM, SIG_IGN); pqsignal(SIGPIPE, SIG_IGN); @@ -286,7 +286,7 @@ WalWriterMain(void) * sleep time so as to reduce the server's idle power consumption. */ if (left_till_hibernate > 0) - cur_timeout = WalWriterDelay; /* in ms */ + cur_timeout = WalWriterDelay; /* in ms */ else cur_timeout = WalWriterDelay * HIBERNATE_FACTOR; diff --git a/src/backend/regex/regc_color.c b/src/backend/regex/regc_color.c index 823bec018f..f5a4151757 100644 --- a/src/backend/regex/regc_color.c +++ b/src/backend/regex/regc_color.c @@ -145,7 +145,7 @@ pg_reg_getcolor(struct colormap *cm, chr c) low = middle + 1; else { - rownum = cmr->rownum; /* found a match */ + rownum = cmr->rownum; /* found a match */ break; } } @@ -1040,8 +1040,7 @@ static void colorcomplement(struct nfa *nfa, struct colormap *cm, int type, - struct state *of, /* complements of this guy's PLAIN - * outarcs */ + struct state *of, /* complements of this guy's PLAIN outarcs */ struct state *from, struct state *to) { @@ -1138,4 +1137,4 @@ dumpchr(chr c, fprintf(f, "\\u%04lx", (long) c); } -#endif /* REG_DEBUG */ +#endif /* REG_DEBUG */ diff --git a/src/backend/regex/regc_lex.c b/src/backend/regex/regc_lex.c index b2506ca814..2c6551ca74 100644 --- a/src/backend/regex/regc_lex.c +++ b/src/backend/regex/regc_lex.c @@ -586,10 +586,10 @@ next(struct vars *v) FAILW(REG_BADRPT); switch (*v->now++) { - case CHR(':'): /* non-capturing paren */ + case CHR(':'): /* non-capturing paren */ RETV('(', 0); break; - case CHR('#'): /* comment */ + case CHR('#'): /* comment */ while (!ATEOS() && *v->now != CHR(')')) v->now++; if (!ATEOS()) @@ -597,11 +597,11 @@ next(struct vars *v) assert(v->nexttype == v->lasttype); return next(v); break; - case CHR('='): /* positive lookahead */ + case CHR('='): /* positive lookahead */ NOTE(REG_ULOOKAROUND); RETV(LACON, LATYPE_AHEAD_POS); break; - case CHR('!'): /* negative lookahead */ + case CHR('!'): /* negative lookahead */ NOTE(REG_ULOOKAROUND); RETV(LACON, LATYPE_AHEAD_NEG); break; @@ -610,11 +610,11 @@ next(struct vars *v) FAILW(REG_BADRPT); switch (*v->now++) { - case CHR('='): /* positive lookbehind */ + case CHR('='): /* positive lookbehind */ NOTE(REG_ULOOKAROUND); RETV(LACON, LATYPE_BEHIND_POS); break; - case CHR('!'): /* negative lookbehind */ + case CHR('!'): /* negative lookbehind */ NOTE(REG_ULOOKAROUND); RETV(LACON, LATYPE_BEHIND_NEG); break; @@ -836,7 +836,7 @@ lexescape(struct vars *v) break; case CHR('x'): NOTE(REG_UUNPORT); - c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */ + c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */ if (ISERR() || !CHR_IS_IN_RANGE(c)) FAILW(REG_EESCAPE); RETV(PLAIN, c); @@ -863,7 +863,7 @@ lexescape(struct vars *v) case CHR('9'): save = v->now; v->now--; /* put first digit back */ - c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */ + c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */ if (ISERR()) FAILW(REG_EESCAPE); /* ugly heuristic (first test is "exactly 1 digit?") */ diff --git a/src/backend/regex/regc_locale.c b/src/backend/regex/regc_locale.c index acae90abce..047abc3e1e 100644 --- a/src/backend/regex/regc_locale.c +++ b/src/backend/regex/regc_locale.c @@ -754,7 +754,7 @@ cmp(const chr *x, const chr *y, /* strings to compare */ * stop at embedded NULs! */ static int /* 0 for equal, nonzero for unequal */ -casecmp(const chr *x, const chr *y, /* strings to compare */ +casecmp(const chr *x, const chr *y, /* strings to compare */ size_t len) /* exact length of comparison */ { for (; len > 0; len--, x++, y++) diff --git a/src/backend/regex/regc_nfa.c b/src/backend/regex/regc_nfa.c index 2179a38a22..92c9c4d795 100644 --- a/src/backend/regex/regc_nfa.c +++ b/src/backend/regex/regc_nfa.c @@ -67,7 +67,7 @@ newnfa(struct vars *v, nfa->eos[0] = nfa->eos[1] = COLORLESS; nfa->parent = parent; /* Precedes newfstate so parent is valid. */ nfa->post = newfstate(nfa, '@'); /* number 0 */ - nfa->pre = newfstate(nfa, '>'); /* number 1 */ + nfa->pre = newfstate(nfa, '>'); /* number 1 */ nfa->init = newstate(nfa); /* may become invalid later */ nfa->final = newstate(nfa); @@ -1253,7 +1253,7 @@ deltraverse(struct nfa *nfa, } assert(s->no != FREESTATE); /* we're still here */ - assert(s == leftend || s->nins != 0); /* and still reachable */ + assert(s == leftend || s->nins != 0); /* and still reachable */ assert(s->nouts == 0); /* but have no outarcs */ s->tmp = NULL; /* we're done here */ @@ -1751,7 +1751,7 @@ push(struct nfa *nfa, if (NISERR()) return 0; copyouts(nfa, to, s); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint arc */ + cparc(nfa, con, from, s); /* move constraint arc */ freearc(nfa, con); if (NISERR()) return 0; @@ -1833,7 +1833,7 @@ combine(struct arc *con, case CA('$', '$'): case CA(AHEAD, AHEAD): case CA(BEHIND, BEHIND): - if (con->co == a->co) /* true duplication */ + if (con->co == a->co) /* true duplication */ return SATISFIED; return INCOMPATIBLE; break; @@ -2763,8 +2763,8 @@ cleanup(struct nfa *nfa) static void markreachable(struct nfa *nfa, struct state *s, - struct state *okay, /* consider only states with this mark */ - struct state *mark) /* the value to mark with */ + struct state *okay, /* consider only states with this mark */ + struct state *mark) /* the value to mark with */ { struct arc *a; @@ -3114,7 +3114,7 @@ dumparc(struct arc *a, if (aa == NULL) fprintf(f, "?!?"); /* missing from in-chain */ } -#endif /* REG_DEBUG */ +#endif /* REG_DEBUG */ /* * dumpcnfa - dump a compacted NFA in human-readable form @@ -3178,4 +3178,4 @@ dumpcstate(int st, fflush(f); } -#endif /* REG_DEBUG */ +#endif /* REG_DEBUG */ diff --git a/src/backend/regex/regc_pg_locale.c b/src/backend/regex/regc_pg_locale.c index 4bdcb4fd6a..6982879688 100644 --- a/src/backend/regex/regc_pg_locale.c +++ b/src/backend/regex/regc_pg_locale.c @@ -277,7 +277,7 @@ pg_set_regex_collation(Oid collation) pg_regex_strategy = PG_REGEX_LOCALE_WIDE; } else -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ { if (pg_regex_locale) pg_regex_strategy = PG_REGEX_LOCALE_1BYTE_L; diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 777373e691..51385509bb 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -257,7 +257,7 @@ struct vars /* parsing macros; most know that `v' is the struct vars pointer */ #define NEXT() (next(v)) /* advance by one token */ #define SEE(t) (v->nexttype == (t)) /* is next token this? */ -#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ +#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ #define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ #define ISERR() VISERR(v) #define VERR(vv,e) ((vv)->nexttype = EOS, \ @@ -942,7 +942,7 @@ parseqatom(struct vars *v, assert((size_t) subno < v->nsubs); } else - atomtype = PLAIN; /* something that's not '(' */ + atomtype = PLAIN; /* something that's not '(' */ NEXT(); /* need new endpoints because tree will contain pointers */ s = newstate(v->nfa); @@ -1124,7 +1124,7 @@ parseqatom(struct vars *v, /* if it's a backref, now is the time to replicate the subNFA */ if (atomtype == BACKREF) { - assert(atom->begin->nouts == 1); /* just the EMPTY */ + assert(atom->begin->nouts == 1); /* just the EMPTY */ delsub(v->nfa, atom->begin, atom->end); assert(v->subs[subno] != NULL); @@ -1145,7 +1145,7 @@ parseqatom(struct vars *v, if (atomtype == BACKREF) { /* special case: backrefs have internal quantifiers */ - EMPTYARC(s, atom->begin); /* empty prefix */ + EMPTYARC(s, atom->begin); /* empty prefix */ /* just stuff everything into atom */ repeat(v, atom->begin, atom->end, m, n); atom->min = (short) m; @@ -1157,7 +1157,7 @@ parseqatom(struct vars *v, else if (m == 1 && n == 1) { /* no/vacuous quantifier: done */ - EMPTYARC(s, atom->begin); /* empty prefix */ + EMPTYARC(s, atom->begin); /* empty prefix */ /* rest of branch can be strung starting from atom->end */ s2 = atom->end; } @@ -1175,7 +1175,7 @@ parseqatom(struct vars *v, assert(m >= 1 && m != DUPINF && n >= 1); repeat(v, s, atom->begin, m - 1, (n == DUPINF) ? n : n - 1); f = COMBINE(qprefer, atom->flags); - t = subre(v, '.', f, s, atom->end); /* prefix and atom */ + t = subre(v, '.', f, s, atom->end); /* prefix and atom */ NOERR(); t->left = subre(v, '=', PREF(f), s, atom->begin); NOERR(); @@ -1618,7 +1618,7 @@ wordchrs(struct vars *v) */ static void processlacon(struct vars *v, - struct state *begin, /* start of parsed LACON sub-re */ + struct state *begin, /* start of parsed LACON sub-re */ struct state *end, /* end of parsed LACON sub-re */ int latype, struct state *lp, /* left state to hang it on */ @@ -2180,7 +2180,7 @@ stid(struct subre *t, sprintf(buf, "%p", t); return buf; } -#endif /* REG_DEBUG */ +#endif /* REG_DEBUG */ #include "regc_lex.c" diff --git a/src/backend/regex/rege_dfa.c b/src/backend/regex/rege_dfa.c index 366b79f492..5695e158a5 100644 --- a/src/backend/regex/rege_dfa.c +++ b/src/backend/regex/rege_dfa.c @@ -303,7 +303,7 @@ static int matchuntil(struct vars *v, struct dfa *d, chr *probe, /* we want to know if a match ends here */ - struct sset **lastcss, /* state storage across calls */ + struct sset **lastcss, /* state storage across calls */ chr **lastcp) /* state storage across calls */ { chr *cp = *lastcp; @@ -672,15 +672,15 @@ miss(struct vars *v, for (ca = cnfa->states[i]; ca->co != COLORLESS; ca++) { if (ca->co < cnfa->ncolors) - continue; /* not a LACON arc */ + continue; /* not a LACON arc */ if (ISBSET(d->work, ca->to)) - continue; /* arc would be a no-op anyway */ - sawlacons = 1; /* this LACON affects our result */ + continue; /* arc would be a no-op anyway */ + sawlacons = 1; /* this LACON affects our result */ if (!lacon(v, cnfa, cp, ca->co)) { if (ISERR()) return NULL; - continue; /* LACON arc cannot be traversed */ + continue; /* LACON arc cannot be traversed */ } if (ISERR()) return NULL; @@ -821,7 +821,7 @@ getvacant(struct vars *v, FDEBUG(("zapping c%d's %ld outarc\n", (int) (p - d->ssets), (long) co)); p->outs[co] = NULL; ap = p->inchain[co]; - p->inchain[co].ss = NULL; /* paranoia */ + p->inchain[co].ss = NULL; /* paranoia */ } ss->ins.ss = NULL; diff --git a/src/backend/regex/regerror.c b/src/backend/regex/regerror.c index 2d38fbc646..4a27c2552c 100644 --- a/src/backend/regex/regerror.c +++ b/src/backend/regex/regerror.c @@ -64,7 +64,7 @@ pg_regerror(int errcode, /* error code, or REG_ATOI or REG_ITOA */ { const struct rerr *r; const char *msg; - char convbuf[sizeof(unk) + 50]; /* 50 = plenty for int */ + char convbuf[sizeof(unk) + 50]; /* 50 = plenty for int */ size_t len; int icode; @@ -78,7 +78,7 @@ pg_regerror(int errcode, /* error code, or REG_ATOI or REG_ITOA */ msg = convbuf; break; case REG_ITOA: /* convert number to name */ - icode = atoi(errbuf); /* not our problem if this fails */ + icode = atoi(errbuf); /* not our problem if this fails */ for (r = rerrs; r->code >= 0; r++) if (r->code == icode) break; diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 471ddb2aad..f7eaa76b02 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -403,7 +403,7 @@ find(struct vars *v, v->details->rm_extend.rm_so = OFF(cold); else v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ + v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ } if (close == NULL) /* not found */ return REG_NOMATCH; @@ -449,7 +449,7 @@ find(struct vars *v, v->details->rm_extend.rm_so = OFF(cold); else v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ + v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ } if (v->nmatch == 1) /* no need for submatches */ return REG_OKAY; @@ -494,7 +494,7 @@ cfind(struct vars *v, v->details->rm_extend.rm_so = OFF(cold); else v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ + v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ } return ret; } @@ -718,7 +718,7 @@ cdissect(struct vars *v, break; case '.': /* concatenation */ assert(t->left != NULL && t->right != NULL); - if (t->left->flags & SHORTER) /* reverse scan */ + if (t->left->flags & SHORTER) /* reverse scan */ er = crevcondissect(v, t, begin, end); else er = ccondissect(v, t, begin, end); @@ -729,7 +729,7 @@ cdissect(struct vars *v, break; case '*': /* iteration */ assert(t->left != NULL); - if (t->left->flags & SHORTER) /* reverse scan */ + if (t->left->flags & SHORTER) /* reverse scan */ er = creviterdissect(v, t, begin, end); else er = citerdissect(v, t, begin, end); diff --git a/src/backend/regex/regexport.c b/src/backend/regex/regexport.c index 53417f0e7d..febf2adaec 100644 --- a/src/backend/regex/regexport.c +++ b/src/backend/regex/regexport.c @@ -235,7 +235,7 @@ pg_reg_getnumcharacters(const regex_t *regex, int co) if (co <= 0 || co > cm->max) /* we reject 0 which is WHITE */ return -1; - if (cm->cd[co].flags & PSEUDO) /* also pseudocolors (BOS etc) */ + if (cm->cd[co].flags & PSEUDO) /* also pseudocolors (BOS etc) */ return -1; /* diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index f3671cf41f..25ce7a7bd2 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -16,7 +16,7 @@ #include <unistd.h> #include <time.h> -#include "access/xlog_internal.h" /* for pg_start/stop_backup */ +#include "access/xlog_internal.h" /* for pg_start/stop_backup */ #include "catalog/catalog.h" #include "catalog/pg_type.h" #include "lib/stringinfo.h" @@ -273,8 +273,8 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir) /* Send CopyOutResponse message */ pq_beginmessage(&buf, 'H'); - pq_sendbyte(&buf, 0); /* overall format */ - pq_sendint(&buf, 0, 2); /* natts */ + pq_sendbyte(&buf, 0); /* overall format */ + pq_sendint(&buf, 0, 2); /* natts */ pq_endmessage(&buf); if (ti->path == NULL) @@ -318,7 +318,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir) Assert(lnext(lc) == NULL); } else - pq_putemptymessage('c'); /* CopyDone */ + pq_putemptymessage('c'); /* CopyDone */ } } PG_END_ENSURE_ERROR_CLEANUP(base_backup_cleanup, (Datum) 0); @@ -814,7 +814,7 @@ SendXlogRecPtrResult(XLogRecPtr ptr, TimeLineID tli) pq_sendstring(&buf, "recptr"); pq_sendint(&buf, 0, 4); /* table oid */ pq_sendint(&buf, 0, 2); /* attnum */ - pq_sendint(&buf, TEXTOID, 4); /* type oid */ + pq_sendint(&buf, TEXTOID, 4); /* type oid */ pq_sendint(&buf, -1, 2); pq_sendint(&buf, 0, 4); pq_sendint(&buf, 0, 2); @@ -827,7 +827,7 @@ SendXlogRecPtrResult(XLogRecPtr ptr, TimeLineID tli) * int8 may seem like a surprising data type for this, but in theory int4 * would not be wide enough for this, as TimeLineID is unsigned. */ - pq_sendint(&buf, INT8OID, 4); /* type oid */ + pq_sendint(&buf, INT8OID, 4); /* type oid */ pq_sendint(&buf, -1, 2); pq_sendint(&buf, 0, 4); pq_sendint(&buf, 0, 2); @@ -1115,7 +1115,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); continue; -#endif /* HAVE_READLINK */ +#endif /* HAVE_READLINK */ } else if (S_ISDIR(statbuf.st_mode)) { diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 33cb01b8d0..f4d123ec05 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -451,7 +451,7 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx) if (err) elog(ERROR, "%s", err); if (!record) - elog(ERROR, "no record found"); /* shouldn't happen */ + elog(ERROR, "no record found"); /* shouldn't happen */ startptr = InvalidXLogRecPtr; @@ -661,7 +661,7 @@ commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, /* Push callback + info on the error context stack */ state.ctx = ctx; state.callback_name = "commit"; - state.report_location = txn->final_lsn; /* beginning of commit record */ + state.report_location = txn->final_lsn; /* beginning of commit record */ errcallback.callback = output_plugin_error_callback; errcallback.arg = (void *) &state; errcallback.previous = error_context_stack; diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index 09206f29a0..f73b1a6d6c 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -147,7 +147,7 @@ typedef struct ReplicationStateCtl } ReplicationStateCtl; /* external variables */ -RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */ +RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */ XLogRecPtr replorigin_session_origin_lsn = InvalidXLogRecPtr; TimestampTz replorigin_session_origin_timestamp = 0; diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c index ff348ff2a8..e3230e1fa2 100644 --- a/src/backend/replication/logical/proto.c +++ b/src/backend/replication/logical/proto.c @@ -194,9 +194,9 @@ logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple, if (oldtuple != NULL) { if (rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL) - pq_sendbyte(out, 'O'); /* old tuple follows */ + pq_sendbyte(out, 'O'); /* old tuple follows */ else - pq_sendbyte(out, 'K'); /* old key follows */ + pq_sendbyte(out, 'K'); /* old key follows */ logicalrep_write_tuple(out, rel, oldtuple); } @@ -424,12 +424,12 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple) if (isnull[i]) { - pq_sendbyte(out, 'n'); /* null column */ + pq_sendbyte(out, 'n'); /* null column */ continue; } else if (att->attlen == -1 && VARATT_IS_EXTERNAL_ONDISK(values[i])) { - pq_sendbyte(out, 'u'); /* unchanged toast column */ + pq_sendbyte(out, 'u'); /* unchanged toast column */ continue; } diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 0182fb7fa7..4905207893 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -62,7 +62,7 @@ #include "replication/logical.h" #include "replication/reorderbuffer.h" #include "replication/slot.h" -#include "replication/snapbuild.h" /* just for SnapBuildSnapDecRefcount */ +#include "replication/snapbuild.h" /* just for SnapBuildSnapDecRefcount */ #include "storage/bufmgr.h" #include "storage/fd.h" #include "storage/sinval.h" @@ -124,8 +124,8 @@ typedef struct ReorderBufferToastEnt Size num_chunks; /* number of chunks we've already seen */ Size size; /* combined size of chunks seen */ dlist_head chunks; /* linked list of chunks */ - struct varlena *reconstructed; /* reconstructed varlena now pointed - * to in main tup */ + struct varlena *reconstructed; /* reconstructed varlena now pointed to in + * main tup */ } ReorderBufferToastEnt; /* Disk serialization support datastructures */ @@ -157,7 +157,7 @@ static const Size max_changes_in_memory = 4096; * major bottleneck, especially when spilling to disk while decoding batch * workloads. */ -static const Size max_cached_tuplebufs = 4096 * 2; /* ~8MB */ +static const Size max_cached_tuplebufs = 4096 * 2; /* ~8MB */ /* --------------------------------------- * primary reorderbuffer support routines diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index e06aa0992a..fc9dc525b3 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -210,7 +210,7 @@ struct SnapBuild TransactionId was_xmax; size_t was_xcnt; /* number of used xip entries */ - size_t was_xcnt_space; /* allocated size of xip */ + size_t was_xcnt_space; /* allocated size of xip */ TransactionId *was_xip; /* running xacts array, xidComparator-sorted */ } was_running; @@ -336,7 +336,7 @@ AllocateSnapshotBuilder(ReorderBuffer *reorder, /* Other struct members initialized by zeroing via palloc0 above */ builder->committed.xcnt = 0; - builder->committed.xcnt_space = 128; /* arbitrary number */ + builder->committed.xcnt_space = 128; /* arbitrary number */ builder->committed.xip = palloc0(builder->committed.xcnt_space * sizeof(TransactionId)); builder->committed.includes_all_transactions = true; @@ -1248,8 +1248,8 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn builder->start_decoding_at = lsn + 1; /* As no transactions were running xmin/xmax can be trivially set. */ - builder->xmin = running->nextXid; /* < are finished */ - builder->xmax = running->nextXid; /* >= are running */ + builder->xmin = running->nextXid; /* < are finished */ + builder->xmax = running->nextXid; /* >= are running */ /* so we can safely use the faster comparisons */ Assert(TransactionIdIsNormal(builder->xmin)); @@ -1295,8 +1295,8 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn * currently running transactions have finished. We'll update both * while waiting for the pending transactions to finish. */ - builder->xmin = running->nextXid; /* < are finished */ - builder->xmax = running->nextXid; /* >= are running */ + builder->xmin = running->nextXid; /* < are finished */ + builder->xmax = running->nextXid; /* >= are running */ /* so we can safely use the faster comparisons */ Assert(TransactionIdIsNormal(builder->xmin)); diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c index 3ff08bfb2b..d5577e38d2 100644 --- a/src/backend/replication/logical/tablesync.c +++ b/src/backend/replication/logical/tablesync.c @@ -812,7 +812,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos) * NAMEDATALEN on the remote that matters, but this scheme will also work * reasonably if that is different.) */ - StaticAssertStmt(NAMEDATALEN >= 32, "NAMEDATALEN too small"); /* for sanity */ + StaticAssertStmt(NAMEDATALEN >= 32, "NAMEDATALEN too small"); /* for sanity */ slotname = psprintf("%.*s_%u_sync_%u", NAMEDATALEN - 28, MySubscription->slotname, diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 21a4fea821..2288675ff2 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -1290,9 +1290,9 @@ send_feedback(XLogRecPtr recvpos, bool force, bool requestReply) resetStringInfo(reply_message); pq_sendbyte(reply_message, 'r'); - pq_sendint64(reply_message, recvpos); /* write */ - pq_sendint64(reply_message, flushpos); /* flush */ - pq_sendint64(reply_message, writepos); /* apply */ + pq_sendint64(reply_message, recvpos); /* write */ + pq_sendint64(reply_message, flushpos); /* flush */ + pq_sendint64(reply_message, writepos); /* apply */ pq_sendint64(reply_message, now); /* sendTime */ pq_sendbyte(reply_message, requestReply); /* replyRequested */ diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index c0f7fbb2b2..4bc2816241 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -86,7 +86,7 @@ typedef struct ReplicationSlotOnDisk #define ReplicationSlotOnDiskV2Size \ sizeof(ReplicationSlotOnDisk) - ReplicationSlotOnDiskConstantSize -#define SLOT_MAGIC 0x1051CA1 /* format identifier */ +#define SLOT_MAGIC 0x1051CA1 /* format identifier */ #define SLOT_VERSION 2 /* version for new files */ /* Control array for replication slot management */ diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index bbd26f3d6a..6dc808874d 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -132,7 +132,7 @@ pg_create_logical_replication_slot(PG_FUNCTION_ARGS) * Create logical decoding context, to build the initial snapshot. */ ctx = CreateInitDecodingContext(NameStr(*plugin), NIL, - false, /* do not build snapshot */ + false, /* do not build snapshot */ logical_read_local_xlog_page, NULL, NULL, NULL); diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index ad213fc454..8092f01edd 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -888,7 +888,7 @@ SyncRepGetSyncStandbysPriority(bool *am_sync) if (list_length(result) == SyncRepConfig->num_sync) { list_free(pending); - return result; /* Exit if got enough sync standbys */ + return result; /* Exit if got enough sync standbys */ } /* diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 01b86ffe8a..8e64e8bf7a 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -259,8 +259,7 @@ WalReceiverMain(void) walrcv->latch = &MyProc->procLatch; /* Properly accept or ignore signals the postmaster might send us */ - pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config - * file */ + pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config file */ pqsignal(SIGINT, SIG_IGN); pqsignal(SIGTERM, WalRcvShutdownHandler); /* request shutdown */ pqsignal(SIGQUIT, WalRcvQuickDieHandler); /* hard crash time */ diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index b61eaef6f5..71057aecfa 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -111,16 +111,16 @@ WalSndCtlData *WalSndCtl = NULL; WalSnd *MyWalSnd = NULL; /* Global state */ -bool am_walsender = false; /* Am I a walsender process? */ -bool am_cascading_walsender = false; /* Am I cascading WAL to - * another standby? */ +bool am_walsender = false; /* Am I a walsender process? */ +bool am_cascading_walsender = false; /* Am I cascading WAL to another + * standby? */ bool am_db_walsender = false; /* Connected to a database? */ /* User-settable parameters for walsender */ int max_wal_senders = 0; /* the maximum number of concurrent * walsenders */ -int wal_sender_timeout = 60 * 1000; /* maximum time to send one - * WAL data message */ +int wal_sender_timeout = 60 * 1000; /* maximum time to send one WAL + * data message */ bool log_replication_commands = false; /* @@ -450,16 +450,16 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd) pq_sendstring(&buf, "filename"); /* col name */ pq_sendint(&buf, 0, 4); /* table oid */ pq_sendint(&buf, 0, 2); /* attnum */ - pq_sendint(&buf, TEXTOID, 4); /* type oid */ + pq_sendint(&buf, TEXTOID, 4); /* type oid */ pq_sendint(&buf, -1, 2); /* typlen */ pq_sendint(&buf, 0, 4); /* typmod */ pq_sendint(&buf, 0, 2); /* format code */ /* second field */ - pq_sendstring(&buf, "content"); /* col name */ + pq_sendstring(&buf, "content"); /* col name */ pq_sendint(&buf, 0, 4); /* table oid */ pq_sendint(&buf, 0, 2); /* attnum */ - pq_sendint(&buf, BYTEAOID, 4); /* type oid */ + pq_sendint(&buf, BYTEAOID, 4); /* type oid */ pq_sendint(&buf, -1, 2); /* typlen */ pq_sendint(&buf, 0, 4); /* typmod */ pq_sendint(&buf, 0, 2); /* format code */ @@ -1748,7 +1748,7 @@ ProcessStandbyReplyMessage(void) writePtr = pq_getmsgint64(&reply_message); flushPtr = pq_getmsgint64(&reply_message); applyPtr = pq_getmsgint64(&reply_message); - (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */ + (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */ replyRequested = pq_getmsgbyte(&reply_message); elog(DEBUG2, "write %X/%X flush %X/%X apply %X/%X%s", @@ -1911,7 +1911,7 @@ ProcessStandbyHSFeedbackMessage(void) * byte. See XLogWalRcvSendHSFeedback() in walreceiver.c for the creation * of this message. */ - (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */ + (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */ feedbackXmin = pq_getmsgint(&reply_message, 4); feedbackEpoch = pq_getmsgint(&reply_message, 4); feedbackCatalogXmin = pq_getmsgint(&reply_message, 4); @@ -1978,7 +1978,7 @@ ProcessStandbyHSFeedbackMessage(void) * XXX: It might make sense to generalize the ephemeral slot concept and * always use the slot mechanism to handle the feedback xmin. */ - if (MyReplicationSlot != NULL) /* XXX: persistency configurable? */ + if (MyReplicationSlot != NULL) /* XXX: persistency configurable? */ PhysicalReplicationSlotNewXmin(feedbackXmin, feedbackCatalogXmin); else { @@ -2000,7 +2000,7 @@ ProcessStandbyHSFeedbackMessage(void) static long WalSndComputeSleeptime(TimestampTz now) { - long sleeptime = 10000; /* 10 s */ + long sleeptime = 10000; /* 10 s */ if (wal_sender_timeout > 0 && last_reply_timestamp > 0) { diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 2ca6c63799..248f0cc872 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -2076,7 +2076,7 @@ fireRules(Query *parsetree, returning_flag); rule_action->querySource = qsrc; - rule_action->canSetTag = false; /* might change later */ + rule_action->canSetTag = false; /* might change later */ results = lappend(results, rule_action); } @@ -2555,9 +2555,9 @@ relation_is_updatable(Oid reloid, updatable_cols = bms_int_members(updatable_cols, include_cols); if (bms_is_empty(updatable_cols)) - auto_events = (1 << CMD_DELETE); /* May support DELETE */ + auto_events = (1 << CMD_DELETE); /* May support DELETE */ else - auto_events = ALL_EVENTS; /* May support all events */ + auto_events = ALL_EVENTS; /* May support all events */ /* * The base relation must also support these update commands. diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c index 00ee3a3e0a..ef131adc91 100644 --- a/src/backend/statistics/dependencies.c +++ b/src/backend/statistics/dependencies.c @@ -883,7 +883,7 @@ find_strongest_dependency(StatisticExtInfo *stats, MVDependencies *dependencies, * slightly more expensive than the previous checks. */ if (dependency_is_fully_matched(dependency, attnums)) - strongest = dependency; /* save new best match */ + strongest = dependency; /* save new best match */ } return strongest; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 77296646d9..ec7460764e 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -582,7 +582,7 @@ PrefetchBuffer(Relation reln, ForkNumber forkNum, BlockNumber blockNum) * not clear that there's enough of a problem to justify that. */ } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } @@ -991,10 +991,10 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, { BufferTag newTag; /* identity of requested block */ uint32 newHash; /* hash value for newTag */ - LWLock *newPartitionLock; /* buffer partition lock for it */ + LWLock *newPartitionLock; /* buffer partition lock for it */ BufferTag oldTag; /* previous identity of selected buffer */ uint32 oldHash; /* hash value for oldTag */ - LWLock *oldPartitionLock; /* buffer partition lock for it */ + LWLock *oldPartitionLock; /* buffer partition lock for it */ uint32 oldFlags; int buf_id; BufferDesc *buf; @@ -1353,7 +1353,7 @@ InvalidateBuffer(BufferDesc *buf) { BufferTag oldTag; uint32 oldHash; /* hash value for oldTag */ - LWLock *oldPartitionLock; /* buffer partition lock for it */ + LWLock *oldPartitionLock; /* buffer partition lock for it */ uint32 oldFlags; uint32 buf_state; @@ -2947,7 +2947,7 @@ DropRelFileNodesAllBuffers(RelFileNodeBackend *rnodes, int nnodes) if (nnodes == 0) return; - nodes = palloc(sizeof(RelFileNode) * nnodes); /* non-local relations */ + nodes = palloc(sizeof(RelFileNode) * nnodes); /* non-local relations */ /* If it's a local relation, it's localbuf.c's problem. */ for (i = 0; i < nnodes; i++) diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 6e59ce888c..c130283f36 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -86,7 +86,7 @@ LocalPrefetchBuffer(SMgrRelation smgr, ForkNumber forkNum, /* Not in buffers, so initiate prefetch */ smgrprefetch(smgr, forkNum, blockNum); -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 2851c5d6a2..5ddc5e1af1 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -815,10 +815,10 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) getrlimit_status = getrlimit(RLIMIT_NOFILE, &rlim); #else /* but BSD doesn't ... */ getrlimit_status = getrlimit(RLIMIT_OFILE, &rlim); -#endif /* RLIMIT_NOFILE */ +#endif /* RLIMIT_NOFILE */ if (getrlimit_status != 0) ereport(WARNING, (errmsg("getrlimit failed: %m"))); -#endif /* HAVE_GETRLIMIT */ +#endif /* HAVE_GETRLIMIT */ /* dup until failure or probe limit reached */ for (;;) @@ -978,7 +978,7 @@ _dump_lru(void) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "LEAST"); elog(LOG, "%s", buf); } -#endif /* FDDEBUG */ +#endif /* FDDEBUG */ static void Delete(File file) @@ -2502,7 +2502,7 @@ closeAllVfds(void) if (SizeVfdCache > 0) { - Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */ + Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */ for (i = 1; i < SizeVfdCache; i++) { if (!FileIsNotOpen(i)) @@ -2653,7 +2653,7 @@ CleanupTempFiles(bool isProcExit) */ if (isProcExit || have_xact_temporary_files) { - Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */ + Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */ for (i = 1; i < SizeVfdCache; i++) { unsigned short fdstate = VfdCache[i].fdstate; @@ -3102,7 +3102,7 @@ pre_sync_fname(const char *fname, bool isdir, int elevel) (void) CloseTransientFile(fd); } -#endif /* PG_FLUSH_DATA_WORKS */ +#endif /* PG_FLUSH_DATA_WORKS */ static void datadir_fsync_fname(const char *fname, bool isdir, int elevel) diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index e0eaefeeb3..d101c717d3 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -686,9 +686,9 @@ dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size, hmap = CreateFileMapping(INVALID_HANDLE_VALUE, /* Use the pagefile */ NULL, /* Default security attrs */ - PAGE_READWRITE, /* Memory is read/write */ - size_high, /* Upper 32 bits of size */ - size_low, /* Lower 32 bits of size */ + PAGE_READWRITE, /* Memory is read/write */ + size_high, /* Upper 32 bits of size */ + size_low, /* Lower 32 bits of size */ name); errcode = GetLastError(); diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c index 55959de91f..29eb4ea54f 100644 --- a/src/backend/storage/ipc/latch.c +++ b/src/backend/storage/ipc/latch.c @@ -124,7 +124,7 @@ static int selfpipe_owner_pid = 0; /* Private function prototypes */ static void sendSelfPipeByte(void); static void drainSelfPipe(void); -#endif /* WIN32 */ +#endif /* WIN32 */ #if defined(WAIT_USE_EPOLL) static void WaitEventAdjustEpoll(WaitEventSet *set, WaitEvent *event, int action); @@ -230,7 +230,7 @@ InitLatch(volatile Latch *latch) latch->event = CreateEvent(NULL, TRUE, FALSE, NULL); if (latch->event == NULL) elog(ERROR, "CreateEvent failed: error code %lu", GetLastError()); -#endif /* WIN32 */ +#endif /* WIN32 */ } /* @@ -576,7 +576,7 @@ CreateWaitEventSet(MemoryContext context, int nevents) elog(ERROR, "epoll_create failed: %m"); if (fcntl(set->epoll_fd, F_SETFD, FD_CLOEXEC) == -1) elog(ERROR, "fcntl(F_SETFD) failed on epoll descriptor: %m"); -#endif /* EPOLL_CLOEXEC */ +#endif /* EPOLL_CLOEXEC */ #elif defined(WAIT_USE_WIN32) /* @@ -1469,7 +1469,7 @@ latch_sigusr1_handler(void) if (waiting) sendSelfPipeByte(); } -#endif /* !WIN32 */ +#endif /* !WIN32 */ /* Send one byte to the self-pipe, to wake up WaitLatch */ #ifndef WIN32 @@ -1502,7 +1502,7 @@ retry: return; } } -#endif /* !WIN32 */ +#endif /* !WIN32 */ /* * Read all available data from the self-pipe @@ -1550,4 +1550,4 @@ drainSelfPipe(void) /* else buffer wasn't big enough, so read again */ } } -#endif /* !WIN32 */ +#endif /* !WIN32 */ diff --git a/src/backend/storage/ipc/pmsignal.c b/src/backend/storage/ipc/pmsignal.c index 98f4082d94..85db6b21f8 100644 --- a/src/backend/storage/ipc/pmsignal.c +++ b/src/backend/storage/ipc/pmsignal.c @@ -289,5 +289,5 @@ PostmasterIsAlive(void) return false; #else /* WIN32 */ return (WaitForSingleObject(PostmasterHandle, 0) == WAIT_TIMEOUT); -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index dfddfc4002..2d6ae23eec 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -75,7 +75,7 @@ typedef struct ProcArrayStruct int numKnownAssignedXids; /* current # of valid entries */ int tailKnownAssignedXids; /* index of oldest valid element */ int headKnownAssignedXids; /* index of newest element, + 1 */ - slock_t known_assigned_xids_lck; /* protects head/tail pointers */ + slock_t known_assigned_xids_lck; /* protects head/tail pointers */ /* * Highest subxid that has been removed from KnownAssignedXids array to @@ -149,7 +149,7 @@ static void DisplayXidCache(void); #define xc_by_known_assigned_inc() ((void) 0) #define xc_no_overflow_inc() ((void) 0) #define xc_slow_answer_inc() ((void) 0) -#endif /* XIDCACHE_DEBUG */ +#endif /* XIDCACHE_DEBUG */ /* Primitives for KnownAssignedXids array handling for standby */ static void KnownAssignedXidsCompress(bool force); @@ -364,7 +364,7 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid) /* Keep the PGPROC array sorted. See notes above */ memmove(&arrayP->pgprocnos[index], &arrayP->pgprocnos[index + 1], (arrayP->numProcs - index - 1) * sizeof(int)); - arrayP->pgprocnos[arrayP->numProcs - 1] = -1; /* for debugging */ + arrayP->pgprocnos[arrayP->numProcs - 1] = -1; /* for debugging */ arrayP->numProcs--; LWLockRelease(ProcArrayLock); return; @@ -432,7 +432,7 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid) pgxact->xmin = InvalidTransactionId; /* must be cleared with xid/xmin: */ pgxact->vacuumFlags &= ~PROC_VACUUM_STATE_MASK; - pgxact->delayChkpt = false; /* be sure this is cleared in abort */ + pgxact->delayChkpt = false; /* be sure this is cleared in abort */ proc->recoveryConflictPending = false; Assert(pgxact->nxids == 0); @@ -1354,7 +1354,7 @@ GetOldestXmin(Relation rel, int flags) if (allDbs || proc->databaseId == MyDatabaseId || - proc->databaseId == 0) /* always include WalSender */ + proc->databaseId == 0) /* always include WalSender */ { /* Fetch xid just once - see GetNewTransactionId */ TransactionId xid = pgxact->xid; @@ -3099,7 +3099,7 @@ DisplayXidCache(void) xc_no_overflow, xc_slow_answer); } -#endif /* XIDCACHE_DEBUG */ +#endif /* XIDCACHE_DEBUG */ /* ---------------------------------------------- diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index b5f49727f7..e18d4c7e1c 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -75,7 +75,7 @@ /* shared memory global variables */ -static PGShmemHeader *ShmemSegHdr; /* shared mem segment header */ +static PGShmemHeader *ShmemSegHdr; /* shared mem segment header */ static void *ShmemBase; /* start address of shared memory */ @@ -314,7 +314,7 @@ InitShmemIndex(void) * for NULL. */ HTAB * -ShmemInitHash(const char *name, /* table string name for shmem index */ +ShmemInitHash(const char *name, /* table string name for shmem index */ long init_size, /* initial table size */ long max_size, /* max size of the table */ HASHCTL *infoP, /* info about key and bucket size */ diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c index 18302caf5e..1b9d32b7cf 100644 --- a/src/backend/storage/ipc/sinvaladt.c +++ b/src/backend/storage/ipc/sinvaladt.c @@ -240,7 +240,7 @@ CreateSharedInvalidationState(void) /* Mark all backends inactive, and initialize nextLXID */ for (i = 0; i < shmInvalBuffer->maxBackends; i++) { - shmInvalBuffer->procState[i].procPid = 0; /* inactive */ + shmInvalBuffer->procState[i].procPid = 0; /* inactive */ shmInvalBuffer->procState[i].proc = NULL; shmInvalBuffer->procState[i].nextMsgNum = 0; /* meaningless */ shmInvalBuffer->procState[i].resetState = false; @@ -271,7 +271,7 @@ SharedInvalBackendInit(bool sendOnly) /* Look for a free entry in the procState array */ for (index = 0; index < segP->lastBackend; index++) { - if (segP->procState[index].procPid == 0) /* inactive slot? */ + if (segP->procState[index].procPid == 0) /* inactive slot? */ { stateP = &segP->procState[index]; break; diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c index 6597b36b17..154516ff36 100644 --- a/src/backend/storage/large_object/inv_api.c +++ b/src/backend/storage/large_object/inv_api.c @@ -624,7 +624,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes) { if ((oldtuple = systable_getnext_ordered(sd, ForwardScanDirection)) != NULL) { - if (HeapTupleHasNulls(oldtuple)) /* paranoia */ + if (HeapTupleHasNulls(oldtuple)) /* paranoia */ elog(ERROR, "null field found in pg_largeobject"); olddata = (Form_pg_largeobject) GETSTRUCT(oldtuple); Assert(olddata->pageno >= pageno); @@ -806,7 +806,7 @@ inv_truncate(LargeObjectDesc *obj_desc, int64 len) olddata = NULL; if ((oldtuple = systable_getnext_ordered(sd, ForwardScanDirection)) != NULL) { - if (HeapTupleHasNulls(oldtuple)) /* paranoia */ + if (HeapTupleHasNulls(oldtuple)) /* paranoia */ elog(ERROR, "null field found in pg_largeobject"); olddata = (Form_pg_largeobject) GETSTRUCT(oldtuple); Assert(olddata->pageno >= pageno); diff --git a/src/backend/storage/lmgr/deadlock.c b/src/backend/storage/lmgr/deadlock.c index de67e5db49..d1a9ec8a48 100644 --- a/src/backend/storage/lmgr/deadlock.c +++ b/src/backend/storage/lmgr/deadlock.c @@ -539,8 +539,8 @@ static bool FindLockCycleRecurseMember(PGPROC *checkProc, PGPROC *checkProcLeader, int depth, - EDGE *softEdges, /* output argument */ - int *nSoftEdges) /* output argument */ + EDGE *softEdges, /* output argument */ + int *nSoftEdges) /* output argument */ { PGPROC *proc; LOCK *lock = checkProc->waitLock; diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 4315be4077..19cec580c3 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -336,7 +336,7 @@ PROCLOCK_PRINT(const char *where, const PROCLOCK *proclockP) #define LOCK_PRINT(where, lock, type) ((void) 0) #define PROCLOCK_PRINT(where, proclockP) ((void) 0) -#endif /* not LOCK_DEBUG */ +#endif /* not LOCK_DEBUG */ static uint32 proclock_hash(const void *key, Size keysize); @@ -595,7 +595,7 @@ LockHasWaiters(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) /* * Find the LOCALLOCK entry for this lock and lockmode */ - MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ + MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ localtag.lock = *locktag; localtag.mode = lockmode; @@ -749,7 +749,7 @@ LockAcquireExtended(const LOCKTAG *locktag, /* * Find or create a LOCALLOCK entry for this lock and lockmode */ - MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ + MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ localtag.lock = *locktag; localtag.mode = lockmode; @@ -1212,7 +1212,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc, } } } -#endif /* CHECK_DEADLOCK_RISK */ +#endif /* CHECK_DEADLOCK_RISK */ } /* @@ -1842,7 +1842,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) /* * Find the LOCALLOCK entry for this lock and lockmode */ - MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ + MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */ localtag.lock = *locktag; localtag.mode = lockmode; @@ -3923,7 +3923,7 @@ DumpAllLocks(void) elog(LOG, "DumpAllLocks: proclock->tag.myLock = NULL"); } } -#endif /* LOCK_DEBUG */ +#endif /* LOCK_DEBUG */ /* * LOCK 2PC resource manager's routines diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index a021fbb229..82a1cf5150 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -226,7 +226,7 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg) #else /* not LOCK_DEBUG */ #define PRINT_LWDEBUG(a,b,c) ((void)0) #define LOG_LWDEBUG(a,b,c) ((void)0) -#endif /* LOCK_DEBUG */ +#endif /* LOCK_DEBUG */ #ifdef LWLOCK_STATS @@ -323,7 +323,7 @@ get_lwlock_stats_entry(LWLock *lock) } return lwstats; } -#endif /* LWLOCK_STATS */ +#endif /* LWLOCK_STATS */ /* @@ -1129,7 +1129,7 @@ LWLockAcquire(LWLock *lock, LWLockMode mode) lwstats->ex_acquire_count++; else lwstats->sh_acquire_count++; -#endif /* LWLOCK_STATS */ +#endif /* LWLOCK_STATS */ /* * We can't wait if we haven't got a PGPROC. This should only occur diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index b07ef4c21b..3b355641c2 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -358,9 +358,9 @@ static SERIALIZABLEXACT *OldCommittedSxact; * attempt to degrade performance (mostly as false positive serialization * failure) gracefully in the face of memory pressurel */ -int max_predicate_locks_per_xact; /* set by guc.c */ +int max_predicate_locks_per_xact; /* set by guc.c */ int max_predicate_locks_per_relation; /* set by guc.c */ -int max_predicate_locks_per_page; /* set by guc.c */ +int max_predicate_locks_per_page; /* set by guc.c */ /* * This provides a list of objects in order to track transactions @@ -2914,8 +2914,8 @@ DropAllPredicateLocksFromTable(Relation relation, bool transfer) heapId = relation->rd_index->indrelid; } Assert(heapId != InvalidOid); - Assert(transfer || !isIndex); /* index OID only makes sense with - * transfer */ + Assert(transfer || !isIndex); /* index OID only makes sense with + * transfer */ /* Retrieve first time needed, then keep. */ heaptargettaghash = 0; diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index 09f1c64e46..c3cfdfcb44 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -133,7 +133,7 @@ perform_spin_delay(SpinDelayStatus *status) if (++(status->delays) > NUM_DELAYS) s_lock_stuck(status->file, status->line, status->func); - if (status->cur_delay == 0) /* first time to delay? */ + if (status->cur_delay == 0) /* first time to delay? */ status->cur_delay = MIN_DELAY_USEC; pg_usleep(status->cur_delay); @@ -276,12 +276,12 @@ _tas: \n\ _success: \n\ moveq #0,d0 \n\ rts \n" -#endif /* __NetBSD__ && __ELF__ */ +#endif /* __NetBSD__ && __ELF__ */ ); } -#endif /* __m68k__ && !__linux__ */ -#endif /* not __GNUC__ */ -#endif /* HAVE_SPINLOCKS */ +#endif /* __m68k__ && !__linux__ */ +#endif /* not __GNUC__ */ +#endif /* HAVE_SPINLOCKS */ @@ -375,4 +375,4 @@ main() return 1; } -#endif /* S_LOCK_TEST */ +#endif /* S_LOCK_TEST */ diff --git a/src/backend/storage/lmgr/spin.c b/src/backend/storage/lmgr/spin.c index f7b1ac04f9..2c16938f5a 100644 --- a/src/backend/storage/lmgr/spin.c +++ b/src/backend/storage/lmgr/spin.c @@ -140,4 +140,4 @@ tas_sema(volatile slock_t *lock) return !PGSemaphoreTryLock(SpinlockSemaArray[lockndx - 1]); } -#endif /* !HAVE_SPINLOCKS */ +#endif /* !HAVE_SPINLOCKS */ diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c index 1b53d651cd..b6425e409c 100644 --- a/src/backend/storage/page/bufpage.c +++ b/src/backend/storage/page/bufpage.c @@ -237,7 +237,7 @@ PageAddItemExtended(Page page, else { if (offsetNumber < limit) - needshuffle = true; /* need to move existing linp's */ + needshuffle = true; /* need to move existing linp's */ } } else @@ -912,7 +912,7 @@ PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems) } else { - itemidptr->offsetindex = nused; /* where it will go */ + itemidptr->offsetindex = nused; /* where it will go */ itemidptr->itemoff = offset; itemidptr->alignedlen = MAXALIGN(size); totallen += itemidptr->alignedlen; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 1b1de1f879..c5be21dd91 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -154,7 +154,7 @@ typedef struct static HTAB *pendingOpsTable = NULL; static List *pendingUnlinks = NIL; -static MemoryContext pendingOpsCxt; /* context for the above */ +static MemoryContext pendingOpsCxt; /* context for the above */ static CycleCtr mdsync_cycle_ctr = 0; static CycleCtr mdckpt_cycle_ctr = 0; @@ -669,7 +669,7 @@ mdprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum) Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE); (void) FilePrefetch(v->mdfd_vfd, seekpos, BLCKSZ, WAIT_EVENT_DATA_FILE_PREFETCH); -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index e9850f79ae..6955e4c577 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -38,7 +38,7 @@ typedef struct f_smgr { void (*smgr_init) (void); /* may be NULL */ - void (*smgr_shutdown) (void); /* may be NULL */ + void (*smgr_shutdown) (void); /* may be NULL */ void (*smgr_close) (SMgrRelation reln, ForkNumber forknum); void (*smgr_create) (SMgrRelation reln, ForkNumber forknum, bool isRedo); @@ -59,9 +59,9 @@ typedef struct f_smgr void (*smgr_truncate) (SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks); void (*smgr_immedsync) (SMgrRelation reln, ForkNumber forknum); - void (*smgr_pre_ckpt) (void); /* may be NULL */ + void (*smgr_pre_ckpt) (void); /* may be NULL */ void (*smgr_sync) (void); /* may be NULL */ - void (*smgr_post_ckpt) (void); /* may be NULL */ + void (*smgr_post_ckpt) (void); /* may be NULL */ } f_smgr; diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index ba0f06c302..90491c9062 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -54,7 +54,7 @@ struct fp_info Oid namespace; /* other stuff from pg_proc */ Oid rettype; Oid argtypes[FUNC_MAX_ARGS]; - char fname[NAMEDATALEN]; /* function name for logging */ + char fname[NAMEDATALEN]; /* function name for logging */ }; @@ -293,7 +293,7 @@ HandleFunctionRequest(StringInfo msgBuf) if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3) (void) pq_getmsgstring(msgBuf); /* dummy string */ - fid = (Oid) pq_getmsgint(msgBuf, 4); /* function oid */ + fid = (Oid) pq_getmsgint(msgBuf, 4); /* function oid */ /* * There used to be a lame attempt at caching lookup info here. Now we diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index fdc8c71a85..2645cbe692 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -153,7 +153,7 @@ static CachedPlanSource *unnamed_stmt_psrc = NULL; /* assorted command-line switches */ static const char *userDoption = NULL; /* -D switch */ static bool EchoQuery = false; /* -E switch */ -static bool UseSemiNewlineNewline = false; /* -j switch */ +static bool UseSemiNewlineNewline = false; /* -j switch */ /* whether or not, and why, we were canceled by conflict with recovery */ static bool RecoveryConflictPending = false; @@ -682,7 +682,7 @@ pg_analyze_and_rewrite_params(RawStmt *parsetree, Query *query; List *querytree_list; - Assert(query_string != NULL); /* required as of 8.4 */ + Assert(query_string != NULL); /* required as of 8.4 */ TRACE_POSTGRESQL_QUERY_REWRITE_START(query_string); @@ -1193,9 +1193,9 @@ exec_simple_query(const char *query_string) */ static void exec_parse_message(const char *query_string, /* string to execute */ - const char *stmt_name, /* name for prepared stmt */ - Oid *paramTypes, /* parameter types */ - int numParams) /* number of parameters */ + const char *stmt_name, /* name for prepared stmt */ + Oid *paramTypes, /* parameter types */ + int numParams) /* number of parameters */ { MemoryContext unnamed_stmt_context = NULL; MemoryContext oldcontext; @@ -1660,7 +1660,7 @@ exec_bind_message(StringInfo input_message) } else { - pbuf.data = NULL; /* keep compiler quiet */ + pbuf.data = NULL; /* keep compiler quiet */ csave = 0; } @@ -1694,7 +1694,7 @@ exec_bind_message(StringInfo input_message) if (pstring && pstring != pbuf.data) pfree(pstring); } - else if (pformat == 1) /* binary mode */ + else if (pformat == 1) /* binary mode */ { Oid typreceive; Oid typioparam; @@ -2555,7 +2555,7 @@ drop_unnamed_stmt(void) void quickdie(SIGNAL_ARGS) { - sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ + sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ PG_SETMASK(&BlockSig); /* @@ -2832,7 +2832,7 @@ ProcessInterrupts(void) if (ProcDiePending) { ProcDiePending = false; - QueryCancelPending = false; /* ProcDie trumps QueryCancel */ + QueryCancelPending = false; /* ProcDie trumps QueryCancel */ LockErrorCleanup(); /* As in quickdie, don't risk sending to client during auth */ if (ClientAuthInProgress && whereToSendOutput == DestRemote) @@ -2883,7 +2883,7 @@ ProcessInterrupts(void) } if (ClientConnectionLost) { - QueryCancelPending = false; /* lost connection trumps QueryCancel */ + QueryCancelPending = false; /* lost connection trumps QueryCancel */ LockErrorCleanup(); /* don't send to client, we already know the connection to be dead. */ whereToSendOutput = DestNone; @@ -2900,7 +2900,7 @@ ProcessInterrupts(void) */ if (RecoveryConflictPending && DoingCommandRead) { - QueryCancelPending = false; /* this trumps QueryCancel */ + QueryCancelPending = false; /* this trumps QueryCancel */ RecoveryConflictPending = false; LockErrorCleanup(); pgstat_report_recovery_conflict(RecoveryConflictReason); @@ -2950,7 +2950,7 @@ ProcessInterrupts(void) */ if (lock_timeout_occurred && stmt_timeout_occurred && get_timeout_finish_time(STATEMENT_TIMEOUT) < get_timeout_finish_time(LOCK_TIMEOUT)) - lock_timeout_occurred = false; /* report stmt timeout */ + lock_timeout_occurred = false; /* report stmt timeout */ if (lock_timeout_occurred) { @@ -3050,7 +3050,7 @@ ia64_get_bsp(void) return ret; } #endif -#endif /* IA64 */ +#endif /* IA64 */ /* @@ -3168,7 +3168,7 @@ stack_is_too_deep(void) if (stack_depth > max_stack_depth_bytes && register_stack_base_ptr != NULL) return true; -#endif /* IA64 */ +#endif /* IA64 */ return false; } @@ -3283,7 +3283,7 @@ get_stats_option_name(const char *arg) switch (arg[0]) { case 'p': - if (optarg[1] == 'a') /* "parser" */ + if (optarg[1] == 'a') /* "parser" */ return "log_parser_stats"; else if (optarg[1] == 'l') /* "planner" */ return "log_planner_stats"; @@ -3339,7 +3339,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx, } else { - gucsource = PGC_S_CLIENT; /* switches came from client */ + gucsource = PGC_S_CLIENT; /* switches came from client */ } #ifdef HAVE_INT_OPTERR @@ -3640,9 +3640,9 @@ PostgresMain(int argc, char *argv[], WalSndSignals(); else { - pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read - * config file */ - pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */ + pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read config + * file */ + pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */ pqsignal(SIGTERM, die); /* cancel current query and exit */ /* @@ -3651,9 +3651,9 @@ PostgresMain(int argc, char *argv[], * rather than quickdie(). */ if (IsUnderPostmaster) - pqsignal(SIGQUIT, quickdie); /* hard crash time */ + pqsignal(SIGQUIT, quickdie); /* hard crash time */ else - pqsignal(SIGQUIT, die); /* cancel current query and exit */ + pqsignal(SIGQUIT, die); /* cancel current query and exit */ InitializeTimeouts(); /* establishes SIGALRM handler */ /* @@ -3671,8 +3671,8 @@ PostgresMain(int argc, char *argv[], * Reset some signals that are accepted by postmaster but not by * backend */ - pqsignal(SIGCHLD, SIG_DFL); /* system() requires this on some - * platforms */ + pqsignal(SIGCHLD, SIG_DFL); /* system() requires this on some + * platforms */ } pqinitmask(); @@ -3856,7 +3856,7 @@ PostgresMain(int argc, char *argv[], * forgetting a timeout cancel. */ disable_all_timeouts(false); - QueryCancelPending = false; /* second to avoid race condition */ + QueryCancelPending = false; /* second to avoid race condition */ /* Not reading from the client anymore. */ DoingCommandRead = false; @@ -4225,7 +4225,7 @@ PostgresMain(int argc, char *argv[], } if (whereToSendOutput == DestRemote) - pq_putemptymessage('3'); /* CloseComplete */ + pq_putemptymessage('3'); /* CloseComplete */ } break; @@ -4468,7 +4468,7 @@ ShowUsage(const char *title) r.ru_nvcsw - Save_r.ru_nvcsw, r.ru_nivcsw - Save_r.ru_nivcsw, r.ru_nvcsw, r.ru_nivcsw); -#endif /* HAVE_GETRUSAGE */ +#endif /* HAVE_GETRUSAGE */ /* remove trailing newline */ if (str.data[str.len - 1] == '\n') diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index e30aeb1c7f..756249ef4b 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -76,7 +76,7 @@ CreateQueryDesc(PlannedStmt *plannedstmt, QueryDesc *qd = (QueryDesc *) palloc(sizeof(QueryDesc)); qd->operation = plannedstmt->commandType; /* operation */ - qd->plannedstmt = plannedstmt; /* plan */ + qd->plannedstmt = plannedstmt; /* plan */ qd->sourceText = sourceText; /* query text */ qd->snapshot = RegisterSnapshot(snapshot); /* snapshot */ /* RI check snapshot */ @@ -84,8 +84,7 @@ CreateQueryDesc(PlannedStmt *plannedstmt, qd->dest = dest; /* output dest */ qd->params = params; /* parameter values passed into query */ qd->queryEnv = queryEnv; - qd->instrument_options = instrument_options; /* instrumentation - * wanted? */ + qd->instrument_options = instrument_options; /* instrumentation wanted? */ /* null these fields until set by ExecutorStart */ qd->tupDesc = NULL; @@ -939,7 +938,7 @@ PortalRunSelect(Portal portal, if (!ScanDirectionIsNoMovement(direction)) { if (nprocessed > 0) - portal->atStart = false; /* OK to go backward now */ + portal->atStart = false; /* OK to go backward now */ if (count == 0 || nprocessed < (uint64) count) portal->atEnd = true; /* we retrieved 'em all */ portal->portalPos += nprocessed; diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index dd1916f366..b0e8a84c62 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1183,7 +1183,7 @@ ProcessUtilitySlow(ParseState *pstate, */ switch (stmt->subtype) { - case 'T': /* ALTER DOMAIN DEFAULT */ + case 'T': /* ALTER DOMAIN DEFAULT */ /* * Recursively alter column default for table and, @@ -1193,30 +1193,30 @@ ProcessUtilitySlow(ParseState *pstate, AlterDomainDefault(stmt->typeName, stmt->def); break; - case 'N': /* ALTER DOMAIN DROP NOT NULL */ + case 'N': /* ALTER DOMAIN DROP NOT NULL */ address = AlterDomainNotNull(stmt->typeName, false); break; - case 'O': /* ALTER DOMAIN SET NOT NULL */ + case 'O': /* ALTER DOMAIN SET NOT NULL */ address = AlterDomainNotNull(stmt->typeName, true); break; - case 'C': /* ADD CONSTRAINT */ + case 'C': /* ADD CONSTRAINT */ address = AlterDomainAddConstraint(stmt->typeName, stmt->def, &secondaryObject); break; - case 'X': /* DROP CONSTRAINT */ + case 'X': /* DROP CONSTRAINT */ address = AlterDomainDropConstraint(stmt->typeName, stmt->name, stmt->behavior, stmt->missing_ok); break; - case 'V': /* VALIDATE CONSTRAINT */ + case 'V': /* VALIDATE CONSTRAINT */ address = AlterDomainValidateConstraint(stmt->typeName, stmt->name); @@ -1324,14 +1324,14 @@ ProcessUtilitySlow(ParseState *pstate, /* ... and do it */ EventTriggerAlterTableStart(parsetree); address = - DefineIndex(relid, /* OID of heap relation */ + DefineIndex(relid, /* OID of heap relation */ stmt, InvalidOid, /* no predefined OID */ - false, /* is_alter_table */ - true, /* check_rights */ - true, /* check_not_in_use */ - false, /* skip_build */ - false); /* quiet */ + false, /* is_alter_table */ + true, /* check_rights */ + true, /* check_not_in_use */ + false, /* skip_build */ + false); /* quiet */ /* * Add the CREATE INDEX node itself to stash right away; @@ -1403,15 +1403,15 @@ ProcessUtilitySlow(ParseState *pstate, } break; - case T_CreateEnumStmt: /* CREATE TYPE AS ENUM */ + case T_CreateEnumStmt: /* CREATE TYPE AS ENUM */ address = DefineEnum((CreateEnumStmt *) parsetree); break; - case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */ + case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */ address = DefineRange((CreateRangeStmt *) parsetree); break; - case T_AlterEnumStmt: /* ALTER TYPE (enum) */ + case T_AlterEnumStmt: /* ALTER TYPE (enum) */ address = AlterEnum((AlterEnumStmt *) parsetree); break; @@ -1594,7 +1594,7 @@ ProcessUtilitySlow(ParseState *pstate, address = CreatePolicy((CreatePolicyStmt *) parsetree); break; - case T_AlterPolicyStmt: /* ALTER POLICY */ + case T_AlterPolicyStmt: /* ALTER POLICY */ address = AlterPolicy((AlterPolicyStmt *) parsetree); break; @@ -1725,7 +1725,7 @@ UtilityReturnsTuples(Node *parsetree) return false; portal = GetPortalByName(stmt->portalname); if (!PortalIsValid(portal)) - return false; /* not our business to raise error */ + return false; /* not our business to raise error */ return portal->tupDesc ? true : false; } @@ -1736,7 +1736,7 @@ UtilityReturnsTuples(Node *parsetree) entry = FetchPreparedStatement(stmt->name, false); if (!entry) - return false; /* not our business to raise error */ + return false; /* not our business to raise error */ if (entry->plansource->resultDesc) return true; return false; @@ -2887,7 +2887,7 @@ GetCommandLogLevel(Node *parsetree) case T_SelectStmt: if (((SelectStmt *) parsetree)->intoClause) - lev = LOGSTMT_DDL; /* SELECT INTO */ + lev = LOGSTMT_DDL; /* SELECT INTO */ else lev = LOGSTMT_ALL; break; diff --git a/src/backend/tsearch/dict_thesaurus.c b/src/backend/tsearch/dict_thesaurus.c index 9a01075d4e..ccf057b5d6 100644 --- a/src/backend/tsearch/dict_thesaurus.c +++ b/src/backend/tsearch/dict_thesaurus.c @@ -405,7 +405,7 @@ compileTheLexeme(DictThesaurus *d) { TSLexeme *ptr; - if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */ + if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */ newwrds = addCompiledLexeme(newwrds, &nnw, &tnm, NULL, d->wrds[i].entries, 0); else { diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index 817237ce4d..3bcc93fa1b 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -827,7 +827,7 @@ get_nextfield(char **str, char *next) *next = '\0'; - return (state == PAE_INMASK); /* OK if we got a nonempty field */ + return (state == PAE_INMASK); /* OK if we got a nonempty field */ } /* diff --git a/src/backend/tsearch/ts_locale.c b/src/backend/tsearch/ts_locale.c index 19d2cc3f30..2cc084770d 100644 --- a/src/backend/tsearch/ts_locale.c +++ b/src/backend/tsearch/ts_locale.c @@ -28,7 +28,7 @@ t_isdigit(const char *ptr) { int clen = pg_mblen(ptr); wchar_t character[2]; - Oid collation = DEFAULT_COLLATION_OID; /* TODO */ + Oid collation = DEFAULT_COLLATION_OID; /* TODO */ pg_locale_t mylocale = 0; /* TODO */ if (clen == 1 || lc_ctype_is_c(collation)) @@ -44,7 +44,7 @@ t_isspace(const char *ptr) { int clen = pg_mblen(ptr); wchar_t character[2]; - Oid collation = DEFAULT_COLLATION_OID; /* TODO */ + Oid collation = DEFAULT_COLLATION_OID; /* TODO */ pg_locale_t mylocale = 0; /* TODO */ if (clen == 1 || lc_ctype_is_c(collation)) @@ -60,7 +60,7 @@ t_isalpha(const char *ptr) { int clen = pg_mblen(ptr); wchar_t character[2]; - Oid collation = DEFAULT_COLLATION_OID; /* TODO */ + Oid collation = DEFAULT_COLLATION_OID; /* TODO */ pg_locale_t mylocale = 0; /* TODO */ if (clen == 1 || lc_ctype_is_c(collation)) @@ -76,7 +76,7 @@ t_isprint(const char *ptr) { int clen = pg_mblen(ptr); wchar_t character[2]; - Oid collation = DEFAULT_COLLATION_OID; /* TODO */ + Oid collation = DEFAULT_COLLATION_OID; /* TODO */ pg_locale_t mylocale = 0; /* TODO */ if (clen == 1 || lc_ctype_is_c(collation)) @@ -86,7 +86,7 @@ t_isprint(const char *ptr) return iswprint((wint_t) character[0]); } -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ /* @@ -246,7 +246,7 @@ lowerstr_with_len(const char *str, int len) char *out; #ifdef USE_WIDE_UPPER_LOWER - Oid collation = DEFAULT_COLLATION_OID; /* TODO */ + Oid collation = DEFAULT_COLLATION_OID; /* TODO */ pg_locale_t mylocale = 0; /* TODO */ #endif @@ -300,7 +300,7 @@ lowerstr_with_len(const char *str, int len) Assert(wlen < len); } else -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ { const char *ptr = str; char *outptr; diff --git a/src/backend/tsearch/ts_typanalyze.c b/src/backend/tsearch/ts_typanalyze.c index f4298ca9aa..975623fa96 100644 --- a/src/backend/tsearch/ts_typanalyze.c +++ b/src/backend/tsearch/ts_typanalyze.c @@ -423,7 +423,7 @@ compute_tsvector_stats(VacAttrStats *stats, stats->stats_valid = true; stats->stanullfrac = 1.0; stats->stawidth = 0; /* "unknown" */ - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c index 0cfc6552d7..0ce2e00eb2 100644 --- a/src/backend/tsearch/wparser_def.c +++ b/src/backend/tsearch/wparser_def.c @@ -199,10 +199,10 @@ typedef enum /* forward declaration */ struct TParser; -typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions - * except p_iseq */ -typedef void (*TParserSpecial) (struct TParser *); /* special handler for - * special cases... */ +typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions + * except p_iseq */ +typedef void (*TParserSpecial) (struct TParser *); /* special handler for + * special cases... */ typedef struct { @@ -302,7 +302,7 @@ TParserInit(char *str, int len) if (prs->charmaxlen > 1) { Oid collation = DEFAULT_COLLATION_OID; /* TODO */ - pg_locale_t mylocale = 0; /* TODO */ + pg_locale_t mylocale = 0; /* TODO */ prs->usewide = true; if (lc_ctype_is_c(collation)) @@ -560,7 +560,7 @@ p_iseq(TParser *prs, char c) p_iswhat(alnum) p_iswhat(alpha) -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ p_iswhat(digit) p_iswhat(lower) @@ -1697,7 +1697,7 @@ static const TParserStateActionItem actionTPS_InHyphenUnsignedInt[] = { */ typedef struct { - const TParserStateActionItem *action; /* the actual state info */ + const TParserStateActionItem *action; /* the actual state info */ TParserState state; /* only for Assert crosscheck */ #ifdef WPARSER_TRACE const char *state_name; /* only for debug printout */ diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index 35bdfc9a46..c4899cb3bc 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -793,7 +793,7 @@ acldefault(GrantObjectType objtype, Oid ownerId) break; default: elog(ERROR, "unrecognized objtype: %d", (int) objtype); - world_default = ACL_NO_RIGHTS; /* keep compiler quiet */ + world_default = ACL_NO_RIGHTS; /* keep compiler quiet */ owner_default = ACL_NO_RIGHTS; break; } @@ -4713,7 +4713,7 @@ roles_has_privs_of(Oid roleid) /* * Now safe to assign to state variable */ - cached_privs_role = InvalidOid; /* just paranoia */ + cached_privs_role = InvalidOid; /* just paranoia */ list_free(cached_privs_roles); cached_privs_roles = new_cached_privs_roles; cached_privs_role = roleid; diff --git a/src/backend/utils/adt/array_selfuncs.c b/src/backend/utils/adt/array_selfuncs.c index 3ae6018c67..7be5e6c677 100644 --- a/src/backend/utils/adt/array_selfuncs.c +++ b/src/backend/utils/adt/array_selfuncs.c @@ -788,7 +788,7 @@ mcelem_array_contained_selec(Datum *mcelem, int nmcelem, else { if (cmp == 0) - match = true; /* mcelem is found */ + match = true; /* mcelem is found */ break; } } diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 1d202dba12..e1ebe57681 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -171,8 +171,8 @@ Datum array_in(PG_FUNCTION_ARGS) { char *string = PG_GETARG_CSTRING(0); /* external form */ - Oid element_type = PG_GETARG_OID(1); /* type of an array - * element */ + Oid element_type = PG_GETARG_OID(1); /* type of an array + * element */ int32 typmod = PG_GETARG_INT32(2); /* typmod for array elements */ int typlen; bool typbyval; @@ -1130,9 +1130,9 @@ array_out(PG_FUNCTION_ARGS) /* count data plus backslashes; detect chars needing quotes */ if (values[i][0] == '\0') - needquote = true; /* force quotes for empty string */ + needquote = true; /* force quotes for empty string */ else if (pg_strcasecmp(values[i], "NULL") == 0) - needquote = true; /* force quotes for literal NULL */ + needquote = true; /* force quotes for literal NULL */ else needquote = false; @@ -2318,14 +2318,14 @@ array_set_element(Datum arraydatum, dim[0] += addedbefore; lb[0] = indx[0]; if (addedbefore > 1) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ } if (indx[0] >= (dim[0] + lb[0])) { addedafter = indx[0] - (dim[0] + lb[0]) + 1; dim[0] += addedafter; if (addedafter > 1) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ } } else @@ -2575,7 +2575,7 @@ array_set_element_expanded(Datum arraydatum, lb[0] = indx[0]; dimschanged = true; if (addedbefore > 1) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ } if (indx[0] >= (dim[0] + lb[0])) { @@ -2583,7 +2583,7 @@ array_set_element_expanded(Datum arraydatum, dim[0] += addedafter; dimschanged = true; if (addedafter > 1) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ } } else @@ -2871,7 +2871,7 @@ array_set_slice(Datum arraydatum, if (lowerIndx[0] < lb[0]) { if (upperIndx[0] < lb[0] - 1) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ addedbefore = lb[0] - lowerIndx[0]; dim[0] += addedbefore; lb[0] = lowerIndx[0]; @@ -2879,7 +2879,7 @@ array_set_slice(Datum arraydatum, if (upperIndx[0] >= (dim[0] + lb[0])) { if (lowerIndx[0] > (dim[0] + lb[0])) - newhasnulls = true; /* will insert nulls */ + newhasnulls = true; /* will insert nulls */ addedafter = upperIndx[0] - (dim[0] + lb[0]) + 1; dim[0] += addedafter; } @@ -2956,7 +2956,7 @@ array_set_slice(Datum arraydatum, ndim, dim, lb, lowerIndx, upperIndx, elmlen, elmbyval, elmalign); - lenbefore = lenafter = 0; /* keep compiler quiet */ + lenbefore = lenafter = 0; /* keep compiler quiet */ itemsbefore = itemsafter = nolditems = 0; } else @@ -4963,8 +4963,7 @@ initArrayResult(Oid element_type, MemoryContext rcontext, bool subcontext) MemoryContextAlloc(arr_context, sizeof(ArrayBuildState)); astate->mcontext = arr_context; astate->private_cxt = subcontext; - astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array - * size */ + astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array size */ astate->dvalues = (Datum *) MemoryContextAlloc(arr_context, astate->alen * sizeof(Datum)); astate->dnulls = (bool *) @@ -5140,8 +5139,7 @@ initArrayResultArr(Oid array_type, Oid element_type, MemoryContext rcontext, bool subcontext) { ArrayBuildStateArr *astate; - MemoryContext arr_context = rcontext; /* by default use the parent - * ctx */ + MemoryContext arr_context = rcontext; /* by default use the parent ctx */ /* Lookup element type, unless element_type already provided */ if (!OidIsValid(element_type)) diff --git a/src/backend/utils/adt/ascii.c b/src/backend/utils/adt/ascii.c index e219d4b495..362272277f 100644 --- a/src/backend/utils/adt/ascii.c +++ b/src/backend/utils/adt/ascii.c @@ -102,9 +102,9 @@ pg_to_ascii(unsigned char *src, unsigned char *src_end, unsigned char *dest, int static text * encode_to_ascii(text *data, int enc) { - pg_to_ascii((unsigned char *) VARDATA(data), /* src */ - (unsigned char *) (data) + VARSIZE(data), /* src end */ - (unsigned char *) VARDATA(data), /* dest */ + pg_to_ascii((unsigned char *) VARDATA(data), /* src */ + (unsigned char *) (data) + VARSIZE(data), /* src end */ + (unsigned char *) VARDATA(data), /* dest */ enc); /* encoding */ return data; diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index 677037c246..7bbc634bd2 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -971,10 +971,10 @@ cash_words(PG_FUNCTION_ARGS) val = (uint64) value; m0 = val % INT64CONST(100); /* cents */ - m1 = (val / INT64CONST(100)) % 1000; /* hundreds */ - m2 = (val / INT64CONST(100000)) % 1000; /* thousands */ + m1 = (val / INT64CONST(100)) % 1000; /* hundreds */ + m2 = (val / INT64CONST(100000)) % 1000; /* thousands */ m3 = (val / INT64CONST(100000000)) % 1000; /* millions */ - m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */ + m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */ m5 = (val / INT64CONST(100000000000000)) % 1000; /* trillions */ m6 = (val / INT64CONST(100000000000000000)) % 1000; /* quadrillions */ diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c index 3095047f0b..2b261cd5bd 100644 --- a/src/backend/utils/adt/date.c +++ b/src/backend/utils/adt/date.c @@ -527,7 +527,7 @@ date_pli(PG_FUNCTION_ARGS) DateADT result; if (DATE_NOT_FINITE(dateVal)) - PG_RETURN_DATEADT(dateVal); /* can't change infinity */ + PG_RETURN_DATEADT(dateVal); /* can't change infinity */ result = dateVal + days; @@ -551,7 +551,7 @@ date_mii(PG_FUNCTION_ARGS) DateADT result; if (DATE_NOT_FINITE(dateVal)) - PG_RETURN_DATEADT(dateVal); /* can't change infinity */ + PG_RETURN_DATEADT(dateVal); /* can't change infinity */ result = dateVal - days; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 107b8fdad9..73c4e41213 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -91,7 +91,7 @@ static const datetkn datetktbl[] = { /* token, type, value */ {EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */ {DA_D, ADBC, AD}, /* "ad" for years > 0 */ - {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */ + {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */ {"am", AMPM, AM}, {"apr", MONTH, 4}, {"april", MONTH, 4}, @@ -113,8 +113,8 @@ static const datetkn datetktbl[] = { {"friday", DOW, 5}, {"h", UNITS, DTK_HOUR}, /* "hour" */ {LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */ - {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */ - {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */ + {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */ + {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */ {"isoyear", UNITS, DTK_ISOYEAR}, /* year in terms of the ISO week date */ {"j", UNITS, DTK_JULIAN}, {"jan", MONTH, 1}, @@ -176,33 +176,33 @@ static const datetkn deltatktbl[] = { {"@", IGNORE_DTF, 0}, /* postgres relative prefix */ {DAGO, AGO, 0}, /* "ago" indicates negative time offset */ {"c", UNITS, DTK_CENTURY}, /* "century" relative */ - {"cent", UNITS, DTK_CENTURY}, /* "century" relative */ + {"cent", UNITS, DTK_CENTURY}, /* "century" relative */ {"centuries", UNITS, DTK_CENTURY}, /* "centuries" relative */ - {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */ + {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */ {"d", UNITS, DTK_DAY}, /* "day" relative */ {DDAY, UNITS, DTK_DAY}, /* "day" relative */ {"days", UNITS, DTK_DAY}, /* "days" relative */ {"dec", UNITS, DTK_DECADE}, /* "decade" relative */ - {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */ - {"decades", UNITS, DTK_DECADE}, /* "decades" relative */ + {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */ + {"decades", UNITS, DTK_DECADE}, /* "decades" relative */ {"decs", UNITS, DTK_DECADE}, /* "decades" relative */ {"h", UNITS, DTK_HOUR}, /* "hour" relative */ {DHOUR, UNITS, DTK_HOUR}, /* "hour" relative */ {"hours", UNITS, DTK_HOUR}, /* "hours" relative */ {"hr", UNITS, DTK_HOUR}, /* "hour" relative */ {"hrs", UNITS, DTK_HOUR}, /* "hours" relative */ - {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */ + {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */ {"m", UNITS, DTK_MINUTE}, /* "minute" relative */ - {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ - {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ - {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */ - {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ - {"millisecon", UNITS, DTK_MILLISEC}, /* relative */ + {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ + {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ + {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */ + {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ + {"millisecon", UNITS, DTK_MILLISEC}, /* relative */ {"mils", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */ {"min", UNITS, DTK_MINUTE}, /* "minute" relative */ {"mins", UNITS, DTK_MINUTE}, /* "minutes" relative */ - {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */ - {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */ + {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */ + {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */ {"mon", UNITS, DTK_MONTH}, /* "months" relative */ {"mons", UNITS, DTK_MONTH}, /* "months" relative */ {DMONTH, UNITS, DTK_MONTH}, /* "month" relative */ @@ -213,7 +213,7 @@ static const datetkn deltatktbl[] = { {"mseconds", UNITS, DTK_MILLISEC}, {"msecs", UNITS, DTK_MILLISEC}, {"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */ - {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */ + {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */ {"s", UNITS, DTK_SECOND}, {"sec", UNITS, DTK_SECOND}, {DSECOND, UNITS, DTK_SECOND}, @@ -221,13 +221,13 @@ static const datetkn deltatktbl[] = { {"secs", UNITS, DTK_SECOND}, {DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */ {"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */ - {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */ + {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */ {"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */ {"us", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ - {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ + {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {DMICROSEC, UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {"useconds", UNITS, DTK_MICROSEC}, /* "microseconds" relative */ - {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */ + {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */ {"w", UNITS, DTK_WEEK}, /* "week" relative */ {DWEEK, UNITS, DTK_WEEK}, /* "week" relative */ {"weeks", UNITS, DTK_WEEK}, /* "weeks" relative */ @@ -2752,7 +2752,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask, if (flen >= 3 && *is2digits) { /* Guess that first numeric field is day was wrong */ - *tmask = DTK_M(DAY); /* YEAR is already set */ + *tmask = DTK_M(DAY); /* YEAR is already set */ tm->tm_mday = tm->tm_year; tm->tm_year = val; *is2digits = FALSE; diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 894f026a41..30746ef908 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -65,7 +65,7 @@ do { \ /* Configurable GUC parameter */ -int extra_float_digits = 0; /* Added to DBL_DIG or FLT_DIG */ +int extra_float_digits = 0; /* Added to DBL_DIG or FLT_DIG */ /* Cached constants for degree-based trig functions */ static bool degree_consts_set = false; @@ -105,7 +105,7 @@ static void init_degree_constants(void); */ #define cbrt my_cbrt static double cbrt(double x); -#endif /* HAVE_CBRT */ +#endif /* HAVE_CBRT */ /* @@ -329,7 +329,7 @@ float4in(PG_FUNCTION_ARGS) if (endptr != num && endptr[-1] == '\0') endptr--; } -#endif /* HAVE_BUGGY_SOLARIS_STRTOD */ +#endif /* HAVE_BUGGY_SOLARIS_STRTOD */ /* skip trailing whitespace */ while (*endptr != '\0' && isspace((unsigned char) *endptr)) @@ -555,7 +555,7 @@ float8in_internal(char *num, char **endptr_p, if (endptr != num && endptr[-1] == '\0') endptr--; } -#endif /* HAVE_BUGGY_SOLARIS_STRTOD */ +#endif /* HAVE_BUGGY_SOLARIS_STRTOD */ /* skip trailing whitespace */ while (*endptr != '\0' && isspace((unsigned char) *endptr)) @@ -3608,4 +3608,4 @@ cbrt(double x) return isneg ? -tmpres : tmpres; } -#endif /* !HAVE_CBRT */ +#endif /* !HAVE_CBRT */ diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index ba7e4fc934..807ce589da 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -114,8 +114,8 @@ * Maximal length of one node * ---------- */ -#define DCH_MAX_ITEM_SIZ 12 /* max localized day name */ -#define NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */ +#define DCH_MAX_ITEM_SIZ 12 /* max localized day name */ +#define NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */ /* ---------- * More is in float.c @@ -724,7 +724,7 @@ static const KeyWord DCH_keywords[] = { {"AM", 2, DCH_AM, FALSE, FROM_CHAR_DATE_NONE}, {"B.C.", 4, DCH_B_C, FALSE, FROM_CHAR_DATE_NONE}, /* B */ {"BC", 2, DCH_BC, FALSE, FROM_CHAR_DATE_NONE}, - {"CC", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* C */ + {"CC", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* C */ {"DAY", 3, DCH_DAY, FALSE, FROM_CHAR_DATE_NONE}, /* D */ {"DDD", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"DD", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN}, @@ -732,11 +732,11 @@ static const KeyWord DCH_keywords[] = { {"Day", 3, DCH_Day, FALSE, FROM_CHAR_DATE_NONE}, {"Dy", 2, DCH_Dy, FALSE, FROM_CHAR_DATE_NONE}, {"D", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"FX", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* F */ + {"FX", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* F */ {"HH24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* H */ {"HH12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE}, {"HH", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE}, - {"IDDD", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* I */ + {"IDDD", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* I */ {"ID", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"IW", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"IYYY", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, @@ -744,22 +744,22 @@ static const KeyWord DCH_keywords[] = { {"IY", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"I", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"J", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* J */ - {"MI", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* M */ + {"MI", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* M */ {"MM", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"MONTH", 5, DCH_MONTH, FALSE, FROM_CHAR_DATE_GREGORIAN}, {"MON", 3, DCH_MON, FALSE, FROM_CHAR_DATE_GREGORIAN}, {"MS", 2, DCH_MS, TRUE, FROM_CHAR_DATE_NONE}, {"Month", 5, DCH_Month, FALSE, FROM_CHAR_DATE_GREGORIAN}, {"Mon", 3, DCH_Mon, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */ + {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */ {"P.M.", 4, DCH_P_M, FALSE, FROM_CHAR_DATE_NONE}, /* P */ {"PM", 2, DCH_PM, FALSE, FROM_CHAR_DATE_NONE}, {"Q", 1, DCH_Q, TRUE, FROM_CHAR_DATE_NONE}, /* Q */ {"RM", 2, DCH_RM, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* R */ {"SSSS", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* S */ {"SS", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE}, - {"TZ", 2, DCH_TZ, FALSE, FROM_CHAR_DATE_NONE}, /* T */ - {"US", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* U */ + {"TZ", 2, DCH_TZ, FALSE, FROM_CHAR_DATE_NONE}, /* T */ + {"US", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* U */ {"WW", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* W */ {"W", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"Y,YYY", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* Y */ @@ -773,17 +773,17 @@ static const KeyWord DCH_keywords[] = { {"am", 2, DCH_am, FALSE, FROM_CHAR_DATE_NONE}, {"b.c.", 4, DCH_b_c, FALSE, FROM_CHAR_DATE_NONE}, /* b */ {"bc", 2, DCH_bc, FALSE, FROM_CHAR_DATE_NONE}, - {"cc", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* c */ + {"cc", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* c */ {"day", 3, DCH_day, FALSE, FROM_CHAR_DATE_NONE}, /* d */ {"ddd", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"dd", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"dy", 2, DCH_dy, FALSE, FROM_CHAR_DATE_NONE}, {"d", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"fx", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* f */ + {"fx", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* f */ {"hh24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* h */ {"hh12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE}, {"hh", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE}, - {"iddd", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* i */ + {"iddd", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* i */ {"id", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"iw", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"iyyy", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, @@ -791,7 +791,7 @@ static const KeyWord DCH_keywords[] = { {"iy", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"i", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK}, {"j", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* j */ - {"mi", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* m */ + {"mi", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* m */ {"mm", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"month", 5, DCH_month, FALSE, FROM_CHAR_DATE_GREGORIAN}, {"mon", 3, DCH_mon, FALSE, FROM_CHAR_DATE_GREGORIAN}, @@ -802,8 +802,8 @@ static const KeyWord DCH_keywords[] = { {"rm", 2, DCH_rm, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* r */ {"ssss", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* s */ {"ss", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE}, - {"tz", 2, DCH_tz, FALSE, FROM_CHAR_DATE_NONE}, /* t */ - {"us", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* u */ + {"tz", 2, DCH_tz, FALSE, FROM_CHAR_DATE_NONE}, /* t */ + {"us", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* u */ {"ww", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* w */ {"w", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN}, {"y,yyy", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* y */ @@ -1377,7 +1377,7 @@ dump_node(FormatNode *node, int max) elog(DEBUG_elog_output, "%d:\t unknown NODE!", a); } } -#endif /* DEBUG */ +#endif /* DEBUG */ /***************************************************************************** * Private utils @@ -1491,7 +1491,7 @@ u_strToTitle_default_BI(UChar *dest, int32_t destCapacity, NULL, locale, pErrorCode); } -#endif /* USE_ICU */ +#endif /* USE_ICU */ /* * If the system provides the needed functions for wide-character manipulation @@ -1602,7 +1602,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid) wchar2char(result, workspace, result_size, mylocale); pfree(workspace); } -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ else { char *p; @@ -1725,7 +1725,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid) wchar2char(result, workspace, result_size, mylocale); pfree(workspace); } -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ else { char *p; @@ -1861,7 +1861,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid) wchar2char(result, workspace, result_size, mylocale); pfree(workspace); } -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ else { char *p; @@ -2066,7 +2066,7 @@ dump_index(const KeyWord *k, const int *index) elog(DEBUG_elog_output, "\n\t\tUsed positions: %d,\n\t\tFree positions: %d", count, free_i); } -#endif /* DEBUG */ +#endif /* DEBUG */ /* ---------- * Return TRUE if next format picture is not digit value @@ -4309,12 +4309,12 @@ NUM_numpart_from_char(NUMProc *Np, int id, int input_len) if (*Np->inout_p == '-' || (IS_BRACKET(Np->Num) && *Np->inout_p == '<')) { - *Np->number = '-'; /* set - */ + *Np->number = '-'; /* set - */ Np->inout_p++; } else if (*Np->inout_p == '+') { - *Np->number = '+'; /* set + */ + *Np->number = '+'; /* set + */ Np->inout_p++; } } @@ -4512,7 +4512,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) { if (!IS_FILLMODE(Np->Num)) { - *Np->inout_p = ' '; /* Write + */ + *Np->inout_p = ' '; /* Write + */ ++Np->inout_p; } Np->sign_wrote = TRUE; @@ -4539,7 +4539,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) */ if (!IS_FILLMODE(Np->Num)) { - *Np->inout_p = ' '; /* Write ' ' */ + *Np->inout_p = ' '; /* Write ' ' */ ++Np->inout_p; } } @@ -4608,7 +4608,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) } else { - *Np->inout_p = *Np->number_p; /* Write DIGIT */ + *Np->inout_p = *Np->number_p; /* Write DIGIT */ ++Np->inout_p; Np->num_in = TRUE; } @@ -4847,7 +4847,7 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, if (Np->is_to_char) { NUM_numpart_to_char(Np, n->key->id); - continue; /* for() */ + continue; /* for() */ } else { diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 40de01b7bc..97210e8db3 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -1598,7 +1598,7 @@ path_inter(PG_FUNCTION_ARGS) { if (!p1->closed) continue; - iprev = p1->npts - 1; /* include the closure segment */ + iprev = p1->npts - 1; /* include the closure segment */ } for (j = 0; j < p2->npts; j++) @@ -1652,7 +1652,7 @@ path_distance(PG_FUNCTION_ARGS) { if (!p1->closed) continue; - iprev = p1->npts - 1; /* include the closure segment */ + iprev = p1->npts - 1; /* include the closure segment */ } for (j = 0; j < p2->npts; j++) @@ -1710,7 +1710,7 @@ path_length(PG_FUNCTION_ARGS) { if (!path->closed) continue; - iprev = path->npts - 1; /* include the closure segment */ + iprev = path->npts - 1; /* include the closure segment */ } result += point_dt(&path->p[iprev], &path->p[i]); @@ -2457,7 +2457,7 @@ dist_ppath(PG_FUNCTION_ARGS) { if (!path->closed) continue; - iprev = path->npts - 1; /* include the closure segment */ + iprev = path->npts - 1; /* include the closure segment */ } statlseg_construct(&lseg, &path->p[iprev], &path->p[i]); @@ -2776,7 +2776,7 @@ close_ps(PG_FUNCTION_ARGS) xh = lseg->p[0].x < lseg->p[1].x; yh = lseg->p[0].y < lseg->p[1].y; - if (FPeq(lseg->p[0].x, lseg->p[1].x)) /* vertical? */ + if (FPeq(lseg->p[0].x, lseg->p[1].x)) /* vertical? */ { #ifdef GEODEBUG printf("close_ps- segment is vertical\n"); @@ -2822,24 +2822,24 @@ close_ps(PG_FUNCTION_ARGS) */ invm = -1.0 / point_sl(&(lseg->p[0]), &(lseg->p[1])); - tmp = line_construct_pm(&lseg->p[!yh], invm); /* lower edge of the - * "band" */ + tmp = line_construct_pm(&lseg->p[!yh], invm); /* lower edge of the + * "band" */ if (pt->y < (tmp->A * pt->x + tmp->C)) { /* we are below the lower edge */ - result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower - * end pt */ + result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower end + * pt */ #ifdef GEODEBUG printf("close_ps below: tmp A %f B %f C %f\n", tmp->A, tmp->B, tmp->C); #endif PG_RETURN_POINT_P(result); } - tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the - * "band" */ + tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the + * "band" */ if (pt->y > (tmp->A * pt->x + tmp->C)) { /* we are below the lower edge */ - result = point_copy(&lseg->p[yh]); /* above the lseg, take higher - * end pt */ + result = point_copy(&lseg->p[yh]); /* above the lseg, take higher end + * pt */ #ifdef GEODEBUG printf("close_ps above: tmp A %f B %f C %f\n", tmp->A, tmp->B, tmp->C); diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c index 0c6a412f2a..e8354dee44 100644 --- a/src/backend/utils/adt/int8.c +++ b/src/backend/utils/adt/int8.c @@ -104,7 +104,7 @@ scanint8(const char *str, bool errorOK, int64 *result) { int64 newtmp = tmp * 10 + (*ptr++ - '0'); - if ((newtmp / 10) != tmp) /* overflow? */ + if ((newtmp / 10) != tmp) /* overflow? */ { if (errorOK) return false; diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 0f99b613f5..8b822b2736 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -347,7 +347,7 @@ pg_parse_json(JsonLexContext *lex, JsonSemAction *sem) parse_array(lex, sem); break; default: - parse_scalar(lex, sem); /* json can be a bare scalar */ + parse_scalar(lex, sem); /* json can be a bare scalar */ } lex_expect(JSON_PARSE_END, lex, JSON_TOKEN_END); diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index 01df06ebfd..aa0dc165f0 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -57,8 +57,8 @@ typedef struct OkeysState typedef struct IterateJsonStringValuesState { JsonLexContext *lex; - JsonIterateStringValuesAction action; /* an action that will be - * applied to each json value */ + JsonIterateStringValuesAction action; /* an action that will be applied + * to each json value */ void *action_state; /* any necessary context for iteration */ } IterateJsonStringValuesState; @@ -67,8 +67,8 @@ typedef struct TransformJsonStringValuesState { JsonLexContext *lex; StringInfo strval; /* resulting json */ - JsonTransformStringValuesAction action; /* an action that will be - * applied to each json value */ + JsonTransformStringValuesAction action; /* an action that will be applied + * to each json value */ void *action_state; /* any necessary context for transformation */ } TransformJsonStringValuesState; @@ -136,7 +136,7 @@ typedef struct JHashState /* hashtable element */ typedef struct JsonHashEntry { - char fname[NAMEDATALEN]; /* hash key (MUST BE FIRST) */ + char fname[NAMEDATALEN]; /* hash key (MUST BE FIRST) */ char *val; JsonTokenType type; } JsonHashEntry; @@ -2479,7 +2479,7 @@ populate_array_element_end(void *_state, bool isnull) else if (state->element_scalar) { jsv.val.json.str = state->element_scalar; - jsv.val.json.len = -1; /* null-terminated */ + jsv.val.json.len = -1; /* null-terminated */ } else { @@ -2545,9 +2545,9 @@ populate_array_json(PopulateArrayContext *ctx, char *json, int len) * elements and accumulate result using given ArrayBuildState. */ static void -populate_array_dim_jsonb(PopulateArrayContext *ctx, /* context */ - JsonbValue *jbv, /* jsonb sub-array */ - int ndim) /* current dimension */ +populate_array_dim_jsonb(PopulateArrayContext *ctx, /* context */ + JsonbValue *jbv, /* jsonb sub-array */ + int ndim) /* current dimension */ { JsonbContainer *jbc = jbv->val.binary.data; JsonbIterator *it; @@ -2812,7 +2812,7 @@ populate_scalar(ScalarIOData *io, Oid typid, int32 typmod, JsValue *jsv) str = JsonbToCString(NULL, &jsonb->root, VARSIZE(jsonb)); } - else if (jbv->type == jbvString) /* quotes are stripped */ + else if (jbv->type == jbvString) /* quotes are stripped */ str = pnstrdup(jbv->val.string.val, jbv->val.string.len); else if (jbv->type == jbvBool) str = pstrdup(jbv->val.boolean ? "true" : "false"); @@ -3977,8 +3977,8 @@ addJsonbToParseState(JsonbParseState **jbps, Jsonb *jb) if (JB_ROOT_IS_SCALAR(jb)) { - (void) JsonbIteratorNext(&it, &v, false); /* skip array header */ - (void) JsonbIteratorNext(&it, &v, false); /* fetch scalar value */ + (void) JsonbIteratorNext(&it, &v, false); /* skip array header */ + (void) JsonbIteratorNext(&it, &v, false); /* fetch scalar value */ switch (o->type) { diff --git a/src/backend/utils/adt/like_match.c b/src/backend/utils/adt/like_match.c index 634953ae67..087a720625 100644 --- a/src/backend/utils/adt/like_match.c +++ b/src/backend/utils/adt/like_match.c @@ -337,7 +337,7 @@ do_like_escape(text *pat, text *esc) return result; } -#endif /* do_like_escape */ +#endif /* do_like_escape */ #ifdef CHAREQ #undef CHAREQ diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index 38dc1266e0..e3a858c7c7 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -772,7 +772,7 @@ tintervalrecv(PG_FUNCTION_ARGS) if (tinterval->data[0] == INVALID_ABSTIME || tinterval->data[1] == INVALID_ABSTIME) - status = T_INTERVAL_INVAL; /* undefined */ + status = T_INTERVAL_INVAL; /* undefined */ else status = T_INTERVAL_VALID; @@ -919,7 +919,7 @@ timepl(PG_FUNCTION_ARGS) if (AbsoluteTimeIsReal(t1) && RelativeTimeIsValid(t2) && ((t2 > 0 && t1 < NOEND_ABSTIME - t2) || - (t2 <= 0 && t1 > NOSTART_ABSTIME - t2))) /* prevent overflow */ + (t2 <= 0 && t1 > NOSTART_ABSTIME - t2))) /* prevent overflow */ PG_RETURN_ABSOLUTETIME(t1 + t2); PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME); @@ -1538,7 +1538,7 @@ bogus: (errcode(ERRCODE_INVALID_DATETIME_FORMAT), errmsg("invalid input syntax for type %s: \"%s\"", "tinterval", i_string))); - *i_start = *i_end = INVALID_ABSTIME; /* keep compiler quiet */ + *i_start = *i_end = INVALID_ABSTIME; /* keep compiler quiet */ } diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c index e41ee478ec..974e6e8401 100644 --- a/src/backend/utils/adt/name.c +++ b/src/backend/utils/adt/name.c @@ -200,8 +200,7 @@ namecpy(Name n1, Name n2) int namecat(Name n1, Name n2) { - return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than - * n1 */ + return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than n1 */ } #endif @@ -317,9 +316,9 @@ current_schemas(PG_FUNCTION_ARGS) array = construct_array(names, i, NAMEOID, - NAMEDATALEN, /* sizeof(Name) */ - false, /* Name is not by-val */ - 'c'); /* alignment of Name */ + NAMEDATALEN, /* sizeof(Name) */ + false, /* Name is not by-val */ + 'c'); /* alignment of Name */ PG_RETURN_POINTER(array); } diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 6cce0f292c..1a182a0725 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -1933,7 +1933,7 @@ numeric_abbrev_convert_var(NumericVar *var, NumericSortSupport *nss) return NumericAbbrevGetDatum(result); } -#endif /* NUMERIC_ABBREV_BITS == 64 */ +#endif /* NUMERIC_ABBREV_BITS == 64 */ #if NUMERIC_ABBREV_BITS == 32 @@ -2010,7 +2010,7 @@ numeric_abbrev_convert_var(NumericVar *var, NumericSortSupport *nss) return NumericAbbrevGetDatum(result); } -#endif /* NUMERIC_ABBREV_BITS == 32 */ +#endif /* NUMERIC_ABBREV_BITS == 32 */ /* * Ordinary (non-sortsupport) comparisons follow. @@ -4704,7 +4704,7 @@ numeric_stddev_internal(NumericAggState *state, rscale = vsumX.dscale * 2; mul_var(&vsumX, &vsumX, &vsumX, rscale); /* vsumX = sumX * sumX */ - mul_var(&vN, &vsumX2, &vsumX2, rscale); /* vsumX2 = N * sumX2 */ + mul_var(&vN, &vsumX2, &vsumX2, rscale); /* vsumX2 = N * sumX2 */ sub_var(&vsumX2, &vsumX, &vsumX2); /* N * sumX2 - sumX * sumX */ if (cmp_var(&vsumX2, &const_zero) <= 0) @@ -4715,11 +4715,11 @@ numeric_stddev_internal(NumericAggState *state, else { if (sample) - mul_var(&vN, &vNminus1, &vNminus1, 0); /* N * (N - 1) */ + mul_var(&vN, &vNminus1, &vNminus1, 0); /* N * (N - 1) */ else mul_var(&vN, &vN, &vNminus1, 0); /* N * N */ rscale = select_div_scale(&vsumX2, &vNminus1); - div_var(&vsumX2, &vNminus1, &vsumX, rscale, true); /* variance */ + div_var(&vsumX2, &vNminus1, &vsumX, rscale, true); /* variance */ if (!variance) sqrt_var(&vsumX, &vsumX, rscale); /* stddev */ @@ -5369,7 +5369,7 @@ dump_var(const char *str, NumericVar *var) printf("\n"); } -#endif /* NUMERIC_DEBUG */ +#endif /* NUMERIC_DEBUG */ /* ---------------------------------------------------------------------- @@ -8081,7 +8081,7 @@ power_var(NumericVar *base, NumericVar *exp, NumericVar *result) if (cmp_var(base, &const_zero) == 0) { set_var_from_var(&const_zero, result); - result->dscale = NUMERIC_MIN_SIG_DIGITS; /* no need to round */ + result->dscale = NUMERIC_MIN_SIG_DIGITS; /* no need to round */ return; } diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index a2855984d5..7554fbb22c 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -129,7 +129,7 @@ static HTAB *collation_cache = NULL; #if defined(WIN32) && defined(LC_MESSAGES) -static char *IsoLocaleName(const char *); /* MSVC specific */ +static char *IsoLocaleName(const char *); /* MSVC specific */ #endif @@ -174,7 +174,7 @@ pg_perm_setlocale(int category, const char *locale) else #endif result = setlocale(category, locale); -#endif /* WIN32 */ +#endif /* WIN32 */ if (result == NULL) return result; /* fall out immediately on failure */ @@ -219,9 +219,9 @@ pg_perm_setlocale(int category, const char *locale) result = IsoLocaleName(locale); if (result == NULL) result = (char *) locale; -#endif /* WIN32 */ +#endif /* WIN32 */ break; -#endif /* LC_MESSAGES */ +#endif /* LC_MESSAGES */ case LC_MONETARY: envvar = "LC_MONETARY"; envbuf = lc_monetary_envbuf; @@ -752,7 +752,7 @@ strftime_win32(char *dst, size_t dstlen, /* redefine strftime() */ #define strftime(a,b,c,d) strftime_win32(a,b,c,d) -#endif /* WIN32 */ +#endif /* WIN32 */ /* Subroutine for cache_locale_time(). */ static void @@ -972,9 +972,9 @@ IsoLocaleName(const char *winlocname) return NULL; #else return NULL; /* Not supported on this version of msvc/mingw */ -#endif /* _MSC_VER >= 1400 */ +#endif /* _MSC_VER >= 1400 */ } -#endif /* WIN32 && LC_MESSAGES */ +#endif /* WIN32 && LC_MESSAGES */ /* @@ -1242,7 +1242,7 @@ report_newlocale_failure(const char *localename) errdetail("The operating system could not find any locale data for the locale name \"%s\".", localename) : 0))); } -#endif /* HAVE_LOCALE_T */ +#endif /* HAVE_LOCALE_T */ /* @@ -1346,7 +1346,7 @@ pg_newlocale_from_collation(Oid collid) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("collation provider LIBC is not supported on this platform"))); -#endif /* not HAVE_LOCALE_T */ +#endif /* not HAVE_LOCALE_T */ } else if (collform->collprovider == COLLPROVIDER_ICU) { @@ -1369,7 +1369,7 @@ pg_newlocale_from_collation(Oid collid) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("ICU is not supported in this build"), \ errhint("You need to rebuild PostgreSQL using --with-icu."))); -#endif /* not USE_ICU */ +#endif /* not USE_ICU */ } collversion = SysCacheGetAttr(COLLOID, tp, Anum_pg_collation_collversion, @@ -1569,7 +1569,7 @@ wchar2char(char *to, const wchar_t *from, size_t tolen, pg_locale_t locale) } } else -#endif /* WIN32 */ +#endif /* WIN32 */ if (locale == (pg_locale_t) 0) { /* Use wcstombs directly for the default locale */ @@ -1588,12 +1588,12 @@ wchar2char(char *to, const wchar_t *from, size_t tolen, pg_locale_t locale) result = wcstombs(to, from, tolen); uselocale(save_locale); -#endif /* HAVE_WCSTOMBS_L */ +#endif /* HAVE_WCSTOMBS_L */ #else /* !HAVE_LOCALE_T */ /* Can't have locale != 0 without HAVE_LOCALE_T */ elog(ERROR, "wcstombs_l is not available"); result = 0; /* keep compiler quiet */ -#endif /* HAVE_LOCALE_T */ +#endif /* HAVE_LOCALE_T */ } return result; @@ -1642,7 +1642,7 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, } } else -#endif /* WIN32 */ +#endif /* WIN32 */ { /* mbstowcs requires ending '\0' */ char *str = pnstrdup(from, fromlen); @@ -1665,12 +1665,12 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, result = mbstowcs(to, str, tolen); uselocale(save_locale); -#endif /* HAVE_MBSTOWCS_L */ +#endif /* HAVE_MBSTOWCS_L */ #else /* !HAVE_LOCALE_T */ /* Can't have locale != 0 without HAVE_LOCALE_T */ elog(ERROR, "mbstowcs_l is not available"); result = 0; /* keep compiler quiet */ -#endif /* HAVE_LOCALE_T */ +#endif /* HAVE_LOCALE_T */ } pfree(str); @@ -1697,4 +1697,4 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, return result; } -#endif /* USE_WIDE_UPPER_LOWER */ +#endif /* USE_WIDE_UPPER_LOWER */ diff --git a/src/backend/utils/adt/rangetypes_gist.c b/src/backend/utils/adt/rangetypes_gist.c index f81b16c236..a1f4f4d372 100644 --- a/src/backend/utils/adt/rangetypes_gist.c +++ b/src/backend/utils/adt/rangetypes_gist.c @@ -70,7 +70,7 @@ typedef enum typedef struct { TypeCacheEntry *typcache; /* typcache for range type */ - bool has_subtype_diff; /* does it have subtype_diff? */ + bool has_subtype_diff; /* does it have subtype_diff? */ int entries_count; /* total number of entries being split */ /* Information about currently selected split follows */ diff --git a/src/backend/utils/adt/rangetypes_selfuncs.c b/src/backend/utils/adt/rangetypes_selfuncs.c index c4c549658d..e803f72924 100644 --- a/src/backend/utils/adt/rangetypes_selfuncs.c +++ b/src/backend/utils/adt/rangetypes_selfuncs.c @@ -251,7 +251,7 @@ calc_rangesel(TypeCacheEntry *typcache, VariableStatData *vardata, ATTSTATSSLOT_NUMBERS)) { if (sslot.nnumbers != 1) - elog(ERROR, "invalid empty fraction statistic"); /* shouldn't happen */ + elog(ERROR, "invalid empty fraction statistic"); /* shouldn't happen */ empty_frac = sslot.numbers[0]; free_attstatsslot(&sslot); } diff --git a/src/backend/utils/adt/rangetypes_typanalyze.c b/src/backend/utils/adt/rangetypes_typanalyze.c index a8d585ce7a..879540fc1a 100644 --- a/src/backend/utils/adt/rangetypes_typanalyze.c +++ b/src/backend/utils/adt/rangetypes_typanalyze.c @@ -347,7 +347,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, stats->stats_valid = true; stats->stanullfrac = 1.0; stats->stawidth = 0; /* "unknown" */ - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index 37139f9647..1c02f143ba 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -119,14 +119,11 @@ typedef struct RI_ConstraintInfo char confdeltype; /* foreign key's ON DELETE action */ char confmatchtype; /* foreign key's match type */ int nkeys; /* number of key columns */ - int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */ - int16 fk_attnums[RI_MAX_NUMKEYS]; /* attnums of referencing cols */ - Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = - * FK) */ - Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = - * PK) */ - Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK = - * FK) */ + int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */ + int16 fk_attnums[RI_MAX_NUMKEYS]; /* attnums of referencing cols */ + Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = FK) */ + Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = PK) */ + Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK = FK) */ dlist_node valid_link; /* Link in list of valid entries */ } RI_ConstraintInfo; @@ -579,7 +576,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel, result = ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* treat like update */ + true, /* treat like update */ SPI_OK_SELECT); if (SPI_finish() != SPI_OK_FINISH) @@ -771,7 +768,7 @@ ri_restrict_del(TriggerData *trigdata, bool is_no_action) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_SELECT); if (SPI_finish() != SPI_OK_FINISH) @@ -994,7 +991,7 @@ ri_restrict_upd(TriggerData *trigdata, bool is_no_action) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_SELECT); if (SPI_finish() != SPI_OK_FINISH) @@ -1150,7 +1147,7 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_DELETE); if (SPI_finish() != SPI_OK_FINISH) @@ -1331,7 +1328,7 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, new_row, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -1496,7 +1493,7 @@ RI_FKey_setnull_del(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -1672,7 +1669,7 @@ RI_FKey_setnull_upd(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -1838,7 +1835,7 @@ RI_FKey_setdefault_del(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -2029,7 +2026,7 @@ RI_FKey_setdefault_upd(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, old_row, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -3111,7 +3108,7 @@ ri_PerformCheck(const RI_ConstraintInfo *riinfo, */ if (IsolationUsesXactSnapshot() && detectNewRows) { - CommandCounterIncrement(); /* be sure all my own work is visible */ + CommandCounterIncrement(); /* be sure all my own work is visible */ test_snapshot = GetLatestSnapshot(); crosscheck_snapshot = GetTransactionSnapshot(); } @@ -3584,11 +3581,11 @@ ri_AttributesEqual(Oid eq_opr, Oid typeid, { oldvalue = FunctionCall3(&entry->cast_func_finfo, oldvalue, - Int32GetDatum(-1), /* typmod */ + Int32GetDatum(-1), /* typmod */ BoolGetDatum(false)); /* implicit coercion */ newvalue = FunctionCall3(&entry->cast_func_finfo, newvalue, - Int32GetDatum(-1), /* typmod */ + Int32GetDatum(-1), /* typmod */ BoolGetDatum(false)); /* implicit coercion */ } @@ -3663,7 +3660,7 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid) op_input_types(eq_opr, &lefttype, &righttype); Assert(lefttype == righttype); if (typeid == lefttype) - castfunc = InvalidOid; /* simplest case */ + castfunc = InvalidOid; /* simplest case */ else { pathtype = find_coercion_pathway(lefttype, typeid, diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 5f3f7968d5..b8ad47a20c 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -83,7 +83,7 @@ #define PRETTYINDENT_JOIN 4 #define PRETTYINDENT_VAR 4 -#define PRETTYINDENT_LIMIT 40 /* wrap limit */ +#define PRETTYINDENT_LIMIT 40 /* wrap limit */ /* Pretty flags */ #define PRETTYFLAG_PAREN 1 @@ -113,8 +113,8 @@ typedef struct int wrapColumn; /* max line length, or -1 for no limit */ int indentLevel; /* current indent level for prettyprint */ bool varprefix; /* TRUE to print prefixes on Vars */ - ParseExprKind special_exprkind; /* set only for exprkinds needing - * special handling */ + ParseExprKind special_exprkind; /* set only for exprkinds needing special + * handling */ } deparse_context; /* @@ -280,7 +280,7 @@ typedef struct */ typedef struct { - char name[NAMEDATALEN]; /* Hash key --- must be first */ + char name[NAMEDATALEN]; /* Hash key --- must be first */ int counter; /* Largest addition used so far for name */ } NameHashEntry; @@ -2566,7 +2566,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS) if (!isnull) { simple_quote_literal(&buf, TextDatumGetCString(tmp)); - appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */ + appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */ } tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull); @@ -7376,14 +7376,14 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags) } case T_BoolExpr: /* lower precedence */ case T_ArrayRef: /* other separators */ - case T_ArrayExpr: /* other separators */ + case T_ArrayExpr: /* other separators */ case T_RowExpr: /* other separators */ case T_CoalesceExpr: /* own parentheses */ - case T_MinMaxExpr: /* own parentheses */ + case T_MinMaxExpr: /* own parentheses */ case T_XmlExpr: /* own parentheses */ - case T_NullIfExpr: /* other separators */ + case T_NullIfExpr: /* other separators */ case T_Aggref: /* own parentheses */ - case T_WindowFunc: /* own parentheses */ + case T_WindowFunc: /* own parentheses */ case T_CaseExpr: /* other separators */ return true; default: @@ -7426,14 +7426,14 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags) return true; /* own parentheses */ } case T_ArrayRef: /* other separators */ - case T_ArrayExpr: /* other separators */ + case T_ArrayExpr: /* other separators */ case T_RowExpr: /* other separators */ case T_CoalesceExpr: /* own parentheses */ - case T_MinMaxExpr: /* own parentheses */ + case T_MinMaxExpr: /* own parentheses */ case T_XmlExpr: /* own parentheses */ - case T_NullIfExpr: /* other separators */ + case T_NullIfExpr: /* other separators */ case T_Aggref: /* own parentheses */ - case T_WindowFunc: /* own parentheses */ + case T_WindowFunc: /* own parentheses */ case T_CaseExpr: /* other separators */ return true; default: @@ -9219,7 +9219,7 @@ get_const_expr(Const *constval, deparse_context *context, int showtype) else { appendStringInfo(buf, "'%s'", extval); - needlabel = true; /* we must attach a cast */ + needlabel = true; /* we must attach a cast */ } break; @@ -9238,7 +9238,7 @@ get_const_expr(Const *constval, deparse_context *context, int showtype) else { appendStringInfo(buf, "'%s'", extval); - needlabel = true; /* we must attach a cast */ + needlabel = true; /* we must attach a cast */ } break; @@ -9432,7 +9432,7 @@ get_sublink_expr(SubLink *sublink, deparse_context *context) break; case ANY_SUBLINK: - if (strcmp(opname, "=") == 0) /* Represent = ANY as IN */ + if (strcmp(opname, "=") == 0) /* Represent = ANY as IN */ appendStringInfoString(buf, " IN "); else appendStringInfo(buf, " %s ANY ", opname); diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 33788a2b36..63a25db5d3 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -811,7 +811,7 @@ ineq_histogram_selectivity(PlannerInfo *root, */ double histfrac; int lobound = 0; /* first possible slot to search */ - int hibound = sslot.nvalues; /* last+1 slot to search */ + int hibound = sslot.nvalues; /* last+1 slot to search */ bool have_end = false; /* @@ -1805,7 +1805,7 @@ scalararraysel(PlannerInfo *root, /* get nominal (after relabeling) element type of rightop */ nominal_element_type = get_base_element_type(exprType(rightop)); if (!OidIsValid(nominal_element_type)) - return (Selectivity) 0.5; /* probably shouldn't happen */ + return (Selectivity) 0.5; /* probably shouldn't happen */ /* get nominal collation, too, for generating constants */ nominal_element_collation = exprCollation(rightop); @@ -4510,10 +4510,10 @@ get_join_variables(PlannerInfo *root, List *args, SpecialJoinInfo *sjinfo, if (vardata1->rel && bms_is_subset(vardata1->rel->relids, sjinfo->syn_righthand)) - *join_is_reversed = true; /* var1 is on RHS */ + *join_is_reversed = true; /* var1 is on RHS */ else if (vardata2->rel && bms_is_subset(vardata2->rel->relids, sjinfo->syn_lefthand)) - *join_is_reversed = true; /* var2 is on LHS */ + *join_is_reversed = true; /* var2 is on LHS */ else *join_is_reversed = false; } @@ -5331,7 +5331,7 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata, ScanKeyEntryInitialize(&scankeys[0], SK_ISNULL | SK_SEARCHNOTNULL, 1, /* index col to scan */ - InvalidStrategy, /* no strategy */ + InvalidStrategy, /* no strategy */ InvalidOid, /* no strategy subtype */ InvalidOid, /* no collation */ InvalidOid, /* no reg proc for this */ @@ -5725,7 +5725,7 @@ pattern_fixed_prefix(Const *patt, Pattern_Type ptype, Oid collation, break; default: elog(ERROR, "unrecognized ptype: %d", (int) ptype); - result = Pattern_Prefix_None; /* keep compiler quiet */ + result = Pattern_Prefix_None; /* keep compiler quiet */ break; } return result; @@ -5931,8 +5931,7 @@ regex_selectivity_sub(const char *patt, int pattlen, bool case_insensitive) negclass = true; pos++; } - if (patt[pos] == ']') /* ']' at start of class is not - * special */ + if (patt[pos] == ']') /* ']' at start of class is not special */ pos++; while (pos < pattlen && patt[pos] != ']') pos++; @@ -6430,7 +6429,7 @@ orderby_operands_eval_cost(PlannerInfo *root, IndexPath *path) { elog(ERROR, "unsupported indexorderby type: %d", (int) nodeTag(clause)); - other_operand = NULL; /* keep compiler quiet */ + other_operand = NULL; /* keep compiler quiet */ } cost_qual_eval_node(&index_qual_cost, other_operand, root); diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index 41e1ecd70f..53e36afbe8 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -234,8 +234,8 @@ gettoken_query(TSQueryParserState state, case WAITOPERAND: if (t_iseq(state->buf, '!')) { - (state->buf)++; /* can safely ++, t_iseq guarantee - * that pg_mblen()==1 */ + (state->buf)++; /* can safely ++, t_iseq guarantee that + * pg_mblen()==1 */ *operator = OP_NOT; state->state = WAITOPERAND; return PT_OPR; @@ -542,7 +542,7 @@ findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes, bool *needcleanup) if (ptr[*pos].qoperator.oper == OP_NOT) { - ptr[*pos].qoperator.left = 1; /* fixed offset */ + ptr[*pos].qoperator.left = 1; /* fixed offset */ (*pos)++; /* process the only argument */ @@ -551,7 +551,7 @@ findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes, bool *needcleanup) else { QueryOperator *curitem = &ptr[*pos].qoperator; - int tmp = *pos; /* save current position */ + int tmp = *pos; /* save current position */ Assert(curitem->oper == OP_AND || curitem->oper == OP_OR || @@ -1056,7 +1056,7 @@ tsqueryrecv(PG_FUNCTION_ARGS) */ operands[i] = val; - datalen += val_len + 1; /* + 1 for the '\0' terminator */ + datalen += val_len + 1; /* + 1 for the '\0' terminator */ } else if (item->type == QI_OPR) { diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index a41eb1fa9c..4577bcc0b8 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -908,8 +908,8 @@ calc_rank_cd(const float4 *arrdata, TSVector txt, TSQuery query, int method) Wdoc += Cpos / ((double) (1 + nNoise)); CurExtPos = ((double) (ext.q + ext.p)) / 2.0; - if (NExtent > 0 && CurExtPos > PrevExtPos /* prevent division by - * zero in a case of + if (NExtent > 0 && CurExtPos > PrevExtPos /* prevent division by + * zero in a case of * multiple lexize */ ) SumDist += 1.0 / (CurExtPos - PrevExtPos); diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index 89aa0f1b32..66c5255f8b 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -2466,7 +2466,7 @@ tsvector_update_trigger(PG_FUNCTION_ARGS, bool config_column) Oid cfgId; /* Check call context */ - if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ + if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ elog(ERROR, "tsvector_update_trigger: not fired by trigger manager"); trigdata = (TriggerData *) fcinfo->context; diff --git a/src/backend/utils/adt/varbit.c b/src/backend/utils/adt/varbit.c index e947785d81..41238dd763 100644 --- a/src/backend/utils/adt/varbit.c +++ b/src/backend/utils/adt/varbit.c @@ -1131,8 +1131,8 @@ bitoverlay(PG_FUNCTION_ARGS) { VarBit *t1 = PG_GETARG_VARBIT_P(0); VarBit *t2 = PG_GETARG_VARBIT_P(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ - int sl = PG_GETARG_INT32(3); /* substring length */ + int sp = PG_GETARG_INT32(2); /* substring start position */ + int sl = PG_GETARG_INT32(3); /* substring length */ PG_RETURN_VARBIT_P(bit_overlay(t1, t2, sp, sl)); } @@ -1142,7 +1142,7 @@ bitoverlay_no_len(PG_FUNCTION_ARGS) { VarBit *t1 = PG_GETARG_VARBIT_P(0); VarBit *t2 = PG_GETARG_VARBIT_P(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ + int sp = PG_GETARG_INT32(2); /* substring start position */ int sl; sl = VARBITLEN(t2); /* defaults to length(t2) */ diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index cb1fd4d9ce..be53f7d60d 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -268,7 +268,7 @@ byteain(PG_FUNCTION_ARGS) bc = (len - 2) / 2 + VARHDRSZ; /* maximum possible length */ result = palloc(bc); bc = hex_decode(inputText + 2, len - 2, VARDATA(result)); - SET_VARSIZE(result, bc + VARHDRSZ); /* actual length */ + SET_VARSIZE(result, bc + VARHDRSZ); /* actual length */ PG_RETURN_BYTEA_P(result); } @@ -823,8 +823,8 @@ text_substring(Datum str, int32 start, int32 length, bool length_not_specified) { S1 = Max(S, 1); - if (length_not_specified) /* special case - get length to end of - * string */ + if (length_not_specified) /* special case - get length to end of + * string */ L1 = -1; else { @@ -888,8 +888,8 @@ text_substring(Datum str, int32 start, int32 length, bool length_not_specified) */ slice_start = 0; - if (length_not_specified) /* special case - get length to end of - * string */ + if (length_not_specified) /* special case - get length to end of + * string */ slice_size = L1 = -1; else { @@ -1012,8 +1012,8 @@ textoverlay(PG_FUNCTION_ARGS) { text *t1 = PG_GETARG_TEXT_PP(0); text *t2 = PG_GETARG_TEXT_PP(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ - int sl = PG_GETARG_INT32(3); /* substring length */ + int sp = PG_GETARG_INT32(2); /* substring start position */ + int sl = PG_GETARG_INT32(3); /* substring length */ PG_RETURN_TEXT_P(text_overlay(t1, t2, sp, sl)); } @@ -1023,10 +1023,10 @@ textoverlay_no_len(PG_FUNCTION_ARGS) { text *t1 = PG_GETARG_TEXT_PP(0); text *t2 = PG_GETARG_TEXT_PP(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ + int sp = PG_GETARG_INT32(2); /* substring start position */ int sl; - sl = text_length(PointerGetDatum(t2)); /* defaults to length(t2) */ + sl = text_length(PointerGetDatum(t2)); /* defaults to length(t2) */ PG_RETURN_TEXT_P(text_overlay(t1, t2, sp, sl)); } @@ -1520,7 +1520,7 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid) return result; } -#endif /* WIN32 */ +#endif /* WIN32 */ if (len1 >= TEXTBUFLEN) a1p = (char *) palloc(len1 + 1); @@ -1573,7 +1573,7 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid) #else /* not USE_ICU */ /* shouldn't happen */ elog(ERROR, "unsupported collprovider: %c", mylocale->provider); -#endif /* not USE_ICU */ +#endif /* not USE_ICU */ } else { @@ -2159,7 +2159,7 @@ varstrfastcmp_locale(Datum x, Datum y, SortSupport ssup) #else /* not USE_ICU */ /* shouldn't happen */ elog(ERROR, "unsupported collprovider: %c", sss->locale->provider); -#endif /* not USE_ICU */ +#endif /* not USE_ICU */ } else { @@ -2899,8 +2899,8 @@ byteaoverlay(PG_FUNCTION_ARGS) { bytea *t1 = PG_GETARG_BYTEA_PP(0); bytea *t2 = PG_GETARG_BYTEA_PP(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ - int sl = PG_GETARG_INT32(3); /* substring length */ + int sp = PG_GETARG_INT32(2); /* substring start position */ + int sl = PG_GETARG_INT32(3); /* substring length */ PG_RETURN_BYTEA_P(bytea_overlay(t1, t2, sp, sl)); } @@ -2910,7 +2910,7 @@ byteaoverlay_no_len(PG_FUNCTION_ARGS) { bytea *t1 = PG_GETARG_BYTEA_PP(0); bytea *t2 = PG_GETARG_BYTEA_PP(1); - int sp = PG_GETARG_INT32(2); /* substring start position */ + int sp = PG_GETARG_INT32(2); /* substring start position */ int sl; sl = VARSIZE_ANY_EXHDR(t2); /* defaults to length(t2) */ @@ -3273,7 +3273,7 @@ SplitIdentifierString(char *rawstring, char separator, { endp = strchr(nextp + 1, '"'); if (endp == NULL) - return false; /* mismatched quotes */ + return false; /* mismatched quotes */ if (endp[1] != '"') break; /* found end of quoted name */ /* Collapse adjacent quotes into one quote, and look again */ @@ -3400,7 +3400,7 @@ SplitDirectoriesString(char *rawstring, char separator, { endp = strchr(nextp + 1, '"'); if (endp == NULL) - return false; /* mismatched quotes */ + return false; /* mismatched quotes */ if (endp[1] != '"') break; /* found end of quoted name */ /* Collapse adjacent quotes into one quote, and look again */ @@ -3932,7 +3932,7 @@ replace_text_regexp(text *src_text, void *regexp, data, data_len, search_start, - NULL, /* no details */ + NULL, /* no details */ REGEXP_REPLACE_BACKREF_CNT, pmatch, 0); @@ -4251,7 +4251,7 @@ text_to_array_internal(PG_FUNCTION_ARGS) /* start_ptr points to the start_posn'th character of inputstring */ start_ptr = VARDATA_ANY(inputstring); - for (fldnum = 1;; fldnum++) /* field number is 1 based */ + for (fldnum = 1;; fldnum++) /* field number is 1 based */ { CHECK_FOR_INTERRUPTS(); @@ -4695,7 +4695,7 @@ string_agg_transfn(PG_FUNCTION_ARGS) else if (!PG_ARGISNULL(2)) appendStringInfoText(state, PG_GETARG_TEXT_PP(2)); /* delimiter */ - appendStringInfoText(state, PG_GETARG_TEXT_PP(1)); /* value */ + appendStringInfoText(state, PG_GETARG_TEXT_PP(1)); /* value */ } /* diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index cdcd45419a..0ed679eea6 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -65,7 +65,7 @@ #if LIBXML_VERSION >= 20704 #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 #endif -#endif /* USE_LIBXML */ +#endif /* USE_LIBXML */ #include "access/htup_details.h" #include "catalog/namespace.h" @@ -133,7 +133,7 @@ static void *xml_palloc(size_t size); static void *xml_repalloc(void *ptr, size_t size); static void xml_pfree(void *ptr); static char *xml_pstrdup(const char *string); -#endif /* USE_LIBXMLCONTEXT */ +#endif /* USE_LIBXMLCONTEXT */ static xmlChar *xml_text2xmlChar(text *in); static int parse_xml_decl(const xmlChar *str, size_t *lenp, @@ -147,7 +147,7 @@ static int xml_xpathobjtoxmlarray(xmlXPathObjectPtr xpathobj, ArrayBuildState *astate, PgXmlErrorContext *xmlerrcxt); static xmlChar *pg_xmlCharStrndup(char *str, size_t len); -#endif /* USE_LIBXML */ +#endif /* USE_LIBXML */ static void xmldata_root_element_start(StringInfo result, const char *eltname, const char *xmlschema, const char *targetns, @@ -924,7 +924,7 @@ xml_is_document(xmltype *arg) #else /* not USE_LIBXML */ NO_XML_SUPPORT(); return false; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } @@ -1405,7 +1405,7 @@ xml_parse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace, volatile xmlParserCtxtPtr ctxt = NULL; volatile xmlDocPtr doc = NULL; - len = VARSIZE_ANY_EXHDR(data); /* will be useful later */ + len = VARSIZE_ANY_EXHDR(data); /* will be useful later */ string = xml_text2xmlChar(data); utf8string = pg_do_encoding_conversion(string, @@ -1555,7 +1555,7 @@ xml_pstrdup(const char *string) { return MemoryContextStrdup(LibxmlContext, string); } -#endif /* USE_LIBXMLCONTEXT */ +#endif /* USE_LIBXMLCONTEXT */ /* @@ -1887,7 +1887,7 @@ is_valid_xml_namechar(pg_wchar c) || xmlIsCombiningQ(c) || xmlIsExtenderQ(c)); } -#endif /* USE_LIBXML */ +#endif /* USE_LIBXML */ /* @@ -1942,7 +1942,7 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, #else /* not USE_LIBXML */ NO_XML_SUPPORT(); return NULL; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } @@ -2201,7 +2201,7 @@ map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings) return result; } -#endif /* USE_LIBXML */ +#endif /* USE_LIBXML */ } @@ -3942,7 +3942,7 @@ xpath_internal(text *xpath_expr_text, xmltype *data, ArrayType *namespaces, if (xmlXPathRegisterNs(xpathctx, (xmlChar *) ns_name, (xmlChar *) ns_uri) != 0) - ereport(ERROR, /* is this an internal error??? */ + ereport(ERROR, /* is this an internal error??? */ (errmsg("could not register XML namespace with name \"%s\" and URI \"%s\"", ns_name, ns_uri))); } @@ -4000,7 +4000,7 @@ xpath_internal(text *xpath_expr_text, xmltype *data, ArrayType *namespaces, pg_xml_done(xmlerrcxt, false); } -#endif /* USE_LIBXML */ +#endif /* USE_LIBXML */ /* * Evaluate XPath expression and return array of XML values. @@ -4115,7 +4115,7 @@ xml_is_well_formed(PG_FUNCTION_ARGS) #else NO_XML_SUPPORT(); return 0; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } Datum @@ -4128,7 +4128,7 @@ xml_is_well_formed_document(PG_FUNCTION_ARGS) #else NO_XML_SUPPORT(); return 0; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } Datum @@ -4141,7 +4141,7 @@ xml_is_well_formed_content(PG_FUNCTION_ARGS) #else NO_XML_SUPPORT(); return 0; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4221,7 +4221,7 @@ XmlTableInitOpaque(TableFuncScanState *state, int natts) state->opaque = xtCxt; #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4281,7 +4281,7 @@ XmlTableSetDocument(TableFuncScanState *state, Datum value) xtCxt->xpathcxt = xpathcxt; #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4307,7 +4307,7 @@ XmlTableSetNamespace(TableFuncScanState *state, char *name, char *uri) "could not set XML namespace"); #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4336,7 +4336,7 @@ XmlTableSetRowFilter(TableFuncScanState *state, char *path) "invalid XPath expression"); #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4367,7 +4367,7 @@ XmlTableSetColumnFilter(TableFuncScanState *state, char *path, int colnum) "invalid XPath expression"); #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4415,7 +4415,7 @@ XmlTableFetchRow(TableFuncScanState *state) #else NO_XML_SUPPORT(); return false; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4585,7 +4585,7 @@ XmlTableGetValue(TableFuncScanState *state, int colnum, #else NO_XML_SUPPORT(); return 0; -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } /* @@ -4631,5 +4631,5 @@ XmlTableDestroyOpaque(TableFuncScanState *state) #else NO_XML_SUPPORT(); -#endif /* not USE_LIBXML */ +#endif /* not USE_LIBXML */ } diff --git a/src/backend/utils/cache/attoptcache.c b/src/backend/utils/cache/attoptcache.c index 4b30e6bc62..da8b42ddb8 100644 --- a/src/backend/utils/cache/attoptcache.c +++ b/src/backend/utils/cache/attoptcache.c @@ -111,8 +111,7 @@ get_attribute_options(Oid attrelid, int attnum) /* Find existing cache entry, if any. */ if (!AttoptCacheHash) InitializeAttoptCache(); - memset(&key, 0, sizeof(key)); /* make sure any padding bits are - * unset */ + memset(&key, 0, sizeof(key)); /* make sure any padding bits are unset */ key.attrelid = attrelid; key.attnum = attnum; attopt = diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 74bfd56169..e7e8e3b54c 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -339,7 +339,7 @@ CatCachePrintStats(int code, Datum arg) cc_lsearches, cc_lhits); } -#endif /* CATCACHE_STATS */ +#endif /* CATCACHE_STATS */ /* diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 055705136a..5652c3abe0 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -121,7 +121,7 @@ */ typedef struct InvalidationChunk { - struct InvalidationChunk *next; /* list link */ + struct InvalidationChunk *next; /* list link */ int nitems; /* # items currently stored in chunk */ int maxitems; /* size of allocated array in this chunk */ SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER]; diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 4def73ddfb..82763f8013 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -2770,7 +2770,7 @@ get_typmodout(Oid typid) else return InvalidOid; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* * get_typcollation diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 4b5f8107ef..dfe5592a25 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -157,7 +157,7 @@ CreateCachedPlan(RawStmt *raw_parse_tree, MemoryContext source_context; MemoryContext oldcxt; - Assert(query_string != NULL); /* required as of 8.4 */ + Assert(query_string != NULL); /* required as of 8.4 */ /* * Make a dedicated memory context for the CachedPlanSource and its @@ -238,7 +238,7 @@ CreateOneShotCachedPlan(RawStmt *raw_parse_tree, { CachedPlanSource *plansource; - Assert(query_string != NULL); /* required as of 8.4 */ + Assert(query_string != NULL); /* required as of 8.4 */ /* * Create and fill the CachedPlanSource struct within the caller's memory diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index c2e8361f2f..93bcac1e77 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1371,7 +1371,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) /* * initialize the relation lock manager information */ - RelationInitLockInfo(relation); /* see lmgr.c */ + RelationInitLockInfo(relation); /* see lmgr.c */ /* * initialize physical addressing information for the relation @@ -2011,7 +2011,7 @@ formrdesc(const char *relationName, Oid relationReltype, /* * initialize the relation lock manager information */ - RelationInitLockInfo(relation); /* see lmgr.c */ + RelationInitLockInfo(relation); /* see lmgr.c */ /* * initialize physical addressing information for the relation @@ -2423,7 +2423,7 @@ RelationClearRelation(Relation relation, bool rebuild) if (relation->rd_rel->relkind == RELKIND_INDEX) { - relation->rd_isvalid = false; /* needs to be revalidated */ + relation->rd_isvalid = false; /* needs to be revalidated */ if (relation->rd_refcnt > 1 && IsTransactionState()) RelationReloadIndexInfo(relation); } @@ -3657,7 +3657,7 @@ RelationCacheInitializePhase3(void) formrdesc("pg_type", TypeRelation_Rowtype_Id, false, true, Natts_pg_type, Desc_pg_type); -#define NUM_CRITICAL_LOCAL_RELS 4 /* fix if you change list above */ +#define NUM_CRITICAL_LOCAL_RELS 4 /* fix if you change list above */ } MemoryContextSwitchTo(oldcxt); @@ -3960,7 +3960,7 @@ BuildHardcodedDescriptor(int natts, const FormData_pg_attribute *attrs, oldcxt = MemoryContextSwitchTo(CacheMemoryContext); result = CreateTemplateTupleDesc(natts, hasoids); - result->tdtypeid = RECORDOID; /* not right, but we don't care */ + result->tdtypeid = RECORDOID; /* not right, but we don't care */ result->tdtypmod = -1; for (i = 0; i < natts; i++) @@ -4239,7 +4239,7 @@ RelationGetFKeyList(Relation relation) elog(ERROR, "null conkey for rel %s", RelationGetRelationName(relation)); - arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ + arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ nelem = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || nelem < 1 || @@ -4258,7 +4258,7 @@ RelationGetFKeyList(Relation relation) elog(ERROR, "null confkey for rel %s", RelationGetRelationName(relation)); - arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ + arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ nelem = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || nelem != info->nkeys || @@ -4275,7 +4275,7 @@ RelationGetFKeyList(Relation relation) elog(ERROR, "null conpfeqop for rel %s", RelationGetRelationName(relation)); - arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ + arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ nelem = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || nelem != info->nkeys || @@ -5448,7 +5448,7 @@ load_relcache_init_file(bool shared) rel->rd_att->tdrefcount = 1; /* mark as refcounted */ rel->rd_att->tdtypeid = relform->reltype; - rel->rd_att->tdtypmod = -1; /* unnecessary, but... */ + rel->rd_att->tdtypmod = -1; /* unnecessary, but... */ /* next read all the attribute tuple form data entries */ has_not_null = false; @@ -5473,7 +5473,7 @@ load_relcache_init_file(bool shared) if (fread(rel->rd_options, 1, len, fp) != len) goto read_failed; if (len != VARSIZE(rel->rd_options)) - goto read_failed; /* sanity check */ + goto read_failed; /* sanity check */ } else { diff --git a/src/backend/utils/cache/relfilenodemap.c b/src/backend/utils/cache/relfilenodemap.c index 612f0f3a0d..3e811e1c9b 100644 --- a/src/backend/utils/cache/relfilenodemap.c +++ b/src/backend/utils/cache/relfilenodemap.c @@ -68,9 +68,9 @@ RelfilenodeMapInvalidateCallback(Datum arg, Oid relid) * all entries, otherwise just remove the specific relation's entry. * Always remove negative cache entries. */ - if (relid == InvalidOid || /* complete reset */ - entry->relid == InvalidOid || /* negative cache entry */ - entry->relid == relid) /* individual flushed relation */ + if (relid == InvalidOid || /* complete reset */ + entry->relid == InvalidOid || /* negative cache entry */ + entry->relid == relid) /* individual flushed relation */ { if (hash_search(RelfilenodeMapHash, (void *) &entry->key, diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c index 047c5b40e8..6836c601e0 100644 --- a/src/backend/utils/cache/relmapper.c +++ b/src/backend/utils/cache/relmapper.c @@ -72,9 +72,9 @@ */ #define RELMAPPER_FILENAME "pg_filenode.map" -#define RELMAPPER_FILEMAGIC 0x592717 /* version ID value */ +#define RELMAPPER_FILEMAGIC 0x592717 /* version ID value */ -#define MAX_MAPPINGS 62 /* 62 * 8 + 16 = 512 */ +#define MAX_MAPPINGS 62 /* 62 * 8 + 16 = 512 */ typedef struct RelMapping { diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index e66bb03ea5..607fe9db79 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -419,7 +419,7 @@ static const struct cachedesc cacheinfo[] = { }, 8 }, - {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */ + {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */ ForeignDataWrapperNameIndexId, 1, { @@ -430,7 +430,7 @@ static const struct cachedesc cacheinfo[] = { }, 2 }, - {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */ + {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */ ForeignDataWrapperOidIndexId, 1, { @@ -683,7 +683,7 @@ static const struct cachedesc cacheinfo[] = { }, 128 }, - {ReplicationOriginRelationId, /* REPLORIGIDENT */ + {ReplicationOriginRelationId, /* REPLORIGIDENT */ ReplicationOriginIdentIndex, 1, { @@ -694,7 +694,7 @@ static const struct cachedesc cacheinfo[] = { }, 16 }, - {ReplicationOriginRelationId, /* REPLORIGNAME */ + {ReplicationOriginRelationId, /* REPLORIGNAME */ ReplicationOriginNameIndex, 1, { diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 6ba199b40d..7ec31eb3e3 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -152,7 +152,7 @@ static HTAB *RecordCacheHash = NULL; static TupleDesc *RecordCacheArray = NULL; static int32 RecordCacheArrayLen = 0; /* allocated length of array */ -static int32 NextRecordTypmod = 0; /* number of entries used */ +static int32 NextRecordTypmod = 0; /* number of entries used */ static void load_typcache_tupdesc(TypeCacheEntry *typentry); static void load_rangetype_info(TypeCacheEntry *typentry); @@ -572,7 +572,7 @@ load_typcache_tupdesc(TypeCacheEntry *typentry) { Relation rel; - if (!OidIsValid(typentry->typrelid)) /* should not happen */ + if (!OidIsValid(typentry->typrelid)) /* should not happen */ elog(ERROR, "invalid typrelid for composite type %u", typentry->type_id); rel = relation_open(typentry->typrelid, AccessShareLock); diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index cad75c80d8..234c8e3aa9 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -102,7 +102,7 @@ emit_log_hook_type emit_log_hook = NULL; /* GUC parameters */ int Log_error_verbosity = PGERROR_VERBOSE; -char *Log_line_prefix = NULL; /* format for extra log line info */ +char *Log_line_prefix = NULL; /* format for extra log line info */ int Log_destination = LOG_DESTINATION_STDERR; char *Log_destination_string = NULL; bool syslog_sequence_numbers = true; @@ -356,7 +356,7 @@ errstart(int elevel, const char *filename, int lineno, * because it suggests an infinite loop of errors during error * recovery. */ - errordata_stack_depth = -1; /* make room on stack */ + errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } @@ -1317,7 +1317,7 @@ elog_start(const char *filename, int lineno, const char *funcname) * else failure to convert it to client encoding could cause further * recursion. */ - errordata_stack_depth = -1; /* make room on stack */ + errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } @@ -1684,7 +1684,7 @@ ReThrowError(ErrorData *edata) * because it suggests an infinite loop of errors during error * recovery. */ - errordata_stack_depth = -1; /* make room on stack */ + errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } @@ -1810,7 +1810,7 @@ GetErrorContextStack(void) * because it suggests an infinite loop of errors during error * recovery. */ - errordata_stack_depth = -1; /* make room on stack */ + errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } @@ -2047,7 +2047,7 @@ write_syslog(int level, const char *line) syslog(level, "%s", line); } } -#endif /* HAVE_SYSLOG */ +#endif /* HAVE_SYSLOG */ #ifdef WIN32 /* @@ -2151,7 +2151,7 @@ write_eventlog(int level, const char *line, int len) &line, NULL); } -#endif /* WIN32 */ +#endif /* WIN32 */ static void write_console(const char *line, int len) @@ -2997,7 +2997,7 @@ send_message_to_server_log(ErrorData *edata) write_syslog(syslog_level, buf.data); } -#endif /* HAVE_SYSLOG */ +#endif /* HAVE_SYSLOG */ #ifdef WIN32 /* Write to eventlog, if enabled */ @@ -3005,7 +3005,7 @@ send_message_to_server_log(ErrorData *edata) { write_eventlog(edata->elevel, buf.data, buf.len); } -#endif /* WIN32 */ +#endif /* WIN32 */ /* Write to stderr, if enabled */ if ((Log_destination & LOG_DESTINATION_STDERR) || whereToSendOutput == DestDebug) @@ -3273,7 +3273,7 @@ send_message_to_frontend(ErrorData *edata) err_sendstring(&msgbuf, edata->funcname); } - pq_sendbyte(&msgbuf, '\0'); /* terminator */ + pq_sendbyte(&msgbuf, '\0'); /* terminator */ } else { diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index bfd1b11850..0783145a16 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -48,7 +48,7 @@ typedef struct df_files ino_t inode; /* Inode number of file */ #endif void *handle; /* a handle for pg_dl* functions */ - char filename[FLEXIBLE_ARRAY_MEMBER]; /* Full pathname of file */ + char filename[FLEXIBLE_ARRAY_MEMBER]; /* Full pathname of file */ } DynamicFileList; static DynamicFileList *file_list = NULL; @@ -448,7 +448,7 @@ internal_unload_library(const char *libname) else prv = file_scanner; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ } static bool diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index 0382c158c5..fe268e7d44 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -46,7 +46,7 @@ typedef struct TransactionId fn_xmin; /* for checking up-to-dateness */ ItemPointerData fn_tid; PGFunction user_fn; /* the function's address */ - const Pg_finfo_record *inforec; /* address of its info record */ + const Pg_finfo_record *inforec; /* address of its info record */ } CFuncHashTabEntry; static HTAB *CFuncHash = NULL; @@ -172,7 +172,7 @@ fmgr_info_cxt_security(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt, finfo->fn_nargs = fbp->nargs; finfo->fn_strict = fbp->strict; finfo->fn_retset = fbp->retset; - finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */ + finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */ finfo->fn_addr = fbp->func; finfo->fn_oid = functionId; return; @@ -208,7 +208,7 @@ fmgr_info_cxt_security(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt, FmgrHookIsNeeded(functionId))) { finfo->fn_addr = fmgr_security_definer; - finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */ + finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */ finfo->fn_oid = functionId; ReleaseSysCache(procedureTuple); return; @@ -1795,7 +1795,7 @@ Int64GetDatum(int64 X) *retval = X; return PointerGetDatum(retval); } -#endif /* USE_FLOAT8_BYVAL */ +#endif /* USE_FLOAT8_BYVAL */ #ifndef USE_FLOAT4_BYVAL diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index af08f102fe..6324220426 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -814,7 +814,7 @@ get_func_arg_info(HeapTuple procTup, * deconstruct_array() since the array data is just going to look like * a C array of values. */ - arr = DatumGetArrayTypeP(proallargtypes); /* ensure not toasted */ + arr = DatumGetArrayTypeP(proallargtypes); /* ensure not toasted */ numargs = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || numargs < 0 || @@ -953,7 +953,7 @@ get_func_input_arg_names(Datum proargnames, Datum proargmodes, * For proargmodes, we don't need to use deconstruct_array() since the * array data is just going to look like a C array of values. */ - arr = DatumGetArrayTypeP(proargnames); /* ensure not toasted */ + arr = DatumGetArrayTypeP(proargnames); /* ensure not toasted */ if (ARR_NDIM(arr) != 1 || ARR_HASNULL(arr) || ARR_ELEMTYPE(arr) != TEXTOID) @@ -1200,7 +1200,7 @@ build_function_result_tupdesc_d(Datum proallargtypes, ARR_ELEMTYPE(arr) != OIDOID) elog(ERROR, "proallargtypes is not a 1-D Oid array"); argtypes = (Oid *) ARR_DATA_PTR(arr); - arr = DatumGetArrayTypeP(proargmodes); /* ensure not toasted */ + arr = DatumGetArrayTypeP(proargmodes); /* ensure not toasted */ if (ARR_NDIM(arr) != 1 || ARR_DIMS(arr)[0] != numargs || ARR_HASNULL(arr) || diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 578b1daccf..111d63df2b 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -352,7 +352,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags) hashp->hash = tag_hash; } else - hashp->hash = string_hash; /* default hash function */ + hashp->hash = string_hash; /* default hash function */ /* * If you don't specify a match function, it defaults to string_compare if @@ -1417,7 +1417,7 @@ hash_seq_search(HASH_SEQ_STATUS *status) /* Begin scan of curBucket... */ status->curEntry = curElem->link; - if (status->curEntry == NULL) /* end of this bucket */ + if (status->curEntry == NULL) /* end of this bucket */ ++curBucket; status->curBucket = curBucket; return (void *) ELEMENTKEY(curElem); @@ -1740,7 +1740,7 @@ next_pow2_int(long num) #define MAX_SEQ_SCANS 100 static HTAB *seq_scan_tables[MAX_SEQ_SCANS]; /* tables being scanned */ -static int seq_scan_level[MAX_SEQ_SCANS]; /* subtransaction nest level */ +static int seq_scan_level[MAX_SEQ_SCANS]; /* subtransaction nest level */ static int num_seq_scans = 0; diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c index 8000b79e5a..7c09498dc0 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -62,10 +62,10 @@ char *DataDir = NULL; char OutputFileName[MAXPGPATH]; /* debugging output file */ char my_exec_path[MAXPGPATH]; /* full path to my executable */ -char pkglib_path[MAXPGPATH]; /* full path to lib directory */ +char pkglib_path[MAXPGPATH]; /* full path to lib directory */ #ifdef EXEC_BACKEND -char postgres_exec_path[MAXPGPATH]; /* full path to backend */ +char postgres_exec_path[MAXPGPATH]; /* full path to backend */ /* note: currently this is not valid in backend processes */ #endif @@ -126,7 +126,7 @@ int max_worker_processes = 8; int max_parallel_workers = 8; int MaxBackends = 0; -int VacuumCostPageHit = 1; /* GUC parameters for vacuum */ +int VacuumCostPageHit = 1; /* GUC parameters for vacuum */ int VacuumCostPageMiss = 10; int VacuumCostPageDirty = 20; int VacuumCostLimit = 200; @@ -136,5 +136,5 @@ int VacuumPageHit = 0; int VacuumPageMiss = 0; int VacuumPageDirty = 0; -int VacuumCostBalance = 0; /* working state for vacuum */ +int VacuumCostBalance = 0; /* working state for vacuum */ bool VacuumCostActive = false; diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 64b3785d7b..1c75e6357e 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -1137,8 +1137,8 @@ TouchSocketLockFiles(void) |