diff options
Diffstat (limited to 'src/backend')
134 files changed, 802 insertions, 800 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 6d1f22f049b..a6adf6e637c 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -1321,33 +1321,33 @@ default_reloptions(Datum reloptions, bool validate, relopt_kind kind) static const relopt_parse_elt tab[] = { {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, enabled)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, {"autovacuum_vacuum_threshold", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, vacuum_threshold)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_threshold)}, {"autovacuum_analyze_threshold", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, analyze_threshold)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, analyze_threshold)}, {"autovacuum_vacuum_cost_delay", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, vacuum_cost_delay)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_cost_delay)}, {"autovacuum_vacuum_cost_limit", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, vacuum_cost_limit)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_cost_limit)}, {"autovacuum_freeze_min_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, freeze_min_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_min_age)}, {"autovacuum_freeze_max_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, freeze_max_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_max_age)}, {"autovacuum_freeze_table_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, freeze_table_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_table_age)}, {"autovacuum_multixact_freeze_min_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, multixact_freeze_min_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_min_age)}, {"autovacuum_multixact_freeze_max_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, multixact_freeze_max_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_max_age)}, {"autovacuum_multixact_freeze_table_age", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, multixact_freeze_table_age)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_table_age)}, {"log_autovacuum_min_duration", RELOPT_TYPE_INT, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, log_min_duration)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, log_min_duration)}, {"autovacuum_vacuum_scale_factor", RELOPT_TYPE_REAL, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, vacuum_scale_factor)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_scale_factor)}, {"autovacuum_analyze_scale_factor", RELOPT_TYPE_REAL, - offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, analyze_scale_factor)}, + offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, analyze_scale_factor)}, {"user_catalog_table", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, user_catalog_table)}, {"parallel_workers", RELOPT_TYPE_INT, diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c index cc7435e0309..a5238c3af5e 100644 --- a/src/backend/access/gin/ginarrayproc.c +++ b/src/backend/access/gin/ginarrayproc.c @@ -113,7 +113,7 @@ ginqueryarrayextract(PG_FUNCTION_ARGS) case GinContainsStrategy: if (nelems > 0) *searchMode = GIN_SEARCH_MODE_DEFAULT; - else /* everything contains the empty set */ + else /* everything contains the empty set */ *searchMode = GIN_SEARCH_MODE_ALL; break; case GinContainedStrategy: diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c index ad62d4e0e94..93ed3272ea9 100644 --- a/src/backend/access/gin/gindatapage.c +++ b/src/backend/access/gin/gindatapage.c @@ -391,7 +391,7 @@ GinDataPageAddPostingItem(Page page, PostingItem *data, OffsetNumber offset) if (offset != maxoff + 1) memmove(ptr + sizeof(PostingItem), ptr, - (maxoff - offset + 1) *sizeof(PostingItem)); + (maxoff - offset + 1) * sizeof(PostingItem)); } memcpy(ptr, data, sizeof(PostingItem)); diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 8a3297924ff..d89c1928627 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -779,7 +779,7 @@ hashbucketcleanup(Relation rel, Bucket cur_bucket, Buffer bucket_buf, { BlockNumber blkno; Buffer buf; - Bucket new_bucket PG_USED_FOR_ASSERTS_ONLY = InvalidBucket; + Bucket new_bucket PG_USED_FOR_ASSERTS_ONLY = InvalidBucket; bool bucket_dirty = false; blkno = bucket_blkno; diff --git a/src/backend/access/hash/hash_xlog.c b/src/backend/access/hash/hash_xlog.c index 0ea11b2e742..429af11f4dd 100644 --- a/src/backend/access/hash/hash_xlog.c +++ b/src/backend/access/hash/hash_xlog.c @@ -161,7 +161,7 @@ hash_xlog_add_ovfl_page(XLogReaderState *record) HashPageOpaque ovflopaque; uint32 *num_bucket; char *data; - Size datalen PG_USED_FOR_ASSERTS_ONLY; + Size datalen PG_USED_FOR_ASSERTS_ONLY; bool new_bmpage = false; XLogRecGetBlockTag(record, 0, NULL, NULL, &rightblk); @@ -293,7 +293,7 @@ hash_xlog_split_allocate_page(XLogReaderState *record) Buffer oldbuf; Buffer newbuf; Buffer metabuf; - Size datalen PG_USED_FOR_ASSERTS_ONLY; + Size datalen PG_USED_FOR_ASSERTS_ONLY; char *data; XLogRedoAction action; diff --git a/src/backend/access/hash/hashovfl.c b/src/backend/access/hash/hashovfl.c index b5133e3945c..8468efee020 100644 --- a/src/backend/access/hash/hashovfl.c +++ b/src/backend/access/hash/hashovfl.c @@ -505,7 +505,7 @@ _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf, uint32 ovflbitno; int32 bitmappage, bitmapbit; - Bucket bucket PG_USED_FOR_ASSERTS_ONLY; + Bucket bucket PG_USED_FOR_ASSERTS_ONLY; Buffer prevbuf = InvalidBuffer; Buffer nextbuf = InvalidBuffer; bool update_metap = false; diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c index 60dcb67a203..e702af901e2 100644 --- a/src/backend/access/heap/rewriteheap.c +++ b/src/backend/access/heap/rewriteheap.c @@ -149,12 +149,12 @@ typedef struct RewriteStateData 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_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 */ - MultiXactId rs_cutoff_multi;/* MultiXactId that will be used as cutoff - * point for multixacts */ + 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 */ @@ -162,7 +162,7 @@ typedef struct RewriteStateData HTAB *rs_old_new_tid_map; /* unmatched B tuples */ HTAB *rs_logical_mappings; /* logical remapping files */ uint32 rs_num_rewrite_mappings; /* # in memory mappings */ -} RewriteStateData; +} RewriteStateData; /* * The lookup keys for the hash tables are tuple TID and xmin (we must check diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index aa5a45ded48..a2b3700750a 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -69,13 +69,13 @@ typedef struct toast_compress_header static void toast_delete_datum(Relation rel, Datum value, bool is_speculative); static Datum toast_save_datum(Relation rel, Datum value, - struct varlena * oldexternal, int options); + struct varlena *oldexternal, int options); static bool toastrel_valueid_exists(Relation toastrel, Oid valueid); static bool toastid_valueid_exists(Oid toastrelid, Oid valueid); -static struct varlena *toast_fetch_datum(struct varlena * attr); -static struct varlena *toast_fetch_datum_slice(struct varlena * attr, +static struct varlena *toast_fetch_datum(struct varlena *attr); +static struct varlena *toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length); -static struct varlena *toast_decompress_datum(struct varlena * attr); +static struct varlena *toast_decompress_datum(struct varlena *attr); static int toast_open_indexes(Relation toastrel, LOCKMODE lock, Relation **toastidxs, @@ -98,7 +98,7 @@ static void init_toast_snapshot(Snapshot toast_snapshot); * ---------- */ struct varlena * -heap_tuple_fetch_attr(struct varlena * attr) +heap_tuple_fetch_attr(struct varlena *attr) { struct varlena *result; @@ -169,7 +169,7 @@ heap_tuple_fetch_attr(struct varlena * attr) * ---------- */ struct varlena * -heap_tuple_untoast_attr(struct varlena * attr) +heap_tuple_untoast_attr(struct varlena *attr) { if (VARATT_IS_EXTERNAL_ONDISK(attr)) { @@ -255,7 +255,7 @@ heap_tuple_untoast_attr(struct varlena * attr) * ---------- */ struct varlena * -heap_tuple_untoast_attr_slice(struct varlena * attr, +heap_tuple_untoast_attr_slice(struct varlena *attr, int32 sliceoffset, int32 slicelength) { struct varlena *preslice; @@ -1468,7 +1468,7 @@ toast_get_valid_index(Oid toastoid, LOCKMODE lock) */ static Datum toast_save_datum(Relation rel, Datum value, - struct varlena * oldexternal, int options) + struct varlena *oldexternal, int options) { Relation toastrel; Relation *toastidxs; @@ -1873,7 +1873,7 @@ toastid_valueid_exists(Oid toastrelid, Oid valueid) * ---------- */ static struct varlena * -toast_fetch_datum(struct varlena * attr) +toast_fetch_datum(struct varlena *attr) { Relation toastrel; Relation *toastidxs; @@ -2044,7 +2044,7 @@ toast_fetch_datum(struct varlena * attr) * ---------- */ static struct varlena * -toast_fetch_datum_slice(struct varlena * attr, int32 sliceoffset, int32 length) +toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length) { Relation toastrel; Relation *toastidxs; @@ -2276,7 +2276,7 @@ toast_fetch_datum_slice(struct varlena * attr, int32 sliceoffset, int32 length) * Decompress a compressed version of a varlena datum */ static struct varlena * -toast_decompress_datum(struct varlena * attr) +toast_decompress_datum(struct varlena *attr) { struct varlena *result; diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 116f5f32f6e..5d7504040da 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -92,15 +92,15 @@ typedef enum typedef struct BTParallelScanDescData { BlockNumber btps_scanPage; /* latest or next page to be scanned */ - BTPS_State btps_pageStatus;/* indicates whether next page is available - * for scan. see above for possible states of - * parallel scan. */ + 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 */ slock_t btps_mutex; /* protects above variables */ ConditionVariable btps_cv; /* used to synchronize parallel scan */ -} BTParallelScanDescData; +} BTParallelScanDescData; typedef struct BTParallelScanDescData *BTParallelScanDesc; diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c index 90c65341397..57d2612c475 100644 --- a/src/backend/access/spgist/spgdoinsert.c +++ b/src/backend/access/spgist/spgdoinsert.c @@ -765,7 +765,7 @@ doPickSplit(Relation index, SpGistState *state, /* we will delete the tuple altogether, so count full space */ spaceToDelete += it->size + sizeof(ItemIdData); } - else /* tuples on root should be live */ + else /* tuples on root should be live */ elog(ERROR, "unexpected SPGiST tuple state: %d", it->tupstate); } } @@ -2064,7 +2064,7 @@ spgdoinsert(Relation index, SpGistState *state, goto process_inner_tuple; } } - else /* non-leaf page */ + else /* non-leaf page */ { /* * Apply the opclass choose function to figure out how to insert diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index 2d96c0094e6..92810506463 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -25,7 +25,7 @@ typedef void (*storeRes_func) (SpGistScanOpaque so, ItemPointer heapPtr, - Datum leafValue, bool isnull, bool recheck); + Datum leafValue, bool isnull, bool recheck); typedef struct ScanStackEntry { @@ -430,7 +430,7 @@ redirect: } } } - else /* page is inner */ + else /* page is inner */ { SpGistInnerTuple innerTuple; spgInnerConsistentIn in; diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 16a0bee6103..98793bda668 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -113,7 +113,7 @@ static const struct { const char *fn_name; parallel_worker_main_type fn_addr; -} InternalParallelWorkers[] = +} InternalParallelWorkers[] = { { diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 7ae783102af..92966d3b105 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -340,7 +340,7 @@ SimpleLruWaitIO(SlruCtl ctl, int slotno) /* indeed, the I/O must have failed */ if (shared->page_status[slotno] == SLRU_PAGE_READ_IN_PROGRESS) shared->page_status[slotno] = SLRU_PAGE_EMPTY; - else /* write_in_progress */ + else /* write_in_progress */ { shared->page_status[slotno] = SLRU_PAGE_VALID; shared->page_dirty[slotno] = true; diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index e9751aa2f6d..957457c9790 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -174,7 +174,7 @@ typedef struct GlobalTransactionData bool ondisk; /* TRUE if prepare state file is on disk */ bool inredo; /* TRUE if entry was added via xlog_redo */ char gid[GIDSIZE]; /* The GID assigned to the prepared xact */ -} GlobalTransactionData; +} GlobalTransactionData; /* * Two Phase Commit shared state. Access to this struct is protected @@ -948,7 +948,7 @@ static struct xllist uint32 num_chunks; uint32 bytes_free; /* free bytes left in tail block */ uint32 total_len; /* total data bytes in chain */ -} records; +} records; /* diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 70d2570dc2c..e386df7315c 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4893,7 +4893,7 @@ XLOGShmemInit(void) /* WAL insertion locks. Ensure they're aligned to the full padded size */ allocptr += sizeof(WALInsertLockPadded) - - ((uintptr_t) allocptr) %sizeof(WALInsertLockPadded); + ((uintptr_t) allocptr) % sizeof(WALInsertLockPadded); WALInsertLocks = XLogCtl->Insert.WALInsertLocks = (WALInsertLockPadded *) allocptr; allocptr += sizeof(WALInsertLockPadded) * NUM_XLOGINSERT_LOCKS; @@ -8426,14 +8426,14 @@ LogCheckpointEnd(bool restartpoint) */ longest_secs = (long) (CheckpointStats.ckpt_longest_sync / 1000000); longest_usecs = CheckpointStats.ckpt_longest_sync - - (uint64) longest_secs *1000000; + (uint64) longest_secs * 1000000; average_sync_time = 0; if (CheckpointStats.ckpt_sync_rels > 0) average_sync_time = CheckpointStats.ckpt_agg_sync_time / CheckpointStats.ckpt_sync_rels; average_secs = (long) (average_sync_time / 1000000); - average_usecs = average_sync_time - (uint64) average_secs *1000000; + average_usecs = average_sync_time - (uint64) average_secs * 1000000; elog(LOG, "%s complete: wrote %d buffers (%.1f%%); " "%d WAL file(s) added, %d removed, %d recycled; " @@ -11448,7 +11448,7 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen, (XLogPageReadPrivate *) xlogreader->private_data; int emode = private->emode; uint32 targetPageOff; - XLogSegNo targetSegNo PG_USED_FOR_ASSERTS_ONLY; + XLogSegNo targetSegNo PG_USED_FOR_ASSERTS_ONLY; XLByteToSeg(targetPagePtr, targetSegNo); targetPageOff = targetPagePtr % XLogSegSize; diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 7a6da1e3c97..8a774440005 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -1937,7 +1937,7 @@ index_update_stats(Relation rel, if (rd_rel->relkind != RELKIND_INDEX) visibilitymap_count(rel, &relallvisible, NULL); - else /* don't bother for indexes */ + else /* don't bother for indexes */ relallvisible = 0; if (rd_rel->relpages != (int32) relpages) diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c index 68fc12b50ee..b9cca29ea3b 100644 --- a/src/backend/catalog/partition.c +++ b/src/backend/catalog/partition.c @@ -80,9 +80,9 @@ typedef struct PartitionBoundInfoData int ndatums; /* Length of the datums following array */ Datum **datums; /* Array of datum-tuples with key->partnatts * datums each */ - RangeDatumContent **content;/* what's contained in each range bound datum? - * (see the above enum); NULL for list - * partitioned tables */ + RangeDatumContent **content; /* what's contained in each range bound + * datum? (see the above enum); NULL for + * list partitioned tables */ int *indexes; /* Partition indexes; one entry per member of * the datums array (plus one if range * partitioned table) */ diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index ae79a2ffbc3..ff32d041897 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -2626,7 +2626,7 @@ CopyFrom(CopyState cstate) if (slot == NULL) /* "do nothing" */ skip_tuple = true; - else /* trigger might have changed tuple */ + else /* trigger might have changed tuple */ tuple = ExecMaterializeSlot(slot); } diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index e8126a38a9d..91f9cac7862 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -75,7 +75,8 @@ typedef struct ExtensionControlFile char *name; /* name of the extension */ char *directory; /* directory for script files */ char *default_version; /* default install target version, if any */ - char *module_pathname; /* string to substitute for MODULE_PATHNAME */ + char *module_pathname; /* string to substitute for + * MODULE_PATHNAME */ char *comment; /* comment, if any */ char *schema; /* target schema (allowed if !relocatable) */ bool relocatable; /* is ALTER EXTENSION SET SCHEMA supported? */ diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 02c740c13a6..2e26090bf99 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -588,7 +588,7 @@ update_proconfig_value(ArrayType *a, List *set_items) if (valuestr) a = GUCArrayAdd(a, sstmt->name, valuestr); - else /* RESET */ + else /* RESET */ a = GUCArrayDelete(a, sstmt->name); } } diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index 8f06c23df95..9cfac4a6f97 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -330,7 +330,7 @@ AlterPublicationTables(AlterPublicationStmt *stmt, Relation rel, PublicationAddTables(pubid, rels, false, stmt); else if (stmt->tableAction == DEFELEM_DROP) PublicationDropTables(pubid, rels, false); - else /* DEFELEM_SET */ + else /* DEFELEM_SET */ { List *oldrelids = GetPublicationRelations(pubid); List *delrels = NIL; diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index b4425bc6afa..758c876ef3f 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -3187,7 +3187,7 @@ AlterTableGetLockLevel(List *cmds) * might miss data added to the new toast table by concurrent * insert transactions. */ - case AT_SetStorage:/* may add toast tables, see + case AT_SetStorage: /* may add toast tables, see * ATRewriteCatalogs() */ cmd_lockmode = AccessExclusiveLock; break; @@ -3197,27 +3197,27 @@ AlterTableGetLockLevel(List *cmds) * optimised assuming the constraint holds true. */ case AT_DropConstraint: /* as DROP INDEX */ - case AT_DropNotNull: /* may change some SQL plans */ + case AT_DropNotNull: /* may change some SQL plans */ cmd_lockmode = AccessExclusiveLock; break; /* * Subcommands that may be visible to concurrent SELECTs */ - case AT_DropColumn: /* change visible to SELECT */ + case AT_DropColumn: /* change visible to SELECT */ case AT_AddColumnToView: /* CREATE VIEW */ case AT_DropOids: /* calls AT_DropColumn */ case AT_EnableAlwaysRule: /* may change SELECT rules */ case AT_EnableReplicaRule: /* may change SELECT rules */ - case AT_EnableRule: /* may change SELECT rules */ - case AT_DisableRule: /* may change SELECT rules */ + case AT_EnableRule: /* may change SELECT rules */ + case AT_DisableRule: /* may change SELECT rules */ cmd_lockmode = AccessExclusiveLock; break; /* * Changing owner may remove implicit SELECT privileges */ - case AT_ChangeOwner: /* change visible to SELECT */ + case AT_ChangeOwner: /* change visible to SELECT */ cmd_lockmode = AccessExclusiveLock; break; @@ -3347,8 +3347,8 @@ AlterTableGetLockLevel(List *cmds) */ 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_DropCluster: /* Uses MVCC in getIndexes() */ + case AT_SetOptions: /* Uses MVCC in getTableAttrs() */ case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ cmd_lockmode = ShareUpdateExclusiveLock; break; @@ -3358,8 +3358,7 @@ AlterTableGetLockLevel(List *cmds) cmd_lockmode = AccessExclusiveLock; break; - case AT_ValidateConstraint: /* Uses MVCC in - * getConstraints() */ + case AT_ValidateConstraint: /* Uses MVCC in getConstraints() */ cmd_lockmode = ShareUpdateExclusiveLock; break; @@ -3469,8 +3468,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, /* Recursion occurs during execution phase */ pass = AT_PASS_ADD_COL; break; - case AT_AddColumnToView: /* add column via CREATE OR REPLACE - * VIEW */ + case AT_AddColumnToView: /* add column via CREATE OR REPLACE VIEW */ ATSimplePermissions(rel, ATT_VIEW); ATPrepAddColumn(wqueue, rel, recurse, recursing, true, cmd, lockmode); @@ -3561,7 +3559,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, /* No command-specific prep needed */ pass = AT_PASS_ADD_CONSTR; break; - case AT_DropConstraint: /* DROP CONSTRAINT */ + case AT_DropConstraint: /* DROP CONSTRAINT */ ATSimplePermissions(rel, ATT_TABLE | ATT_FOREIGN_TABLE); /* Recursion occurs during execution phase */ /* No command-specific prep needed except saving recurse flag */ @@ -3569,7 +3567,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, cmd->subtype = AT_DropConstraintRecurse; pass = AT_PASS_DROP; break; - case AT_AlterColumnType: /* ALTER COLUMN TYPE */ + case AT_AlterColumnType: /* ALTER COLUMN TYPE */ ATSimplePermissions(rel, ATT_TABLE | ATT_COMPOSITE_TYPE | ATT_FOREIGN_TABLE); /* Performs own recursion */ @@ -3644,7 +3642,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, pass = AT_PASS_MISC; /* doesn't actually matter */ break; case AT_SetRelOptions: /* SET (...) */ - case AT_ResetRelOptions: /* RESET (...) */ + case AT_ResetRelOptions: /* RESET (...) */ case AT_ReplaceRelOptions: /* reset them all, then set just these */ ATSimplePermissions(rel, ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX); /* This command never recurses */ @@ -3663,7 +3661,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, /* No command-specific prep needed */ pass = AT_PASS_MISC; break; - case AT_AlterConstraint: /* ALTER CONSTRAINT */ + case AT_AlterConstraint: /* ALTER CONSTRAINT */ ATSimplePermissions(rel, ATT_TABLE); pass = AT_PASS_MISC; break; @@ -3675,7 +3673,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, cmd->subtype = AT_ValidateConstraintRecurse; pass = AT_PASS_MISC; break; - case AT_ReplicaIdentity: /* REPLICA IDENTITY ... */ + case AT_ReplicaIdentity: /* REPLICA IDENTITY ... */ ATSimplePermissions(rel, ATT_TABLE | ATT_MATVIEW); pass = AT_PASS_MISC; /* This command never recurses */ @@ -3697,7 +3695,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, case AT_EnableReplicaRule: case AT_DisableRule: case AT_AddOf: /* OF */ - case AT_DropOf: /* NOT OF */ + case AT_DropOf: /* NOT OF */ case AT_EnableRowSecurity: case AT_DisableRowSecurity: case AT_ForceRowSecurity: @@ -3813,8 +3811,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, switch (cmd->subtype) { case AT_AddColumn: /* ADD COLUMN */ - case AT_AddColumnToView: /* add column via CREATE OR REPLACE - * VIEW */ + case AT_AddColumnToView: /* add column via CREATE OR REPLACE VIEW */ address = ATExecAddColumn(wqueue, tab, rel, (ColumnDef *) cmd->def, false, false, false, false, lockmode); @@ -3882,8 +3879,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, ATExecAddConstraint(wqueue, tab, rel, (Constraint *) cmd->def, true, false, lockmode); break; - case AT_ReAddConstraint: /* Re-add pre-existing check - * constraint */ + case AT_ReAddConstraint: /* Re-add pre-existing check constraint */ address = ATExecAddConstraint(wqueue, tab, rel, (Constraint *) cmd->def, true, true, lockmode); @@ -3895,7 +3891,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, address = ATExecAddIndexConstraint(tab, rel, (IndexStmt *) cmd->def, lockmode); break; - case AT_AlterConstraint: /* ALTER CONSTRAINT */ + case AT_AlterConstraint: /* ALTER CONSTRAINT */ address = ATExecAlterConstraint(rel, cmd, false, false, lockmode); break; case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ @@ -3907,7 +3903,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, address = ATExecValidateConstraint(rel, cmd->name, true, false, lockmode); break; - case AT_DropConstraint: /* DROP CONSTRAINT */ + case AT_DropConstraint: /* DROP CONSTRAINT */ ATExecDropConstraint(rel, cmd->name, cmd->behavior, false, false, cmd->missing_ok, lockmode); @@ -3917,7 +3913,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, true, false, cmd->missing_ok, lockmode); break; - case AT_AlterColumnType: /* ALTER COLUMN TYPE */ + case AT_AlterColumnType: /* ALTER COLUMN TYPE */ address = ATExecAlterColumnType(tab, rel, cmd, lockmode); break; case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ @@ -3947,7 +3943,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, true, false, false, cmd->missing_ok, lockmode); break; - case AT_AddOidsRecurse: /* SET WITH OIDS */ + case AT_AddOidsRecurse: /* SET WITH OIDS */ /* Use the ADD COLUMN code, unless prep decided to do nothing */ if (cmd->def != NULL) address = @@ -3969,7 +3965,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, */ break; case AT_SetRelOptions: /* SET (...) */ - case AT_ResetRelOptions: /* RESET (...) */ + case AT_ResetRelOptions: /* RESET (...) */ case AT_ReplaceRelOptions: /* replace entire option list */ ATExecSetRelOptions(rel, (List *) cmd->def, cmd->subtype, lockmode); break; @@ -3993,15 +3989,15 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, ATExecEnableDisableTrigger(rel, NULL, TRIGGER_FIRES_ON_ORIGIN, false, lockmode); break; - case AT_DisableTrigAll: /* DISABLE TRIGGER ALL */ + case AT_DisableTrigAll: /* DISABLE TRIGGER ALL */ ATExecEnableDisableTrigger(rel, NULL, TRIGGER_DISABLED, false, lockmode); break; - case AT_EnableTrigUser: /* ENABLE TRIGGER USER */ + case AT_EnableTrigUser: /* ENABLE TRIGGER USER */ ATExecEnableDisableTrigger(rel, NULL, TRIGGER_FIRES_ON_ORIGIN, true, lockmode); break; - case AT_DisableTrigUser: /* DISABLE TRIGGER USER */ + case AT_DisableTrigUser: /* DISABLE TRIGGER USER */ ATExecEnableDisableTrigger(rel, NULL, TRIGGER_DISABLED, true, lockmode); break; diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 0271788bf99..d7ed71f7675 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -3049,7 +3049,7 @@ TriggerEnabled(EState *estate, ResultRelInfo *relinfo, trigger->tgenabled == TRIGGER_DISABLED) return false; } - else /* ORIGIN or LOCAL role */ + else /* ORIGIN or LOCAL role */ { if (trigger->tgenabled == TRIGGER_FIRES_ON_REPLICA || trigger->tgenabled == TRIGGER_DISABLED) @@ -3290,13 +3290,13 @@ typedef struct AfterTriggerEventDataOneCtid { TriggerFlags ate_flags; /* status bits and offset to shared data */ ItemPointerData ate_ctid1; /* inserted, deleted, or old updated tuple */ -} AfterTriggerEventDataOneCtid; +} AfterTriggerEventDataOneCtid; /* AfterTriggerEventData, minus ate_ctid1 and ate_ctid2 */ typedef struct AfterTriggerEventDataZeroCtids { TriggerFlags ate_flags; /* status bits and offset to shared data */ -} AfterTriggerEventDataZeroCtids; +} AfterTriggerEventDataZeroCtids; #define SizeofTriggerEvent(evt) \ (((evt)->ate_flags & AFTER_TRIGGER_TUP_BITS) == AFTER_TRIGGER_2CTID ? \ diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index fc9c4f0fb1f..153a3608611 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -363,10 +363,10 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params, write_rate = 0; if ((secs > 0) || (usecs > 0)) { - read_rate = (double) BLCKSZ *VacuumPageMiss / (1024 * 1024) / - (secs + usecs / 1000000.0); - write_rate = (double) BLCKSZ *VacuumPageDirty / (1024 * 1024) / - (secs + usecs / 1000000.0); + read_rate = (double) BLCKSZ * VacuumPageMiss / (1024 * 1024) / + (secs + usecs / 1000000.0); + write_rate = (double) BLCKSZ * VacuumPageDirty / (1024 * 1024) / + (secs + usecs / 1000000.0); } /* diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c index 3af4a90b515..f00fce59132 100644 --- a/src/backend/executor/execCurrent.c +++ b/src/backend/executor/execCurrent.c @@ -151,7 +151,7 @@ execCurrentOf(CurrentOfExpr *cexpr, { ScanState *scanstate; bool lisnull; - Oid tuple_tableoid PG_USED_FOR_ASSERTS_ONLY; + Oid tuple_tableoid PG_USED_FOR_ASSERTS_ONLY; ItemPointer tuple_tid; /* diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 89aea2fe5c5..f15ff64a3b4 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -140,7 +140,7 @@ typedef struct SQLFunctionParseInfo char **argnames; /* names of input arguments; NULL if none */ /* Note that argnames[i] can be NULL, if some args are unnamed */ Oid collation; /* function's input collation, if known */ -} SQLFunctionParseInfo; +} SQLFunctionParseInfo; /* non-export function prototypes */ diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 7eeda95af75..96cdfb7ad2a 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -391,7 +391,7 @@ typedef struct AggStatePerTransData FunctionCallInfoData serialfn_fcinfo; FunctionCallInfoData deserialfn_fcinfo; -} AggStatePerTransData; +} AggStatePerTransData; /* * AggStatePerAggData - per-aggregate information @@ -439,7 +439,7 @@ typedef struct AggStatePerAggData int16 resulttypeLen; bool resulttypeByVal; -} AggStatePerAggData; +} AggStatePerAggData; /* * AggStatePerGroupData - per-aggregate-per-group working state @@ -471,7 +471,7 @@ typedef struct AggStatePerGroupData * NULL and not auto-replace it with a later input value. Only the first * non-NULL input will be auto-substituted. */ -} AggStatePerGroupData; +} AggStatePerGroupData; /* * AggStatePerPhaseData - per-grouping-set-phase state @@ -493,7 +493,7 @@ typedef struct AggStatePerPhaseData FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ Agg *aggnode; /* Agg node for phase data */ Sort *sortnode; /* Sort node for input ordering for phase */ -} AggStatePerPhaseData; +} AggStatePerPhaseData; /* * AggStatePerHashData - per-hashtable state @@ -515,7 +515,7 @@ typedef struct AggStatePerHashData AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */ AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */ Agg *aggnode; /* original Agg node, for numGroups etc. */ -} AggStatePerHashData; +} AggStatePerHashData; static void select_current_set(AggState *aggstate, int setno, bool is_hash); diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index f9ab0d60353..907090395cc 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -687,7 +687,7 @@ ExecHashJoinNewBatch(HashJoinState *hjstate) BufFileClose(hashtable->outerBatchFile[curbatch]); hashtable->outerBatchFile[curbatch] = NULL; } - else /* we just finished the first batch */ + else /* we just finished the first batch */ { /* * Reset some of the skew optimization state variables, since we no diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c index aa5d2529f4f..32b7269cdaf 100644 --- a/src/backend/executor/nodeMaterial.c +++ b/src/backend/executor/nodeMaterial.c @@ -66,7 +66,7 @@ ExecMaterial(MaterialState *node) * Allocate a second read pointer to serve as the mark. We know it * must have index 1, so needn't store that. */ - int ptrno PG_USED_FOR_ASSERTS_ONLY; + int ptrno PG_USED_FOR_ASSERTS_ONLY; ptrno = tuplestore_alloc_read_pointer(tuplestorestate, node->eflags); diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index 572e9dce94c..336270f02ac 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -137,7 +137,7 @@ typedef struct MergeJoinClauseData * stored here. */ SortSupportData ssup; -} MergeJoinClauseData; +} MergeJoinClauseData; /* Result type for MJEvalOuterValues and MJEvalInnerValues */ typedef enum @@ -216,7 +216,7 @@ MJExamineQuals(List *mergeclauses, clause->ssup.ssup_reverse = false; else if (opstrategy == BTGreaterStrategyNumber) clause->ssup.ssup_reverse = true; - else /* planner screwed up */ + else /* planner screwed up */ elog(ERROR, "unsupported mergejoin strategy %d", opstrategy); clause->ssup.ssup_nulls_first = nulls_first; diff --git a/src/backend/executor/nodeProjectSet.c b/src/backend/executor/nodeProjectSet.c index 2f0a4e647b9..01048cc8268 100644 --- a/src/backend/executor/nodeProjectSet.c +++ b/src/backend/executor/nodeProjectSet.c @@ -120,7 +120,7 @@ ExecProjectSRF(ProjectSetState *node, bool continuing) { TupleTableSlot *resultSlot = node->ps.ps_ResultTupleSlot; ExprContext *econtext = node->ps.ps_ExprContext; - bool hassrf PG_USED_FOR_ASSERTS_ONLY; + bool hassrf PG_USED_FOR_ASSERTS_ONLY; bool hasresult; int argno; diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c index 9ae53bb8a71..0fb5615da3f 100644 --- a/src/backend/executor/nodeSetOp.c +++ b/src/backend/executor/nodeSetOp.c @@ -64,7 +64,7 @@ typedef struct SetOpStatePerGroupData { long numLeft; /* number of left-input dups in group */ long numRight; /* number of right-input dups in group */ -} SetOpStatePerGroupData; +} SetOpStatePerGroupData; static TupleTableSlot *setop_retrieve_direct(SetOpState *setopstate); @@ -333,7 +333,7 @@ setop_fill_hash_table(SetOpState *setopstate) SetOp *node = (SetOp *) setopstate->ps.plan; PlanState *outerPlan; int firstFlag; - bool in_first_rel PG_USED_FOR_ASSERTS_ONLY; + bool in_first_rel PG_USED_FOR_ASSERTS_ONLY; /* * get state info from node diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 628bc9f00b7..433d97c8b4e 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -95,7 +95,7 @@ typedef struct WindowStatePerFuncData int aggno; /* if so, index of its PerAggData */ WindowObject winobj; /* object used in window function API */ -} WindowStatePerFuncData; +} WindowStatePerFuncData; /* * For plain aggregate window functions, we also have one of these. diff --git a/src/backend/lib/binaryheap.c b/src/backend/lib/binaryheap.c index 9f99e77db04..ce4331ccdec 100644 --- a/src/backend/lib/binaryheap.c +++ b/src/backend/lib/binaryheap.c @@ -35,7 +35,7 @@ binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg) int sz; binaryheap *heap; - sz = offsetof(binaryheap, bh_nodes) +sizeof(Datum) * capacity; + sz = offsetof(binaryheap, bh_nodes) + sizeof(Datum) * capacity; heap = (binaryheap *) palloc(sz); heap->bh_space = capacity; heap->bh_compare = compare; diff --git a/src/backend/lib/ilist.c b/src/backend/lib/ilist.c index 720cecb0e78..a108cd150bc 100644 --- a/src/backend/lib/ilist.c +++ b/src/backend/lib/ilist.c @@ -32,7 +32,7 @@ slist_delete(slist_head *head, slist_node *node) { slist_node *last = &head->head; slist_node *cur; - bool found PG_USED_FOR_ASSERTS_ONLY = false; + bool found PG_USED_FOR_ASSERTS_ONLY = false; while ((cur = last->next) != NULL) { diff --git a/src/backend/lib/rbtree.c b/src/backend/lib/rbtree.c index cdf8a73aa52..3d80090a8cd 100644 --- a/src/backend/lib/rbtree.c +++ b/src/backend/lib/rbtree.c @@ -429,7 +429,7 @@ rb_insert(RBTree *rb, const RBNode *data, bool *isNew) */ *isNew = true; - x = rb->allocfunc (rb->arg); + x = rb->allocfunc(rb->arg); x->color = RBRED; @@ -624,7 +624,7 @@ rb_delete_node(RBTree *rb, RBNode *z) /* Now we can recycle the y node */ if (rb->freefunc) - rb->freefunc (y, rb->arg); + rb->freefunc(y, rb->arg); } /* @@ -808,7 +808,7 @@ loop: iter->next_step = NextStepLeft; goto loop; } - else /* not moved - return current, then go up */ + else /* not moved - return current, then go up */ iter->next_step = NextStepUp; break; diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 081c06a1e6b..28893d35190 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -92,8 +92,8 @@ static int auth_peer(hbaPort *port); #define PGSQL_PAM_SERVICE "postgresql" /* Service name passed to PAM */ static int CheckPAMAuth(Port *port, char *user, char *password); -static int pam_passwd_conv_proc(int num_msg, const struct pam_message ** msg, - struct pam_response ** resp, void *appdata_ptr); +static int pam_passwd_conv_proc(int num_msg, const struct pam_message **msg, + struct pam_response **resp, void *appdata_ptr); static struct pam_conv pam_passw_conv = { &pam_passwd_conv_proc, @@ -132,11 +132,11 @@ static int CheckBSDAuth(Port *port, char *user); /* Correct header from the Platform SDK */ typedef ULONG (*__ldap_start_tls_sA) ( - IN PLDAP ExternalHandle, - OUT PULONG ServerReturnValue, - OUT LDAPMessage **result, - IN PLDAPControlA * ServerControls, - IN PLDAPControlA * ClientControls + IN PLDAP ExternalHandle, + OUT PULONG ServerReturnValue, + OUT LDAPMessage **result, + IN PLDAPControlA * ServerControls, + IN PLDAPControlA * ClientControls ); #endif @@ -182,7 +182,7 @@ static int pg_GSS_recvauth(Port *port); #ifdef ENABLE_SSPI typedef SECURITY_STATUS (WINAPI * QUERY_SECURITY_CONTEXT_TOKEN_FN) ( - PCtxtHandle, void **); + PCtxtHandle, void **); static int pg_SSPI_recvauth(Port *port); static int pg_SSPI_make_upn(char *accountname, size_t accountnamesize, @@ -1337,6 +1337,7 @@ pg_SSPI_recvauth(Port *port) DWORD domainnamesize = sizeof(domainname); SID_NAME_USE accountnameuse; HMODULE secur32; + QUERY_SECURITY_CONTEXT_TOKEN_FN _QuerySecurityContextToken; /* @@ -2023,8 +2024,8 @@ auth_peer(hbaPort *port) */ static int -pam_passwd_conv_proc(int num_msg, const struct pam_message ** msg, - struct pam_response ** resp, void *appdata_ptr) +pam_passwd_conv_proc(int num_msg, const struct pam_message **msg, + struct pam_response **resp, void *appdata_ptr) { char *passwd; struct pam_response *reply; @@ -2919,7 +2920,7 @@ PerformRadiusTransaction(char *server, char *secret, char *portstr, char *identi addrsize = sizeof(struct sockaddr_in); #endif - if (bind(sock, (struct sockaddr *) & localaddr, addrsize)) + if (bind(sock, (struct sockaddr *) &localaddr, addrsize)) { ereport(LOG, (errmsg("could not bind local RADIUS socket: %m"))); @@ -3010,7 +3011,7 @@ PerformRadiusTransaction(char *server, char *secret, char *portstr, char *identi addrsize = sizeof(remoteaddr); packetlength = recvfrom(sock, receive_buffer, RADIUS_BUFFER_SIZE, 0, - (struct sockaddr *) & remoteaddr, &addrsize); + (struct sockaddr *) &remoteaddr, &addrsize); if (packetlength < 0) { ereport(LOG, diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c index 2cb60393852..9033dd4da82 100644 --- a/src/backend/libpq/be-fsstubs.c +++ b/src/backend/libpq/be-fsstubs.c @@ -766,7 +766,7 @@ lo_get_fragment_internal(Oid loOid, int64 offset, int32 nbytes) LargeObjectDesc *loDesc; int64 loSize; int64 result_length; - int total_read PG_USED_FOR_ASSERTS_ONLY; + int total_read PG_USED_FOR_ASSERTS_ONLY; bytea *result = NULL; /* @@ -868,7 +868,7 @@ be_lo_from_bytea(PG_FUNCTION_ARGS) Oid loOid = PG_GETARG_OID(0); bytea *str = PG_GETARG_BYTEA_PP(1); LargeObjectDesc *loDesc; - int written PG_USED_FOR_ASSERTS_ONLY; + int written PG_USED_FOR_ASSERTS_ONLY; CreateFSContext(); @@ -891,7 +891,7 @@ be_lo_put(PG_FUNCTION_ARGS) int64 offset = PG_GETARG_INT64(1); bytea *str = PG_GETARG_BYTEA_PP(2); LargeObjectDesc *loDesc; - int written PG_USED_FOR_ASSERTS_ONLY; + int written PG_USED_FOR_ASSERTS_ONLY; CreateFSContext(); diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 823880ebff4..45324341409 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -646,7 +646,7 @@ check_db(const char *dbname, const char *role, Oid roleid, List *tokens) } static bool -ipv4eq(struct sockaddr_in * a, struct sockaddr_in * b) +ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b) { return (a->sin_addr.s_addr == b->sin_addr.s_addr); } @@ -654,7 +654,7 @@ ipv4eq(struct sockaddr_in * a, struct sockaddr_in * b) #ifdef HAVE_IPV6 static bool -ipv6eq(struct sockaddr_in6 * a, struct sockaddr_in6 * b) +ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) { int i; @@ -747,7 +747,7 @@ check_hostname(hbaPort *port, const char *hostname) if (gai->ai_addr->sa_family == AF_INET) { if (ipv4eq((struct sockaddr_in *) gai->ai_addr, - (struct sockaddr_in *) & port->raddr.addr)) + (struct sockaddr_in *) &port->raddr.addr)) { found = true; break; @@ -757,7 +757,7 @@ check_hostname(hbaPort *port, const char *hostname) else if (gai->ai_addr->sa_family == AF_INET6) { if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr, - (struct sockaddr_in6 *) & port->raddr.addr)) + (struct sockaddr_in6 *) &port->raddr.addr)) { found = true; break; @@ -783,7 +783,7 @@ check_hostname(hbaPort *port, const char *hostname) * Check to see if a connecting IP matches the given address and netmask. */ static bool -check_ip(SockAddr *raddr, struct sockaddr * addr, struct sockaddr * mask) +check_ip(SockAddr *raddr, struct sockaddr *addr, struct sockaddr *mask) { if (raddr->addr.ss_family == addr->sa_family && pg_range_sockaddr(&raddr->addr, @@ -797,7 +797,7 @@ check_ip(SockAddr *raddr, struct sockaddr * addr, struct sockaddr * mask) * pg_foreach_ifaddr callback: does client addr match this machine interface? */ static void -check_network_callback(struct sockaddr * addr, struct sockaddr * netmask, +check_network_callback(struct sockaddr *addr, struct sockaddr *netmask, void *cb_data) { check_network_data *cn = (check_network_data *) cb_data; @@ -811,7 +811,7 @@ check_network_callback(struct sockaddr * addr, struct sockaddr * netmask, { /* Make an all-ones netmask of appropriate length for family */ pg_sockaddr_cidr_mask(&mask, NULL, addr->sa_family); - cn->result = check_ip(cn->raddr, addr, (struct sockaddr *) & mask); + cn->result = check_ip(cn->raddr, addr, (struct sockaddr *) &mask); } else { @@ -2041,8 +2041,8 @@ check_hba(hbaPort *port) else { if (!check_ip(&port->raddr, - (struct sockaddr *) & hba->addr, - (struct sockaddr *) & hba->mask)) + (struct sockaddr *) &hba->addr, + (struct sockaddr *) &hba->mask)) continue; } break; diff --git a/src/backend/libpq/ifaddr.c b/src/backend/libpq/ifaddr.c index 10643978c74..b5f32434104 100644 --- a/src/backend/libpq/ifaddr.c +++ b/src/backend/libpq/ifaddr.c @@ -32,14 +32,14 @@ #include "libpq/ifaddr.h" -static int range_sockaddr_AF_INET(const struct sockaddr_in * addr, - const struct sockaddr_in * netaddr, - const struct sockaddr_in * netmask); +static int range_sockaddr_AF_INET(const struct sockaddr_in *addr, + const struct sockaddr_in *netaddr, + const struct sockaddr_in *netmask); #ifdef HAVE_IPV6 -static int range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr, - const struct sockaddr_in6 * netaddr, - const struct sockaddr_in6 * netmask); +static int range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr, + const struct sockaddr_in6 *netaddr, + const struct sockaddr_in6 *netmask); #endif @@ -50,9 +50,9 @@ static int range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr, * in the same address family; and AF_UNIX addresses are not supported. */ int -pg_range_sockaddr(const struct sockaddr_storage * addr, - const struct sockaddr_storage * netaddr, - const struct sockaddr_storage * netmask) +pg_range_sockaddr(const struct sockaddr_storage *addr, + const struct sockaddr_storage *netaddr, + const struct sockaddr_storage *netmask) { if (addr->ss_family == AF_INET) return range_sockaddr_AF_INET((const struct sockaddr_in *) addr, @@ -69,9 +69,9 @@ pg_range_sockaddr(const struct sockaddr_storage * addr, } static int -range_sockaddr_AF_INET(const struct sockaddr_in * addr, - const struct sockaddr_in * netaddr, - const struct sockaddr_in * netmask) +range_sockaddr_AF_INET(const struct sockaddr_in *addr, + const struct sockaddr_in *netaddr, + const struct sockaddr_in *netmask) { if (((addr->sin_addr.s_addr ^ netaddr->sin_addr.s_addr) & netmask->sin_addr.s_addr) == 0) @@ -84,9 +84,9 @@ range_sockaddr_AF_INET(const struct sockaddr_in * addr, #ifdef HAVE_IPV6 static int -range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr, - const struct sockaddr_in6 * netaddr, - const struct sockaddr_in6 * netmask) +range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr, + const struct sockaddr_in6 *netaddr, + const struct sockaddr_in6 *netmask) { int i; @@ -112,7 +112,7 @@ range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr, * Return value is 0 if okay, -1 if not. */ int -pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, char *numbits, int family) +pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family) { long bits; char *endptr; @@ -190,7 +190,7 @@ pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, char *numbits, int family) */ static void run_ifaddr_callback(PgIfAddrCallback callback, void *cb_data, - struct sockaddr * addr, struct sockaddr * mask) + struct sockaddr *addr, struct sockaddr *mask) { struct sockaddr_storage fullmask; @@ -222,7 +222,7 @@ run_ifaddr_callback(PgIfAddrCallback callback, void *cb_data, if (!mask) { pg_sockaddr_cidr_mask(&fullmask, NULL, addr->sa_family); - mask = (struct sockaddr *) & fullmask; + mask = (struct sockaddr *) &fullmask; } (*callback) (addr, mask, cb_data); @@ -284,8 +284,8 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) for (i = 0; i < length / sizeof(INTERFACE_INFO); ++i) run_ifaddr_callback(callback, cb_data, - (struct sockaddr *) & ii[i].iiAddress, - (struct sockaddr *) & ii[i].iiNetmask); + (struct sockaddr *) &ii[i].iiAddress, + (struct sockaddr *) &ii[i].iiNetmask); closesocket(sock); free(ii); @@ -425,7 +425,7 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) lifr = lifc.lifc_req; for (i = 0; i < total; ++i) { - addr = (struct sockaddr *) & lifr[i].lifr_addr; + addr = (struct sockaddr *) &lifr[i].lifr_addr; memcpy(&lmask, &lifr[i], sizeof(struct lifreq)); #ifdef HAVE_IPV6 fd = (addr->sa_family == AF_INET6) ? sock6 : sock; @@ -435,7 +435,7 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) if (ioctl(fd, SIOCGLIFNETMASK, &lmask) < 0) mask = NULL; else - mask = (struct sockaddr *) & lmask.lifr_addr; + mask = (struct sockaddr *) &lmask.lifr_addr; run_ifaddr_callback(callback, cb_data, addr, mask); } @@ -572,8 +572,8 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) memset(&mask, 0, sizeof(mask)); pg_sockaddr_cidr_mask(&mask, "8", AF_INET); run_ifaddr_callback(callback, cb_data, - (struct sockaddr *) & addr, - (struct sockaddr *) & mask); + (struct sockaddr *) &addr, + (struct sockaddr *) &mask); #ifdef HAVE_IPV6 /* addr ::1/128 */ @@ -583,8 +583,8 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) memset(&mask, 0, sizeof(mask)); pg_sockaddr_cidr_mask(&mask, "128", AF_INET6); run_ifaddr_callback(callback, cb_data, - (struct sockaddr *) & addr6, - (struct sockaddr *) & mask); + (struct sockaddr *) &addr6, + (struct sockaddr *) &mask); #endif return 0; diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index d1cc38beb2b..1dffa98c44e 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -699,7 +699,7 @@ StreamConnection(pgsocket server_fd, Port *port) /* accept connection and fill in the client (remote) address */ port->raddr.salen = sizeof(port->raddr.addr); if ((port->sock = accept(server_fd, - (struct sockaddr *) & port->raddr.addr, + (struct sockaddr *) &port->raddr.addr, &port->raddr.salen)) == PGINVALID_SOCKET) { ereport(LOG, @@ -720,7 +720,7 @@ StreamConnection(pgsocket server_fd, Port *port) /* fill in the server (local) address */ port->laddr.salen = sizeof(port->laddr.addr); if (getsockname(port->sock, - (struct sockaddr *) & port->laddr.addr, + (struct sockaddr *) &port->laddr.addr, &port->laddr.salen) < 0) { elog(LOG, "getsockname() failed: %m"); @@ -1573,7 +1573,7 @@ fail: static void socket_putmessage_noblock(char msgtype, const char *s, size_t len) { - int res PG_USED_FOR_ASSERTS_ONLY; + int res PG_USED_FOR_ASSERTS_ONLY; int required; /* diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 5af37a93885..2cceb99fd98 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -29,7 +29,7 @@ static bool expression_returns_set_walker(Node *node, void *context); static int leftmostLoc(int loc1, int loc2); static bool fix_opfuncids_walker(Node *node, void *context); static bool planstate_walk_subplans(List *plans, bool (*walker) (), - void *context); + void *context); static bool planstate_walk_members(List *plans, PlanState **planstates, bool (*walker) (), void *context); @@ -3091,7 +3091,7 @@ query_tree_mutator(Query *query, MUTATE(query->limitCount, query->limitCount, Node *); if (!(flags & QTW_IGNORE_CTE_SUBQUERIES)) MUTATE(query->cteList, query->cteList, List *); - else /* else copy CTE list as-is */ + else /* else copy CTE list as-is */ query->cteList = copyObject(query->cteList); query->rtable = range_table_mutator(query->rtable, mutator, context, flags); diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index ef25fab71bf..6ed3c634b89 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -827,7 +827,7 @@ index_pages_fetched(double tuples_fetched, BlockNumber pages, Assert(T <= total_pages); /* b is pro-rated share of effective_cache_size */ - b = (double) effective_cache_size *T / total_pages; + b = (double) effective_cache_size * T / total_pages; /* force it positive and integral */ if (b <= 1.0) @@ -3057,7 +3057,7 @@ final_cost_hashjoin(PlannerInfo *root, HashPath *path, path->num_batches = numbatches; /* and compute the number of "virtual" buckets in the whole join */ - virtualbuckets = (double) numbuckets *(double) numbatches; + virtualbuckets = (double) numbuckets * (double) numbatches; /* * Determine bucketsize fraction for inner relation. We use the smallest diff --git a/src/backend/optimizer/path/joinrels.c b/src/backend/optimizer/path/joinrels.c index 5a68de3cc86..4c775a76c69 100644 --- a/src/backend/optimizer/path/joinrels.c +++ b/src/backend/optimizer/path/joinrels.c @@ -93,7 +93,7 @@ join_search_one_level(PlannerInfo *root, int level) if (level == 2) /* consider remaining initial rels */ other_rels = lnext(r); - else /* consider all initial rels */ + else /* consider all initial rels */ other_rels = list_head(joinrels[1]); make_rels_by_clause_joins(root, diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index 749ea805f82..cfdd770f6a4 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -1015,7 +1015,7 @@ pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte, if (rte->lateral) rvcontext.relids = get_relids_in_jointree((Node *) subquery->jointree, true); - else /* won't need relids */ + else /* won't need relids */ rvcontext.relids = NULL; rvcontext.outer_hasSubLinks = &parse->hasSubLinks; rvcontext.varno = varno; diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 06fce8458cc..72d70d52d19 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -1804,7 +1804,7 @@ lookup_proof_cache(Oid pred_op, Oid clause_op, bool refute_it) clause_op_infos = get_op_btree_interpretation(clause_op); if (clause_op_infos) pred_op_infos = get_op_btree_interpretation(pred_op); - else /* no point in looking */ + else /* no point in looking */ pred_op_infos = NIL; foreach(lcp, pred_op_infos) diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 65bd51e1fd6..e46aa60097f 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -2941,7 +2941,7 @@ make_row_comparison_op(ParseState *pstate, List *opname, } if (OidIsValid(opfamily)) opfamilies = lappend_oid(opfamilies, opfamily); - else /* should not happen */ + else /* should not happen */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not determine interpretation of row comparison operator %s", diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 34f1cf82ee0..eb1706a4a69 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -834,7 +834,7 @@ func_match_argtypes(int nargs, } return ncandidates; -} /* func_match_argtypes() */ +} /* func_match_argtypes() */ /* func_select_candidate() @@ -1245,7 +1245,7 @@ func_select_candidate(int nargs, } return NULL; /* failed to select a best candidate */ -} /* func_select_candidate() */ +} /* func_select_candidate() */ /* func_get_detail() diff --git a/src/backend/port/win32/crashdump.c b/src/backend/port/win32/crashdump.c index ff44b6033ed..c97cb9181e6 100644 --- a/src/backend/port/win32/crashdump.c +++ b/src/backend/port/win32/crashdump.c @@ -89,7 +89,7 @@ typedef BOOL (WINAPI * MINIDUMPWRITEDUMP) (HANDLE hProcess, DWORD dwPid, HANDLE * any PostgreSQL functions. */ static LONG WINAPI -crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo) +crashDumpHandler(struct _EXCEPTION_POINTERS *pExceptionInfo) { /* * We only write crash dumps if the "crashdumps" directory within the diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c index f11d6e6eb86..535b9a0c67c 100644 --- a/src/backend/port/win32/socket.c +++ b/src/backend/port/win32/socket.c @@ -298,7 +298,7 @@ pgwin32_socket(int af, int type, int protocol) } int -pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen) +pgwin32_bind(SOCKET s, struct sockaddr *addr, int addrlen) { int res; @@ -320,7 +320,7 @@ pgwin32_listen(SOCKET s, int backlog) } SOCKET -pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen) +pgwin32_accept(SOCKET s, struct sockaddr *addr, int *addrlen) { SOCKET rs; @@ -342,7 +342,7 @@ pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen) /* No signal delivery during connect. */ int -pgwin32_connect(SOCKET s, const struct sockaddr * addr, int addrlen) +pgwin32_connect(SOCKET s, const struct sockaddr *addr, int addrlen) { int r; @@ -500,7 +500,7 @@ pgwin32_send(SOCKET s, const void *buf, int len, int flags) * since it is not used in postgresql! */ int -pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval * timeout) +pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout) { WSAEVENT events[FD_SETSIZE * 2]; /* worst case is readfds totally * different from writefds, so diff --git a/src/backend/port/win32/timer.c b/src/backend/port/win32/timer.c index 43097794f76..f1aa0f3a169 100644 --- a/src/backend/port/win32/timer.c +++ b/src/backend/port/win32/timer.c @@ -83,7 +83,7 @@ pg_timer_thread(LPVOID param) * to handle the timer setting and notification upon timeout. */ int -setitimer(int which, const struct itimerval * value, struct itimerval * ovalue) +setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) { Assert(value != NULL); Assert(value->it_interval.tv_sec == 0 && value->it_interval.tv_usec == 0); diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 89dd3b321bc..5baa6db321a 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -242,7 +242,7 @@ typedef enum AutoVacForkFailed, /* failed trying to start a worker */ AutoVacRebalance, /* rebalance the cost limits */ AutoVacNumSignals /* must be last */ -} AutoVacuumSignal; +} AutoVacuumSignal; /*------------- * The main autovacuum shmem struct. On shared memory we store this main @@ -321,7 +321,7 @@ NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_no static Oid do_start_worker(void); static void launcher_determine_sleep(bool canlaunch, bool recursing, - struct timeval * nap); + struct timeval *nap); static void launch_worker(TimestampTz now); static List *get_database_list(void); static void rebuild_database_list(Oid newdb); @@ -849,7 +849,7 @@ shutdown: * cause a long sleep, which will be interrupted when a worker exits. */ static void -launcher_determine_sleep(bool canlaunch, bool recursing, struct timeval * nap) +launcher_determine_sleep(bool canlaunch, bool recursing, struct timeval *nap) { /* * We sleep until the next scheduled vacuum. We trust that when the diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 712d700481d..09b7fb40920 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -118,7 +118,7 @@ static const struct { const char *fn_name; bgworker_main_type fn_addr; -} InternalBGWorkers[] = +} InternalBGWorkers[] = { { diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index f453dade6c6..5cf95822463 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -443,7 +443,7 @@ pgstat_init(void) } alen = sizeof(pgStatAddr); - if (getsockname(pgStatSock, (struct sockaddr *) & pgStatAddr, &alen) < 0) + if (getsockname(pgStatSock, (struct sockaddr *) &pgStatAddr, &alen) < 0) { ereport(LOG, (errcode_for_socket_access(), @@ -459,7 +459,7 @@ pgstat_init(void) * provides a kernel-level check that only packets from this same * address will be received. */ - if (connect(pgStatSock, (struct sockaddr *) & pgStatAddr, alen) < 0) + if (connect(pgStatSock, (struct sockaddr *) &pgStatAddr, alen) < 0) { ereport(LOG, (errcode_for_socket_access(), @@ -1107,7 +1107,7 @@ pgstat_vacuum_stat(void) if (msg.m_nentries >= PGSTAT_NUM_TABPURGE) { len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) - +msg.m_nentries * sizeof(Oid); + + msg.m_nentries * sizeof(Oid); pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE); msg.m_databaseid = MyDatabaseId; @@ -1123,7 +1123,7 @@ pgstat_vacuum_stat(void) if (msg.m_nentries > 0) { len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) - +msg.m_nentries * sizeof(Oid); + + msg.m_nentries * sizeof(Oid); pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE); msg.m_databaseid = MyDatabaseId; @@ -1167,7 +1167,7 @@ pgstat_vacuum_stat(void) if (f_msg.m_nentries >= PGSTAT_NUM_FUNCPURGE) { len = offsetof(PgStat_MsgFuncpurge, m_functionid[0]) - +f_msg.m_nentries * sizeof(Oid); + + f_msg.m_nentries * sizeof(Oid); pgstat_send(&f_msg, len); @@ -1181,7 +1181,7 @@ pgstat_vacuum_stat(void) if (f_msg.m_nentries > 0) { len = offsetof(PgStat_MsgFuncpurge, m_functionid[0]) - +f_msg.m_nentries * sizeof(Oid); + + f_msg.m_nentries * sizeof(Oid); pgstat_send(&f_msg, len); } @@ -1284,7 +1284,7 @@ pgstat_drop_relation(Oid relid) msg.m_tableid[0] = relid; msg.m_nentries = 1; - len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) +sizeof(Oid); + len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) + sizeof(Oid); pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE); msg.m_databaseid = MyDatabaseId; diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 5c79b1e40d1..a5d3575b209 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -340,6 +340,7 @@ static PMState pmState = PM_INIT; /* Start time of SIGKILL timeout during immediate shutdown or child crash */ /* Zero means timeout is not running */ static time_t AbortStartTime = 0; + /* Length of said timeout */ #define SIGKILL_CHILDREN_AFTER_SECS 5 @@ -1558,7 +1559,7 @@ checkDataDir(void) * cases are as shown in the code. */ static void -DetermineSleepTime(struct timeval * timeout) +DetermineSleepTime(struct timeval *timeout) { TimestampTz next_wakeup = 0; @@ -3541,16 +3542,16 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus) errhint("See C include file \"ntstatus.h\" for a description of the hexadecimal value."), activity ? errdetail("Failed process was running: %s", activity) : 0)); #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST - ereport(lev, - - /*------ - translator: %s is a noun phrase describing a child process, such as - "server process" */ - (errmsg("%s (PID %d) was terminated by signal %d: %s", - procname, pid, WTERMSIG(exitstatus), - WTERMSIG(exitstatus) < NSIG ? - sys_siglist[WTERMSIG(exitstatus)] : "(unknown)"), - activity ? errdetail("Failed process was running: %s", activity) : 0)); + ereport(lev, + + /*------ + translator: %s is a noun phrase describing a child process, such as + "server process" */ + (errmsg("%s (PID %d) was terminated by signal %d: %s", + procname, pid, WTERMSIG(exitstatus), + WTERMSIG(exitstatus) < NSIG ? + sys_siglist[WTERMSIG(exitstatus)] : "(unknown)"), + activity ? errdetail("Failed process was running: %s", activity) : 0)); #else ereport(lev, diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index 9f5ca5cac08..9828999eb84 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -797,7 +797,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer) int dest = LOG_DESTINATION_STDERR; /* While we have enough for a header, process data... */ - while (count >= (int) (offsetof(PipeProtoHeader, data) +1)) + while (count >= (int) (offsetof(PipeProtoHeader, data) + 1)) { PipeProtoHeader p; int chunklen; diff --git a/src/backend/regex/regc_color.c b/src/backend/regex/regc_color.c index 4b72894ad3a..823bec018fd 100644 --- a/src/backend/regex/regc_color.c +++ b/src/backend/regex/regc_color.c @@ -46,8 +46,8 @@ * initcm - set up new colormap */ static void -initcm(struct vars * v, - struct colormap * cm) +initcm(struct vars *v, + struct colormap *cm) { struct colordesc *cd; @@ -100,7 +100,7 @@ initcm(struct vars * v, * freecm - free dynamically-allocated things in a colormap */ static void -freecm(struct colormap * cm) +freecm(struct colormap *cm) { cm->magic = 0; if (cm->cd != cm->cdspace) @@ -117,7 +117,7 @@ freecm(struct colormap * cm) * pg_reg_getcolor - slow case of GETCOLOR() */ color -pg_reg_getcolor(struct colormap * cm, chr c) +pg_reg_getcolor(struct colormap *cm, chr c) { int rownum, colnum, @@ -169,7 +169,7 @@ pg_reg_getcolor(struct colormap * cm, chr c) * maxcolor - report largest color number in use */ static color -maxcolor(struct colormap * cm) +maxcolor(struct colormap *cm) { if (CISERR()) return COLORLESS; @@ -182,7 +182,7 @@ maxcolor(struct colormap * cm) * Beware: may relocate the colordescs. */ static color /* COLORLESS for error */ -newcolor(struct colormap * cm) +newcolor(struct colormap *cm) { struct colordesc *cd; size_t n; @@ -254,7 +254,7 @@ newcolor(struct colormap * cm) * freecolor - free a color (must have no arcs or subcolor) */ static void -freecolor(struct colormap * cm, +freecolor(struct colormap *cm, color co) { struct colordesc *cd = &cm->cd[co]; @@ -309,7 +309,7 @@ freecolor(struct colormap * cm, * pseudocolor - allocate a false color, to be managed by other means */ static color -pseudocolor(struct colormap * cm) +pseudocolor(struct colormap *cm) { color co; struct colordesc *cd; @@ -333,7 +333,7 @@ pseudocolor(struct colormap * cm) * This works only for chrs that map into the low color map. */ static color -subcolor(struct colormap * cm, chr c) +subcolor(struct colormap *cm, chr c) { color co; /* current color of c */ color sco; /* new subcolor */ @@ -363,7 +363,7 @@ subcolor(struct colormap * cm, chr c) * colormap, which do not necessarily correspond to exactly one chr code. */ static color -subcolorhi(struct colormap * cm, color *pco) +subcolorhi(struct colormap *cm, color *pco) { color co; /* current color of entry */ color sco; /* new subcolor */ @@ -386,7 +386,7 @@ subcolorhi(struct colormap * cm, color *pco) * newsub - allocate a new subcolor (if necessary) for a color */ static color -newsub(struct colormap * cm, +newsub(struct colormap *cm, color co) { color sco; /* new subcolor */ @@ -417,7 +417,7 @@ newsub(struct colormap * cm, * Returns array index of new row. Note the array might move. */ static int -newhicolorrow(struct colormap * cm, +newhicolorrow(struct colormap *cm, int oldrow) { int newrow = cm->hiarrayrows; @@ -466,7 +466,7 @@ newhicolorrow(struct colormap * cm, * Essentially, extends the 2-D array to the right with a copy of itself. */ static void -newhicolorcols(struct colormap * cm) +newhicolorcols(struct colormap *cm) { color *newarray; int r, @@ -519,10 +519,10 @@ newhicolorcols(struct colormap * cm) * mechanized with the "lastsubcolor" state variable. */ static void -subcolorcvec(struct vars * v, - struct cvec * cv, - struct state * lp, - struct state * rp) +subcolorcvec(struct vars *v, + struct cvec *cv, + struct state *lp, + struct state *rp) { struct colormap *cm = v->cm; color lastsubcolor = COLORLESS; @@ -621,10 +621,10 @@ subcolorcvec(struct vars * v, * to be able to handle both low and high chr codes. */ static void -subcoloronechr(struct vars * v, +subcoloronechr(struct vars *v, chr ch, - struct state * lp, - struct state * rp, + struct state *lp, + struct state *rp, color *lastsubcolor) { struct colormap *cm = v->cm; @@ -744,11 +744,11 @@ subcoloronechr(struct vars * v, * subcoloronerange - do subcolorcvec's work for a high range */ static void -subcoloronerange(struct vars * v, +subcoloronerange(struct vars *v, chr from, chr to, - struct state * lp, - struct state * rp, + struct state *lp, + struct state *rp, color *lastsubcolor) { struct colormap *cm = v->cm; @@ -882,10 +882,10 @@ subcoloronerange(struct vars * v, * subcoloronerow - do subcolorcvec's work for one new row in the high colormap */ static void -subcoloronerow(struct vars * v, +subcoloronerow(struct vars *v, int rownum, - struct state * lp, - struct state * rp, + struct state *lp, + struct state *rp, color *lastsubcolor) { struct colormap *cm = v->cm; @@ -913,8 +913,8 @@ subcoloronerow(struct vars * v, * okcolors - promote subcolors to full colors */ static void -okcolors(struct nfa * nfa, - struct colormap * cm) +okcolors(struct nfa *nfa, + struct colormap *cm) { struct colordesc *cd; struct colordesc *end = CDEND(cm); @@ -972,8 +972,8 @@ okcolors(struct nfa * nfa, * colorchain - add this arc to the color chain of its color */ static void -colorchain(struct colormap * cm, - struct arc * a) +colorchain(struct colormap *cm, + struct arc *a) { struct colordesc *cd = &cm->cd[a->co]; @@ -988,8 +988,8 @@ colorchain(struct colormap * cm, * uncolorchain - delete this arc from the color chain of its color */ static void -uncolorchain(struct colormap * cm, - struct arc * a) +uncolorchain(struct colormap *cm, + struct arc *a) { struct colordesc *cd = &cm->cd[a->co]; struct arc *aa = a->colorchainRev; @@ -1014,12 +1014,12 @@ uncolorchain(struct colormap * cm, * rainbow - add arcs of all full colors (but one) between specified states */ static void -rainbow(struct nfa * nfa, - struct colormap * cm, +rainbow(struct nfa *nfa, + struct colormap *cm, int type, color but, /* COLORLESS if no exceptions */ - struct state * from, - struct state * to) + struct state *from, + struct state *to) { struct colordesc *cd; struct colordesc *end = CDEND(cm); @@ -1037,13 +1037,13 @@ rainbow(struct nfa * nfa, * The calling sequence ought to be reconciled with cloneouts(). */ static void -colorcomplement(struct nfa * nfa, - struct colormap * cm, +colorcomplement(struct nfa *nfa, + struct colormap *cm, int type, - struct state * of, /* complements of this guy's PLAIN + struct state *of, /* complements of this guy's PLAIN * outarcs */ - struct state * from, - struct state * to) + struct state *from, + struct state *to) { struct colordesc *cd; struct colordesc *end = CDEND(cm); @@ -1063,7 +1063,7 @@ colorcomplement(struct nfa * nfa, * dumpcolors - debugging output */ static void -dumpcolors(struct colormap * cm, +dumpcolors(struct colormap *cm, FILE *f) { struct colordesc *cd; diff --git a/src/backend/regex/regc_cvec.c b/src/backend/regex/regc_cvec.c index 50b7a4574b4..10306215596 100644 --- a/src/backend/regex/regc_cvec.c +++ b/src/backend/regex/regc_cvec.c @@ -63,7 +63,7 @@ newcvec(int nchrs, /* to hold this many chrs... */ * Returns pointer as convenience. */ static struct cvec * -clearcvec(struct cvec * cv) +clearcvec(struct cvec *cv) { assert(cv != NULL); cv->nchrs = 0; @@ -76,7 +76,7 @@ clearcvec(struct cvec * cv) * addchr - add a chr to a cvec */ static void -addchr(struct cvec * cv, /* character vector */ +addchr(struct cvec *cv, /* character vector */ chr c) /* character to add */ { assert(cv->nchrs < cv->chrspace); @@ -87,7 +87,7 @@ addchr(struct cvec * cv, /* character vector */ * addrange - add a range to a cvec */ static void -addrange(struct cvec * cv, /* character vector */ +addrange(struct cvec *cv, /* character vector */ chr from, /* first character of range */ chr to) /* last character of range */ { @@ -109,7 +109,7 @@ addrange(struct cvec * cv, /* character vector */ * so transientness is a convenient behavior. */ static struct cvec * -getcvec(struct vars * v, /* context */ +getcvec(struct vars *v, /* context */ int nchrs, /* to hold this many chrs... */ int nranges) /* ... and this many ranges */ { @@ -132,7 +132,7 @@ getcvec(struct vars * v, /* context */ * freecvec - free a cvec */ static void -freecvec(struct cvec * cv) +freecvec(struct cvec *cv) { FREE(cv); } diff --git a/src/backend/regex/regc_lex.c b/src/backend/regex/regc_lex.c index cd34c8ae411..b2506ca814f 100644 --- a/src/backend/regex/regc_lex.c +++ b/src/backend/regex/regc_lex.c @@ -67,7 +67,7 @@ * lexstart - set up lexical stuff, scan leading options */ static void -lexstart(struct vars * v) +lexstart(struct vars *v) { prefixes(v); /* may turn on new type bits etc. */ NOERR(); @@ -96,7 +96,7 @@ lexstart(struct vars * v) * prefixes - implement various special prefixes */ static void -prefixes(struct vars * v) +prefixes(struct vars *v) { /* literal string doesn't get any of this stuff */ if (v->cflags & REG_QUOTE) @@ -200,7 +200,7 @@ prefixes(struct vars * v) * implicit assumptions about what sorts of strings can be subroutines. */ static void -lexnest(struct vars * v, +lexnest(struct vars *v, const chr *beginp, /* start of interpolation */ const chr *endp) /* one past end of interpolation */ { @@ -265,7 +265,7 @@ static const chr brbackw[] = { /* \w within brackets */ * Possibly ought to inquire whether there is a "word" character class. */ static void -lexword(struct vars * v) +lexword(struct vars *v) { lexnest(v, backw, ENDOF(backw)); } @@ -274,7 +274,7 @@ lexword(struct vars * v) * next - get next token */ static int /* 1 normal, 0 failure */ -next(struct vars * v) +next(struct vars *v) { chr c; @@ -384,7 +384,7 @@ next(struct vars * v) else FAILW(REG_BADBR); break; - case CHR('\\'): /* BRE bound ends with \} */ + case CHR('\\'): /* BRE bound ends with \} */ if (INCON(L_BBND) && NEXT1('}')) { v->now++; @@ -476,7 +476,7 @@ next(struct vars * v) NOTE(REG_ULOCALE); RET(CCLASS); break; - default: /* oops */ + default: /* oops */ v->now--; RETV(PLAIN, c); break; @@ -671,7 +671,7 @@ next(struct vars * v) case CHR('$'): RET('$'); break; - case CHR('\\'): /* mostly punt backslashes to code below */ + case CHR('\\'): /* mostly punt backslashes to code below */ if (ATEOS()) FAILW(REG_EESCAPE); break; @@ -734,7 +734,7 @@ next(struct vars * v) * Note slightly nonstandard use of the CCLASS type code. */ static int /* not actually used, but convenient for RETV */ -lexescape(struct vars * v) +lexescape(struct vars *v) { chr c; static const chr alert[] = { @@ -904,7 +904,7 @@ lexescape(struct vars * v) * if maxlen is large enough to make that possible. */ static chr /* chr value; errors signalled via ERR */ -lexdigits(struct vars * v, +lexdigits(struct vars *v, int base, int minlen, int maxlen) @@ -985,7 +985,7 @@ lexdigits(struct vars * v, * context-dependency of some things. */ static int /* 1 normal, 0 failure */ -brenext(struct vars * v, +brenext(struct vars *v, chr c) { switch (c) @@ -1106,7 +1106,7 @@ brenext(struct vars * v, * skip - skip white space and comments in expanded form */ static void -skip(struct vars * v) +skip(struct vars *v) { const chr *start = v->now; @@ -1146,7 +1146,7 @@ newline(void) * use that it hardly matters. */ static chr -chrnamed(struct vars * v, +chrnamed(struct vars *v, const chr *startp, /* start of name */ const chr *endp, /* just past end of name */ chr lastresort) /* what to return if name lookup fails */ diff --git a/src/backend/regex/regc_locale.c b/src/backend/regex/regc_locale.c index 7cb3a40a0c8..acae90abce2 100644 --- a/src/backend/regex/regc_locale.c +++ b/src/backend/regex/regc_locale.c @@ -56,7 +56,7 @@ static const struct cname { const char *name; const char code; -} cnames[] = +} cnames[] = { { @@ -377,7 +377,7 @@ enum classes * element - map collating-element name to chr */ static chr -element(struct vars * v, /* context */ +element(struct vars *v, /* context */ const chr *startp, /* points to start of name */ const chr *endp) /* points just past end of name */ { @@ -413,7 +413,7 @@ element(struct vars * v, /* context */ * range - supply cvec for a range, including legality check */ static struct cvec * -range(struct vars * v, /* context */ +range(struct vars *v, /* context */ chr a, /* range start */ chr b, /* range end, might equal a */ int cases) /* case-independent? */ @@ -505,7 +505,7 @@ before(chr x, chr y) * Must include case counterparts on request. */ static struct cvec * -eclass(struct vars * v, /* context */ +eclass(struct vars *v, /* context */ chr c, /* Collating element representing the * equivalence class. */ int cases) /* all cases? */ @@ -545,14 +545,14 @@ eclass(struct vars * v, /* context */ * because callers are not supposed to explicitly free the result either way. */ static struct cvec * -cclass(struct vars * v, /* context */ +cclass(struct vars *v, /* context */ const chr *startp, /* where the name starts */ const chr *endp, /* just past the end of the name */ int cases) /* case-independent? */ { size_t len; struct cvec *cv = NULL; - const char *const * namePtr; + const char *const *namePtr; int i, index; @@ -669,7 +669,7 @@ cclass(struct vars * v, /* context */ * cclass_column_index - get appropriate high colormap column index for chr */ static int -cclass_column_index(struct colormap * cm, chr c) +cclass_column_index(struct colormap *cm, chr c) { int colnum = 0; @@ -713,7 +713,7 @@ cclass_column_index(struct colormap * cm, chr c) * messy cases are done via range(). */ static struct cvec * -allcases(struct vars * v, /* context */ +allcases(struct vars *v, /* context */ chr c) /* character to get case equivs of */ { struct cvec *cv; diff --git a/src/backend/regex/regc_nfa.c b/src/backend/regex/regc_nfa.c index 90dca5d9dea..2179a38a228 100644 --- a/src/backend/regex/regc_nfa.c +++ b/src/backend/regex/regc_nfa.c @@ -44,9 +44,9 @@ * newnfa - set up an NFA */ static struct nfa * /* the NFA, or NULL */ -newnfa(struct vars * v, - struct colormap * cm, - struct nfa * parent) /* NULL if primary NFA */ +newnfa(struct vars *v, + struct colormap *cm, + struct nfa *parent) /* NULL if primary NFA */ { struct nfa *nfa; @@ -95,7 +95,7 @@ newnfa(struct vars * v, * freenfa - free an entire NFA */ static void -freenfa(struct nfa * nfa) +freenfa(struct nfa *nfa) { struct state *s; @@ -121,7 +121,7 @@ freenfa(struct nfa * nfa) * newstate - allocate an NFA state, with zero flag value */ static struct state * /* NULL on error */ -newstate(struct nfa * nfa) +newstate(struct nfa *nfa) { struct state *s; @@ -185,7 +185,7 @@ newstate(struct nfa * nfa) * newfstate - allocate an NFA state with a specified flag value */ static struct state * /* NULL on error */ -newfstate(struct nfa * nfa, int flag) +newfstate(struct nfa *nfa, int flag) { struct state *s; @@ -199,8 +199,8 @@ newfstate(struct nfa * nfa, int flag) * dropstate - delete a state's inarcs and outarcs and free it */ static void -dropstate(struct nfa * nfa, - struct state * s) +dropstate(struct nfa *nfa, + struct state *s) { struct arc *a; @@ -215,8 +215,8 @@ dropstate(struct nfa * nfa, * freestate - free a state, which has no in-arcs or out-arcs */ static void -freestate(struct nfa * nfa, - struct state * s) +freestate(struct nfa *nfa, + struct state *s) { assert(s != NULL); assert(s->nins == 0 && s->nouts == 0); @@ -246,8 +246,8 @@ freestate(struct nfa * nfa, * destroystate - really get rid of an already-freed state */ static void -destroystate(struct nfa * nfa, - struct state * s) +destroystate(struct nfa *nfa, + struct state *s) { struct arcbatch *ab; struct arcbatch *abnext; @@ -273,11 +273,11 @@ destroystate(struct nfa * nfa, * In general we never want duplicates. */ static void -newarc(struct nfa * nfa, +newarc(struct nfa *nfa, int t, color co, - struct state * from, - struct state * to) + struct state *from, + struct state *to) { struct arc *a; @@ -319,11 +319,11 @@ newarc(struct nfa * nfa, * identical arc (same type/color/from/to). */ static void -createarc(struct nfa * nfa, +createarc(struct nfa *nfa, int t, color co, - struct state * from, - struct state * to) + struct state *from, + struct state *to) { struct arc *a; @@ -365,8 +365,8 @@ createarc(struct nfa * nfa, * allocarc - allocate a new out-arc within a state */ static struct arc * /* NULL for failure */ -allocarc(struct nfa * nfa, - struct state * s) +allocarc(struct nfa *nfa, + struct state *s) { struct arc *a; @@ -418,8 +418,8 @@ allocarc(struct nfa * nfa, * freearc - free an arc */ static void -freearc(struct nfa * nfa, - struct arc * victim) +freearc(struct nfa *nfa, + struct arc *victim) { struct state *from = victim->from; struct state *to = victim->to; @@ -492,7 +492,7 @@ freearc(struct nfa * nfa, * a similar changearcsource function. */ static void -changearctarget(struct arc * a, struct state * newto) +changearctarget(struct arc *a, struct state *newto) { struct state *oldto = a->to; struct arc *predecessor; @@ -534,7 +534,7 @@ changearctarget(struct arc * a, struct state * newto) * hasnonemptyout - Does state have a non-EMPTY out arc? */ static int -hasnonemptyout(struct state * s) +hasnonemptyout(struct state *s) { struct arc *a; @@ -551,7 +551,7 @@ hasnonemptyout(struct state * s) * If there is more than one such arc, the result is random. */ static struct arc * -findarc(struct state * s, +findarc(struct state *s, int type, color co) { @@ -567,10 +567,10 @@ findarc(struct state * s, * cparc - allocate a new arc within an NFA, copying details from old one */ static void -cparc(struct nfa * nfa, - struct arc * oa, - struct state * from, - struct state * to) +cparc(struct nfa *nfa, + struct arc *oa, + struct state *from, + struct state *to) { newarc(nfa, oa->type, oa->co, from, to); } @@ -579,8 +579,8 @@ cparc(struct nfa * nfa, * sortins - sort the in arcs of a state by from/color/type */ static void -sortins(struct nfa * nfa, - struct state * s) +sortins(struct nfa *nfa, + struct state *s) { struct arc **sortarray; struct arc *a; @@ -623,8 +623,8 @@ sortins(struct nfa * nfa, static int sortins_cmp(const void *a, const void *b) { - const struct arc *aa = *((const struct arc * const *) a); - const struct arc *bb = *((const struct arc * const *) b); + const struct arc *aa = *((const struct arc *const *) a); + const struct arc *bb = *((const struct arc *const *) b); /* we check the fields in the order they are most likely to be different */ if (aa->from->no < bb->from->no) @@ -646,8 +646,8 @@ sortins_cmp(const void *a, const void *b) * sortouts - sort the out arcs of a state by to/color/type */ static void -sortouts(struct nfa * nfa, - struct state * s) +sortouts(struct nfa *nfa, + struct state *s) { struct arc **sortarray; struct arc *a; @@ -690,8 +690,8 @@ sortouts(struct nfa * nfa, static int sortouts_cmp(const void *a, const void *b) { - const struct arc *aa = *((const struct arc * const *) a); - const struct arc *bb = *((const struct arc * const *) b); + const struct arc *aa = *((const struct arc *const *) a); + const struct arc *bb = *((const struct arc *const *) b); /* we check the fields in the order they are most likely to be different */ if (aa->to->no < bb->to->no) @@ -733,9 +733,9 @@ sortouts_cmp(const void *a, const void *b) * the arc lists, and then we can indeed just update the arcs in-place. */ static void -moveins(struct nfa * nfa, - struct state * oldState, - struct state * newState) +moveins(struct nfa *nfa, + struct state *oldState, + struct state *newState) { assert(oldState != newState); @@ -825,9 +825,9 @@ moveins(struct nfa * nfa, * copyins - copy in arcs of a state to another state */ static void -copyins(struct nfa * nfa, - struct state * oldState, - struct state * newState) +copyins(struct nfa *nfa, + struct state *oldState, + struct state *newState) { assert(oldState != newState); @@ -907,9 +907,9 @@ copyins(struct nfa * nfa, * and are not guaranteed unique. It's okay to clobber the array contents. */ static void -mergeins(struct nfa * nfa, - struct state * s, - struct arc ** arcarray, +mergeins(struct nfa *nfa, + struct state *s, + struct arc **arcarray, int arccount) { struct arc *na; @@ -1004,9 +1004,9 @@ mergeins(struct nfa * nfa, * moveouts - move all out arcs of a state to another state */ static void -moveouts(struct nfa * nfa, - struct state * oldState, - struct state * newState) +moveouts(struct nfa *nfa, + struct state *oldState, + struct state *newState) { assert(oldState != newState); @@ -1093,9 +1093,9 @@ moveouts(struct nfa * nfa, * copyouts - copy out arcs of a state to another state */ static void -copyouts(struct nfa * nfa, - struct state * oldState, - struct state * newState) +copyouts(struct nfa *nfa, + struct state *oldState, + struct state *newState) { assert(oldState != newState); @@ -1172,10 +1172,10 @@ copyouts(struct nfa * nfa, * cloneouts - copy out arcs of a state to another state pair, modifying type */ static void -cloneouts(struct nfa * nfa, - struct state * old, - struct state * from, - struct state * to, +cloneouts(struct nfa *nfa, + struct state *old, + struct state *from, + struct state *to, int type) { struct arc *a; @@ -1193,9 +1193,9 @@ cloneouts(struct nfa * nfa, * states using their tmp pointer. */ static void -delsub(struct nfa * nfa, - struct state * lp, /* the sub-NFA goes from here... */ - struct state * rp) /* ...to here, *not* inclusive */ +delsub(struct nfa *nfa, + struct state *lp, /* the sub-NFA goes from here... */ + struct state *rp) /* ...to here, *not* inclusive */ { assert(lp != rp); @@ -1216,9 +1216,9 @@ delsub(struct nfa * nfa, * This routine's basic job is to destroy all out-arcs of the state. */ static void -deltraverse(struct nfa * nfa, - struct state * leftend, - struct state * s) +deltraverse(struct nfa *nfa, + struct state *leftend, + struct state *s) { struct arc *a; struct state *to; @@ -1267,11 +1267,11 @@ deltraverse(struct nfa * nfa, * it's a state pointer, didn't you? :-)) */ static void -dupnfa(struct nfa * nfa, - struct state * start, /* duplicate of subNFA starting here */ - struct state * stop, /* and stopping here */ - struct state * from, /* stringing duplicate from here */ - struct state * to) /* to here */ +dupnfa(struct nfa *nfa, + struct state *start, /* duplicate of subNFA starting here */ + struct state *stop, /* and stopping here */ + struct state *from, /* stringing duplicate from here */ + struct state *to) /* to here */ { if (start == stop) { @@ -1291,9 +1291,9 @@ dupnfa(struct nfa * nfa, * duptraverse - recursive heart of dupnfa */ static void -duptraverse(struct nfa * nfa, - struct state * s, - struct state * stmp) /* s's duplicate, or NULL */ +duptraverse(struct nfa *nfa, + struct state *s, + struct state *stmp) /* s's duplicate, or NULL */ { struct arc *a; @@ -1328,8 +1328,8 @@ duptraverse(struct nfa * nfa, * cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set */ static void -cleartraverse(struct nfa * nfa, - struct state * s) +cleartraverse(struct nfa *nfa, + struct state *s) { struct arc *a; @@ -1365,7 +1365,7 @@ cleartraverse(struct nfa * nfa, * that implementation detail not create user-visible performance differences. */ static struct state * -single_color_transition(struct state * s1, struct state * s2) +single_color_transition(struct state *s1, struct state *s2) { struct arc *a; @@ -1395,7 +1395,7 @@ single_color_transition(struct state * s1, struct state * s2) * specialcolors - fill in special colors for an NFA */ static void -specialcolors(struct nfa * nfa) +specialcolors(struct nfa *nfa) { /* false colors for BOS, BOL, EOS, EOL */ if (nfa->parent == NULL) @@ -1434,7 +1434,7 @@ specialcolors(struct nfa * nfa) * without making any progress in the input string. */ static long /* re_info bits */ -optimize(struct nfa * nfa, +optimize(struct nfa *nfa, FILE *f) /* for debug output; NULL none */ { #ifdef REG_DEBUG @@ -1474,7 +1474,7 @@ optimize(struct nfa * nfa, * pullback - pull back constraints backward to eliminate them */ static void -pullback(struct nfa * nfa, +pullback(struct nfa *nfa, FILE *f) /* for debug output; NULL none */ { struct state *s; @@ -1554,9 +1554,9 @@ pullback(struct nfa * nfa, * through their tmp fields). */ static int -pull(struct nfa * nfa, - struct arc * con, - struct state ** intermediates) +pull(struct nfa *nfa, + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1641,7 +1641,7 @@ pull(struct nfa * nfa, * pushfwd - push forward constraints forward to eliminate them */ static void -pushfwd(struct nfa * nfa, +pushfwd(struct nfa *nfa, FILE *f) /* for debug output; NULL none */ { struct state *s; @@ -1721,9 +1721,9 @@ pushfwd(struct nfa * nfa, * through their tmp fields). */ static int -push(struct nfa * nfa, - struct arc * con, - struct state ** intermediates) +push(struct nfa *nfa, + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1812,8 +1812,8 @@ push(struct nfa * nfa, * #def COMPATIBLE 3 // compatible but not satisfied yet */ static int -combine(struct arc * con, - struct arc * a) +combine(struct arc *con, + struct arc *a) { #define CA(ct,at) (((ct)<<CHAR_BIT) | (at)) @@ -1866,7 +1866,7 @@ combine(struct arc * con, * fixempties - get rid of EMPTY arcs */ static void -fixempties(struct nfa * nfa, +fixempties(struct nfa *nfa, FILE *f) /* for debug output; NULL none */ { struct state *s; @@ -2093,10 +2093,10 @@ fixempties(struct nfa * nfa, * the NFA ... but that could still be enough to cause trouble. */ static struct state * -emptyreachable(struct nfa * nfa, - struct state * s, - struct state * lastfound, - struct arc ** inarcsorig) +emptyreachable(struct nfa *nfa, + struct state *s, + struct state *lastfound, + struct arc **inarcsorig) { struct arc *a; @@ -2121,7 +2121,7 @@ emptyreachable(struct nfa * nfa, * isconstraintarc - detect whether an arc is of a constraint type */ static inline int -isconstraintarc(struct arc * a) +isconstraintarc(struct arc *a) { switch (a->type) { @@ -2139,7 +2139,7 @@ isconstraintarc(struct arc * a) * hasconstraintout - does state have a constraint out arc? */ static int -hasconstraintout(struct state * s) +hasconstraintout(struct state *s) { struct arc *a; @@ -2160,7 +2160,7 @@ hasconstraintout(struct state * s) * of such loops before doing that. */ static void -fixconstraintloops(struct nfa * nfa, +fixconstraintloops(struct nfa *nfa, FILE *f) /* for debug output; NULL none */ { struct state *s; @@ -2259,7 +2259,7 @@ restart: * of the NFA ... but that could still be enough to cause trouble. */ static int -findconstraintloop(struct nfa * nfa, struct state * s) +findconstraintloop(struct nfa *nfa, struct state *s) { struct arc *a; @@ -2348,7 +2348,7 @@ findconstraintloop(struct nfa * nfa, struct state * s) * break the loop just by removing those loop arcs, with no new states added. */ static void -breakconstraintloop(struct nfa * nfa, struct state * sinitial) +breakconstraintloop(struct nfa *nfa, struct state *sinitial) { struct state *s; struct state *shead; @@ -2494,11 +2494,11 @@ breakconstraintloop(struct nfa * nfa, struct state * sinitial) * successor states. */ static void -clonesuccessorstates(struct nfa * nfa, - struct state * ssource, - struct state * sclone, - struct state * spredecessor, - struct arc * refarc, +clonesuccessorstates(struct nfa *nfa, + struct state *ssource, + struct state *sclone, + struct state *spredecessor, + struct arc *refarc, char *curdonemap, char *outerdonemap, int nstates) @@ -2726,7 +2726,7 @@ clonesuccessorstates(struct nfa * nfa, * cleanup - clean up NFA after optimizations */ static void -cleanup(struct nfa * nfa) +cleanup(struct nfa *nfa) { struct state *s; struct state *nexts; @@ -2761,10 +2761,10 @@ cleanup(struct nfa * nfa) * markreachable - recursive marking of reachable states */ 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 */ +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 arc *a; @@ -2787,10 +2787,10 @@ markreachable(struct nfa * nfa, * markcanreach - recursive marking of states which can reach here */ static void -markcanreach(struct nfa * nfa, - struct state * s, - struct state * okay, /* consider only states with this mark */ - struct state * mark) /* the value to mark with */ +markcanreach(struct nfa *nfa, + struct state *s, + struct state *okay, /* consider only states with this mark */ + struct state *mark) /* the value to mark with */ { struct arc *a; @@ -2813,7 +2813,7 @@ markcanreach(struct nfa * nfa, * analyze - ascertain potentially-useful facts about an optimized NFA */ static long /* re_info bits to be ORed in */ -analyze(struct nfa * nfa) +analyze(struct nfa *nfa) { struct arc *a; struct arc *aa; @@ -2834,8 +2834,8 @@ analyze(struct nfa * nfa) * compact - construct the compact representation of an NFA */ static void -compact(struct nfa * nfa, - struct cnfa * cnfa) +compact(struct nfa *nfa, + struct cnfa *cnfa) { struct state *s; struct arc *a; @@ -2922,7 +2922,7 @@ compact(struct nfa * nfa, * carcsort - sort compacted-NFA arcs by color */ static void -carcsort(struct carc * first, size_t n) +carcsort(struct carc *first, size_t n) { if (n > 1) qsort(first, n, sizeof(struct carc), carc_cmp); @@ -2949,7 +2949,7 @@ carc_cmp(const void *a, const void *b) * freecnfa - free a compacted NFA */ static void -freecnfa(struct cnfa * cnfa) +freecnfa(struct cnfa *cnfa) { assert(cnfa->nstates != 0); /* not empty already */ cnfa->nstates = 0; @@ -2962,7 +2962,7 @@ freecnfa(struct cnfa * cnfa) * dumpnfa - dump an NFA in human-readable form */ static void -dumpnfa(struct nfa * nfa, +dumpnfa(struct nfa *nfa, FILE *f) { #ifdef REG_DEBUG @@ -2999,7 +2999,7 @@ dumpnfa(struct nfa * nfa, * dumpstate - dump an NFA state in human-readable form */ static void -dumpstate(struct state * s, +dumpstate(struct state *s, FILE *f) { struct arc *a; @@ -3025,7 +3025,7 @@ dumpstate(struct state * s, * dumparcs - dump out-arcs in human-readable form */ static void -dumparcs(struct state * s, +dumparcs(struct state *s, FILE *f) { int pos; @@ -3057,8 +3057,8 @@ dumparcs(struct state * s, * dumparc - dump one outarc in readable form, including prefixing tab */ static void -dumparc(struct arc * a, - struct state * s, +dumparc(struct arc *a, + struct state *s, FILE *f) { struct arc *aa; @@ -3121,7 +3121,7 @@ dumparc(struct arc * a, */ #ifdef REG_DEBUG static void -dumpcnfa(struct cnfa * cnfa, +dumpcnfa(struct cnfa *cnfa, FILE *f) { int st; @@ -3151,7 +3151,7 @@ dumpcnfa(struct cnfa * cnfa, */ static void dumpcstate(int st, - struct cnfa * cnfa, + struct cnfa *cnfa, FILE *f) { struct carc *ca; diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 0834ae6e064..777373e691a 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -491,14 +491,14 @@ pg_regcomp(regex_t *re, * moresubs - enlarge subRE vector */ static void -moresubs(struct vars * v, +moresubs(struct vars *v, int wanted) /* want enough room for this one */ { struct subre **p; size_t n; assert(wanted > 0 && (size_t) wanted >= v->nsubs); - n = (size_t) wanted *3 / 2 + 1; + n = (size_t) wanted * 3 / 2 + 1; if (v->subs == v->sub10) { @@ -528,7 +528,7 @@ moresubs(struct vars * v, * (if any), to make error-handling code terser. */ static int -freev(struct vars * v, +freev(struct vars *v, int err) { if (v->re != NULL) @@ -557,8 +557,8 @@ freev(struct vars * v, * NFA must have been optimize()d already. */ static void -makesearch(struct vars * v, - struct nfa * nfa) +makesearch(struct vars *v, + struct nfa *nfa) { struct arc *a; struct arc *b; @@ -646,11 +646,11 @@ makesearch(struct vars * v, * of a chain of '|' subres. */ static struct subre * -parse(struct vars * v, +parse(struct vars *v, int stopper, /* EOS or ')' */ int type, /* LACON (lookaround subRE) or PLAIN */ - struct state * init, /* initial state */ - struct state * final) /* final state */ + struct state *init, /* initial state */ + struct state *final) /* final state */ { struct state *left; /* scaffolding for branch */ struct state *right; @@ -725,11 +725,11 @@ parse(struct vars * v, * ',' nodes introduced only when necessary due to substructure. */ static struct subre * -parsebranch(struct vars * v, +parsebranch(struct vars *v, int stopper, /* EOS or ')' */ int type, /* LACON (lookaround subRE) or PLAIN */ - struct state * left, /* leftmost state */ - struct state * right, /* rightmost state */ + struct state *left, /* leftmost state */ + struct state *right, /* rightmost state */ int partial) /* is this only part of a branch? */ { struct state *lp; /* left end of current construct */ @@ -774,12 +774,12 @@ parsebranch(struct vars * v, * of the branch, making this function's name somewhat inaccurate. */ static void -parseqatom(struct vars * v, +parseqatom(struct vars *v, int stopper, /* EOS or ')' */ int type, /* LACON (lookaround subRE) or PLAIN */ - struct state * lp, /* left state to hang it on */ - struct state * rp, /* right state to hang it on */ - struct subre * top) /* subtree top */ + struct state *lp, /* left state to hang it on */ + struct state *rp, /* right state to hang it on */ + struct subre *top) /* subtree top */ { struct state *s; /* temporaries for new states */ struct state *s2; @@ -1222,10 +1222,10 @@ parseqatom(struct vars * v, * nonword - generate arcs for non-word-character ahead or behind */ static void -nonword(struct vars * v, +nonword(struct vars *v, int dir, /* AHEAD or BEHIND */ - struct state * lp, - struct state * rp) + struct state *lp, + struct state *rp) { int anchor = (dir == AHEAD) ? '$' : '^'; @@ -1240,10 +1240,10 @@ nonword(struct vars * v, * word - generate arcs for word character ahead or behind */ static void -word(struct vars * v, +word(struct vars *v, int dir, /* AHEAD or BEHIND */ - struct state * lp, - struct state * rp) + struct state *lp, + struct state *rp) { assert(dir == AHEAD || dir == BEHIND); cloneouts(v->nfa, v->wordchrs, lp, rp, dir); @@ -1254,7 +1254,7 @@ word(struct vars * v, * scannum - scan a number */ static int /* value, <= DUPMAX */ -scannum(struct vars * v) +scannum(struct vars *v) { int n = 0; @@ -1285,9 +1285,9 @@ scannum(struct vars * v) * code in parse(), and when this is called, it doesn't matter any more. */ static void -repeat(struct vars * v, - struct state * lp, - struct state * rp, +repeat(struct vars *v, + struct state *lp, + struct state *rp, int m, int n) { @@ -1371,9 +1371,9 @@ repeat(struct vars * v, * Also called from cbracket for complemented bracket expressions. */ static void -bracket(struct vars * v, - struct state * lp, - struct state * rp) +bracket(struct vars *v, + struct state *lp, + struct state *rp) { assert(SEE('[')); NEXT(); @@ -1390,9 +1390,9 @@ bracket(struct vars * v, * arcs as the b.e. is seen... but that gets messy. */ static void -cbracket(struct vars * v, - struct state * lp, - struct state * rp) +cbracket(struct vars *v, + struct state *lp, + struct state *rp) { struct state *left = newstate(v->nfa); struct state *right = newstate(v->nfa); @@ -1420,9 +1420,9 @@ cbracket(struct vars * v, * brackpart - handle one item (or range) within a bracket expression */ static void -brackpart(struct vars * v, - struct state * lp, - struct state * rp) +brackpart(struct vars *v, + struct state *lp, + struct state *rp) { chr startc; chr endc; @@ -1533,7 +1533,7 @@ brackpart(struct vars * v, * to look past the final bracket of the [. etc. */ static const chr * /* just after end of sequence */ -scanplain(struct vars * v) +scanplain(struct vars *v) { const chr *endp; @@ -1558,10 +1558,10 @@ scanplain(struct vars * v) * This is mostly a shortcut for efficient handling of the common case. */ static void -onechr(struct vars * v, +onechr(struct vars *v, chr c, - struct state * lp, - struct state * rp) + struct state *lp, + struct state *rp) { if (!(v->cflags & REG_ICASE)) { @@ -1585,7 +1585,7 @@ onechr(struct vars * v, * should be cleaned up to reduce dependencies on input scanning. */ static void -wordchrs(struct vars * v) +wordchrs(struct vars *v) { struct state *left; struct state *right; @@ -1617,12 +1617,12 @@ wordchrs(struct vars * v) * can be optimized. */ static void -processlacon(struct vars * v, - struct state * begin, /* start of parsed LACON sub-re */ - struct state * end, /* end of parsed LACON sub-re */ +processlacon(struct vars *v, + 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 */ - struct state * rp) /* right state to hang it on */ + struct state *lp, /* left state to hang it on */ + struct state *rp) /* right state to hang it on */ { struct state *s1; int n; @@ -1683,11 +1683,11 @@ processlacon(struct vars * v, * subre - allocate a subre */ static struct subre * -subre(struct vars * v, +subre(struct vars *v, int op, int flags, - struct state * begin, - struct state * end) + struct state *begin, + struct state *end) { struct subre *ret = v->treefree; @@ -1735,8 +1735,8 @@ subre(struct vars * v, * freesubre - free a subRE subtree */ static void -freesubre(struct vars * v, /* might be NULL */ - struct subre * sr) +freesubre(struct vars *v, /* might be NULL */ + struct subre *sr) { if (sr == NULL) return; @@ -1753,8 +1753,8 @@ freesubre(struct vars * v, /* might be NULL */ * freesrnode - free one node in a subRE subtree */ static void -freesrnode(struct vars * v, /* might be NULL */ - struct subre * sr) +freesrnode(struct vars *v, /* might be NULL */ + struct subre *sr) { if (sr == NULL) return; @@ -1777,8 +1777,8 @@ freesrnode(struct vars * v, /* might be NULL */ * optst - optimize a subRE subtree */ static void -optst(struct vars * v, - struct subre * t) +optst(struct vars *v, + struct subre *t) { /* * DGP (2007-11-13): I assume it was the programmer's intent to eventually @@ -1793,7 +1793,7 @@ optst(struct vars * v, * numst - number tree nodes (assigning "id" indexes) */ static int /* next number */ -numst(struct subre * t, +numst(struct subre *t, int start) /* starting point for subtree numbers */ { int i; @@ -1827,7 +1827,7 @@ numst(struct subre * t, * in or between these two functions. */ static void -markst(struct subre * t) +markst(struct subre *t) { assert(t != NULL); @@ -1842,7 +1842,7 @@ markst(struct subre * t) * cleanst - free any tree nodes not marked INUSE */ static void -cleanst(struct vars * v) +cleanst(struct vars *v) { struct subre *t; struct subre *next; @@ -1861,8 +1861,8 @@ cleanst(struct vars * v) * nfatree - turn a subRE subtree into a tree of compacted NFAs */ static long /* optimize results from top node */ -nfatree(struct vars * v, - struct subre * t, +nfatree(struct vars *v, + struct subre *t, FILE *f) /* for debug output */ { assert(t != NULL && t->begin != NULL); @@ -1881,8 +1881,8 @@ nfatree(struct vars * v, * If converttosearch is true, apply makesearch() to the NFA. */ static long /* optimize results */ -nfanode(struct vars * v, - struct subre * t, +nfanode(struct vars *v, + struct subre *t, int converttosearch, FILE *f) /* for debug output */ { @@ -1920,9 +1920,9 @@ nfanode(struct vars * v, * newlacon - allocate a lookaround-constraint subRE */ static int /* lacon number */ -newlacon(struct vars * v, - struct state * begin, - struct state * end, +newlacon(struct vars *v, + struct state *begin, + struct state *end, int latype) { int n; @@ -1959,7 +1959,7 @@ newlacon(struct vars * v, * freelacons - free lookaround-constraint subRE vector */ static void -freelacons(struct subre * subs, +freelacons(struct subre *subs, int n) { struct subre *sub; @@ -2102,7 +2102,7 @@ dump(regex_t *re, * dumpst - dump a subRE tree */ static void -dumpst(struct subre * t, +dumpst(struct subre *t, FILE *f, int nfapresent) /* is the original NFA still around? */ { @@ -2117,7 +2117,7 @@ dumpst(struct subre * t, * stdump - recursive guts of dumpst */ static void -stdump(struct subre * t, +stdump(struct subre *t, FILE *f, int nfapresent) /* is the original NFA still around? */ { @@ -2167,7 +2167,7 @@ stdump(struct subre * t, * stid - identify a subtree node for dumping */ static const char * /* points to buf or constant string */ -stid(struct subre * t, +stid(struct subre *t, char *buf, size_t bufsize) { diff --git a/src/backend/regex/rege_dfa.c b/src/backend/regex/rege_dfa.c index b98c9d39021..366b79f492f 100644 --- a/src/backend/regex/rege_dfa.c +++ b/src/backend/regex/rege_dfa.c @@ -39,8 +39,8 @@ * Internal errors also return NULL, with v->err set. */ static chr * -longest(struct vars * v, - struct dfa * d, +longest(struct vars *v, + struct dfa *d, chr *start, /* where the match should start */ chr *stop, /* match must end at or before here */ int *hitstopp) /* record whether hit v->stop, if non-NULL */ @@ -165,8 +165,8 @@ longest(struct vars * v, * Internal errors also return NULL, with v->err set. */ static chr * -shortest(struct vars * v, - struct dfa * d, +shortest(struct vars *v, + struct dfa *d, chr *start, /* where the match should start */ chr *min, /* match must end at or after here */ chr *max, /* match must end at or before here */ @@ -300,10 +300,10 @@ shortest(struct vars * v, * Internal errors also return 0, with v->err set. */ static int -matchuntil(struct vars * v, - struct dfa * d, +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; @@ -414,8 +414,8 @@ matchuntil(struct vars * v, * lastcold - determine last point at which no progress had been made */ static chr * /* endpoint, or NULL */ -lastcold(struct vars * v, - struct dfa * d) +lastcold(struct vars *v, + struct dfa *d) { struct sset *ss; chr *nopr; @@ -434,10 +434,10 @@ lastcold(struct vars * v, * newdfa - set up a fresh DFA */ static struct dfa * -newdfa(struct vars * v, - struct cnfa * cnfa, - struct colormap * cm, - struct smalldfa * sml) /* preallocated space, may be NULL */ +newdfa(struct vars *v, + struct cnfa *cnfa, + struct colormap *cm, + struct smalldfa *sml) /* preallocated space, may be NULL */ { struct dfa *d; size_t nss = cnfa->nstates * 2; @@ -514,7 +514,7 @@ newdfa(struct vars * v, * freedfa - free a DFA */ static void -freedfa(struct dfa * d) +freedfa(struct dfa *d) { if (d->cptsmalloced) { @@ -554,8 +554,8 @@ hash(unsigned *uv, * initialize - hand-craft a cache entry for startup, otherwise get ready */ static struct sset * -initialize(struct vars * v, - struct dfa * d, +initialize(struct vars *v, + struct dfa *d, chr *start) { struct sset *ss; @@ -600,9 +600,9 @@ initialize(struct vars * v, * Internal errors also return NULL, with v->err set. */ static struct sset * -miss(struct vars * v, - struct dfa * d, - struct sset * css, +miss(struct vars *v, + struct dfa *d, + struct sset *css, color co, chr *cp, /* next chr */ chr *start) /* where the attempt got started */ @@ -740,8 +740,8 @@ miss(struct vars * v, * lacon - lookaround-constraint checker for miss() */ static int /* predicate: constraint satisfied? */ -lacon(struct vars * v, - struct cnfa * pcnfa, /* parent cnfa */ +lacon(struct vars *v, + struct cnfa *pcnfa, /* parent cnfa */ chr *cp, color co) /* "color" of the lookaround constraint */ { @@ -797,8 +797,8 @@ lacon(struct vars * v, * clear the innards of the state set -- that's up to the caller. */ static struct sset * -getvacant(struct vars * v, - struct dfa * d, +getvacant(struct vars *v, + struct dfa *d, chr *cp, chr *start) { @@ -868,8 +868,8 @@ getvacant(struct vars * v, * pickss - pick the next stateset to be used */ static struct sset * -pickss(struct vars * v, - struct dfa * d, +pickss(struct vars *v, + struct dfa *d, chr *cp, chr *start) { diff --git a/src/backend/regex/regerror.c b/src/backend/regex/regerror.c index f2fe696425c..2d38fbc646b 100644 --- a/src/backend/regex/regerror.c +++ b/src/backend/regex/regerror.c @@ -42,7 +42,7 @@ static const struct rerr int code; const char *name; const char *explain; -} rerrs[] = +} rerrs[] = { /* the actual table is built from regex.h */ diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 5cbfd9b151b..471ddb2aad7 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -334,8 +334,8 @@ cleanup: * The DFA will be freed by the cleanup step in pg_regexec(). */ static struct dfa * -getsubdfa(struct vars * v, - struct subre * t) +getsubdfa(struct vars *v, + struct subre *t) { if (v->subdfas[t->id] == NULL) { @@ -352,7 +352,7 @@ getsubdfa(struct vars * v, * Same as above, but for LACONs. */ static struct dfa * -getladfa(struct vars * v, +getladfa(struct vars *v, int n) { assert(n > 0 && n < v->g->nlacons && v->g->lacons != NULL); @@ -372,9 +372,9 @@ getladfa(struct vars * v, * find - find a match for the main NFA (no-complications case) */ static int -find(struct vars * v, - struct cnfa * cnfa, - struct colormap * cm) +find(struct vars *v, + struct cnfa *cnfa, + struct colormap *cm) { struct dfa *s; struct dfa *d; @@ -463,9 +463,9 @@ find(struct vars * v, * cfind - find a match for the main NFA (with complications) */ static int -cfind(struct vars * v, - struct cnfa * cnfa, - struct colormap * cm) +cfind(struct vars *v, + struct cnfa *cnfa, + struct colormap *cm) { struct dfa *s; struct dfa *d; @@ -503,11 +503,11 @@ cfind(struct vars * v, * cfindloop - the heart of cfind */ static int -cfindloop(struct vars * v, - struct cnfa * cnfa, - struct colormap * cm, - struct dfa * d, - struct dfa * s, +cfindloop(struct vars *v, + struct cnfa *cnfa, + struct colormap *cm, + struct dfa *d, + struct dfa *s, chr **coldp) /* where to put coldstart pointer */ { chr *begin; @@ -632,8 +632,8 @@ zapallsubs(regmatch_t *p, * zaptreesubs - initialize subexpressions within subtree to "no match" */ static void -zaptreesubs(struct vars * v, - struct subre * t) +zaptreesubs(struct vars *v, + struct subre *t) { if (t->op == '(') { @@ -657,8 +657,8 @@ zaptreesubs(struct vars * v, * subset - set subexpression match data for a successful subre */ static void -subset(struct vars * v, - struct subre * sub, +subset(struct vars *v, + struct subre *sub, chr *begin, chr *end) { @@ -689,8 +689,8 @@ subset(struct vars * v, * zaptreesubs (or zapallsubs at the top level). */ static int /* regexec return code */ -cdissect(struct vars * v, - struct subre * t, +cdissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -760,8 +760,8 @@ cdissect(struct vars * v, * ccondissect - dissect match for concatenation node */ static int /* regexec return code */ -ccondissect(struct vars * v, - struct subre * t, +ccondissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -838,8 +838,8 @@ ccondissect(struct vars * v, * crevcondissect - dissect match for concatenation node, shortest-first */ static int /* regexec return code */ -crevcondissect(struct vars * v, - struct subre * t, +crevcondissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -916,8 +916,8 @@ crevcondissect(struct vars * v, * cbrdissect - dissect match for backref node */ static int /* regexec return code */ -cbrdissect(struct vars * v, - struct subre * t, +cbrdissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -997,8 +997,8 @@ cbrdissect(struct vars * v, * caltdissect - dissect match for alternation node */ static int /* regexec return code */ -caltdissect(struct vars * v, - struct subre * t, +caltdissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -1034,8 +1034,8 @@ caltdissect(struct vars * v, * citerdissect - dissect match for iteration node */ static int /* regexec return code */ -citerdissect(struct vars * v, - struct subre * t, +citerdissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { @@ -1235,8 +1235,8 @@ backtrack: * creviterdissect - dissect match for iteration node, shortest-first */ static int /* regexec return code */ -creviterdissect(struct vars * v, - struct subre * t, +creviterdissect(struct vars *v, + struct subre *t, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { diff --git a/src/backend/regex/regexport.c b/src/backend/regex/regexport.c index 371c1f9da67..53417f0e7dd 100644 --- a/src/backend/regex/regexport.c +++ b/src/backend/regex/regexport.c @@ -90,7 +90,7 @@ pg_reg_getfinalstate(const regex_t *regex) * arcs_len (possibly 0) are emitted into arcs[]. */ static void -traverse_lacons(struct cnfa * cnfa, int st, +traverse_lacons(struct cnfa *cnfa, int st, int *arcs_count, regex_arc_t *arcs, int arcs_len) { diff --git a/src/backend/regex/regprefix.c b/src/backend/regex/regprefix.c index cb74f2f311f..96ca0e1ed3a 100644 --- a/src/backend/regex/regprefix.c +++ b/src/backend/regex/regprefix.c @@ -19,7 +19,7 @@ /* * forward declarations */ -static int findprefix(struct cnfa * cnfa, struct colormap * cm, +static int findprefix(struct cnfa *cnfa, struct colormap *cm, chr *string, size_t *slength); @@ -109,8 +109,8 @@ pg_regprefix(regex_t *re, * *slength (which must be preset to zero) incremented for each chr. */ static int /* regprefix return code */ -findprefix(struct cnfa * cnfa, - struct colormap * cm, +findprefix(struct cnfa *cnfa, + struct colormap *cm, chr *string, size_t *slength) { diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index cb5f58b6ba2..f3671cf41ff 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -54,11 +54,11 @@ typedef struct static int64 sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces, bool sendtblspclinks); static bool sendFile(char *readfilename, char *tarfilename, - struct stat * statbuf, bool missing_ok); + struct stat *statbuf, bool missing_ok); static void sendFileWithContent(const char *filename, const char *content); static int64 _tarWriteHeader(const char *filename, const char *linktarget, - struct stat * statbuf, bool sizeonly); -static int64 _tarWriteDir(const char *pathbuf, int basepathlen, struct stat * statbuf, + struct stat *statbuf, bool sizeonly); +static int64 _tarWriteDir(const char *pathbuf, int basepathlen, struct stat *statbuf, bool sizeonly); static void send_int8_string(StringInfoData *buf, int64 intval); static void SendBackupHeader(List *tablespaces); @@ -1199,7 +1199,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces, * and the file did not exist. */ static bool -sendFile(char *readfilename, char *tarfilename, struct stat * statbuf, +sendFile(char *readfilename, char *tarfilename, struct stat *statbuf, bool missing_ok) { FILE *fp; @@ -1273,7 +1273,7 @@ sendFile(char *readfilename, char *tarfilename, struct stat * statbuf, static int64 _tarWriteHeader(const char *filename, const char *linktarget, - struct stat * statbuf, bool sizeonly) + struct stat *statbuf, bool sizeonly) { char h[512]; enum tarError rc; @@ -1314,7 +1314,7 @@ _tarWriteHeader(const char *filename, const char *linktarget, * write it as a directory anyway. */ static int64 -_tarWriteDir(const char *pathbuf, int basepathlen, struct stat * statbuf, +_tarWriteDir(const char *pathbuf, int basepathlen, struct stat *statbuf, bool sizeonly) { /* If symlink, write it as a directory anyway */ diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 8f4f7f842bc..0182fb7fa72 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -180,8 +180,7 @@ static void AssertTXNLsnOrder(ReorderBuffer *rb); * --------------------------------------- */ static ReorderBufferIterTXNState *ReorderBufferIterTXNInit(ReorderBuffer *rb, ReorderBufferTXN *txn); -static ReorderBufferChange * - ReorderBufferIterTXNNext(ReorderBuffer *rb, ReorderBufferIterTXNState *state); +static ReorderBufferChange *ReorderBufferIterTXNNext(ReorderBuffer *rb, ReorderBufferIterTXNState *state); static void ReorderBufferIterTXNFinish(ReorderBuffer *rb, ReorderBufferIterTXNState *state); static void ReorderBufferExecuteInvalidations(ReorderBuffer *rb, ReorderBufferTXN *txn); diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 27236127181..01b86ffe8aa 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -106,7 +106,7 @@ static struct { XLogRecPtr Write; /* last byte + 1 written out in the standby */ XLogRecPtr Flush; /* last byte + 1 flushed in the standby */ -} LogstreamResult; +} LogstreamResult; static StringInfoData reply_message; static StringInfoData incoming_message; diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 976a42f86d3..b61eaef6f57 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -117,7 +117,8 @@ bool am_cascading_walsender = false; /* Am I cascading WAL to 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 max_wal_senders = 0; /* the maximum number of concurrent + * walsenders */ int wal_sender_timeout = 60 * 1000; /* maximum time to send one * WAL data message */ bool log_replication_commands = false; @@ -214,7 +215,7 @@ static struct int write_head; int read_heads[NUM_SYNC_REP_WAIT_MODE]; WalTimeSample last_read[NUM_SYNC_REP_WAIT_MODE]; -} LagTracker; +} LagTracker; /* Signal handlers */ static void WalSndLastCycleHandler(SIGNAL_ARGS); diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index e6812eef892..2ca6c63799d 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -1400,7 +1400,7 @@ matchLocks(CmdType event, oneLock->enabled == RULE_DISABLED) continue; } - else /* ORIGIN or LOCAL ROLE */ + else /* ORIGIN or LOCAL ROLE */ { if (oneLock->enabled == RULE_FIRES_ON_REPLICA || oneLock->enabled == RULE_DISABLED) diff --git a/src/backend/snowball/dict_snowball.c b/src/backend/snowball/dict_snowball.c index 0c322a49c6b..7cf668de19e 100644 --- a/src/backend/snowball/dict_snowball.c +++ b/src/backend/snowball/dict_snowball.c @@ -126,7 +126,7 @@ typedef struct DictSnowball struct SN_env *z; StopList stoplist; bool needrecode; /* needs recoding before/after call stem */ - int (*stem) (struct SN_env * z); + int (*stem) (struct SN_env *z); /* * snowball saves alloced memory between calls, so we should run it in our diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c index ba3b1d00bb1..00ee3a3e0a3 100644 --- a/src/backend/statistics/dependencies.c +++ b/src/backend/statistics/dependencies.c @@ -409,7 +409,7 @@ statext_dependencies_build(int numrows, HeapTuple *rows, Bitmapset *attrs, continue; d = (MVDependency *) palloc0(offsetof(MVDependency, attributes) - +k * sizeof(AttrNumber)); + + k * sizeof(AttrNumber)); /* copy the dependency (and keep the indexes into stxkeys) */ d->degree = degree; @@ -431,7 +431,7 @@ statext_dependencies_build(int numrows, HeapTuple *rows, Bitmapset *attrs, dependencies->ndeps++; dependencies = (MVDependencies *) repalloc(dependencies, offsetof(MVDependencies, deps) - +dependencies->ndeps * sizeof(MVDependency)); + + dependencies->ndeps * sizeof(MVDependency)); dependencies->deps[dependencies->ndeps - 1] = d; } @@ -552,7 +552,7 @@ statext_dependencies_deserialize(bytea *data) /* allocate space for the MCV items */ dependencies = repalloc(dependencies, offsetof(MVDependencies, deps) - +(dependencies->ndeps * sizeof(MVDependency *))); + + (dependencies->ndeps * sizeof(MVDependency *))); for (i = 0; i < dependencies->ndeps; i++) { @@ -573,7 +573,7 @@ statext_dependencies_deserialize(bytea *data) /* now that we know the number of attributes, allocate the dependency */ d = (MVDependency *) palloc0(offsetof(MVDependency, attributes) - +(k * sizeof(AttrNumber))); + + (k * sizeof(AttrNumber))); d->degree = degree; d->nattributes = k; diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 8d7460c96be..73d7ef3c271 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -353,7 +353,7 @@ multi_sort_init(int ndims) Assert(ndims >= 2); mss = (MultiSortSupport) palloc0(offsetof(MultiSortSupportData, ssup) - +sizeof(SortSupportData) * ndims); + + sizeof(SortSupportData) * ndims); mss->ndims = ndims; diff --git a/src/backend/statistics/mvdistinct.c b/src/backend/statistics/mvdistinct.c index d8d422cd45a..4b8d8926d29 100644 --- a/src/backend/statistics/mvdistinct.c +++ b/src/backend/statistics/mvdistinct.c @@ -166,7 +166,7 @@ statext_ndistinct_serialize(MVNDistinct *ndistinct) * for each item, including number of items for each. */ len = VARHDRSZ + SizeOfMVNDistinct + - ndistinct->nitems * (offsetof(MVNDistinctItem, attrs) +sizeof(int)); + ndistinct->nitems * (offsetof(MVNDistinctItem, attrs) + sizeof(int)); /* and also include space for the actual attribute numbers */ for (i = 0; i < ndistinct->nitems; i++) @@ -513,10 +513,10 @@ estimate_ndistinct(double totalrows, int numrows, int d, int f1) denom, ndistinct; - numer = (double) numrows *(double) d; + numer = (double) numrows * (double) d; denom = (double) (numrows - f1) + - (double) f1 *(double) numrows / totalrows; + (double) f1 * (double) numrows / totalrows; ndistinct = numer / denom; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 2109cbf8587..77296646d95 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -2118,7 +2118,7 @@ BgBufferSync(WritebackContext *wb_context) int32 passes_delta = strategy_passes - prev_strategy_passes; strategy_delta = strategy_buf_id - prev_strategy_buf_id; - strategy_delta += (long) passes_delta *NBuffers; + strategy_delta += (long) passes_delta * NBuffers; Assert(strategy_delta >= 0); @@ -4195,7 +4195,7 @@ ckpt_buforder_comparator(const void *pa, const void *pb) /* compare block number */ else if (a->blockNum < b->blockNum) return -1; - else /* should not be the same block ... */ + else /* should not be the same block ... */ return 1; } diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index 5d0a636ba8c..e14524bb412 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -94,7 +94,7 @@ typedef struct BufferAccessStrategyData * struct. */ Buffer buffers[FLEXIBLE_ARRAY_MEMBER]; -} BufferAccessStrategyData; +} BufferAccessStrategyData; /* Prototypes for internal functions */ diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index 387849e22c1..008cd9145c0 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -1160,5 +1160,5 @@ static uint64 dsm_control_bytes_needed(uint32 nitems) { return offsetof(dsm_control_header, item) - +sizeof(dsm_control_item) * (uint64) nitems; + + sizeof(dsm_control_item) * (uint64) nitems; } diff --git a/src/backend/storage/ipc/shm_mq.c b/src/backend/storage/ipc/shm_mq.c index fcd6cc7a8c3..f45a67cc278 100644 --- a/src/backend/storage/ipc/shm_mq.c +++ b/src/backend/storage/ipc/shm_mq.c @@ -145,7 +145,7 @@ static shm_mq_result shm_mq_receive_bytes(shm_mq *mq, Size bytes_needed, bool nowait, Size *nbytesp, void **datap); static bool shm_mq_counterparty_gone(volatile shm_mq *mq, BackgroundWorkerHandle *handle); -static bool shm_mq_wait_internal(volatile shm_mq *mq, PGPROC *volatile * ptr, +static bool shm_mq_wait_internal(volatile shm_mq *mq, PGPROC *volatile *ptr, BackgroundWorkerHandle *handle); static uint64 shm_mq_get_bytes_read(volatile shm_mq *mq, bool *detached); static void shm_mq_inc_bytes_read(volatile shm_mq *mq, Size n); @@ -365,7 +365,7 @@ shm_mq_sendv(shm_mq_handle *mqh, shm_mq_iovec *iov, int iovcnt, bool nowait) { Assert(mqh->mqh_partial_bytes < sizeof(Size)); res = shm_mq_send_bytes(mqh, sizeof(Size) - mqh->mqh_partial_bytes, - ((char *) &nbytes) +mqh->mqh_partial_bytes, + ((char *) &nbytes) + mqh->mqh_partial_bytes, nowait, &bytes_written); if (res == SHM_MQ_DETACHED) @@ -1053,7 +1053,7 @@ shm_mq_counterparty_gone(volatile shm_mq *mq, BackgroundWorkerHandle *handle) * non-NULL when our counterpart attaches to the queue. */ static bool -shm_mq_wait_internal(volatile shm_mq *mq, PGPROC *volatile * ptr, +shm_mq_wait_internal(volatile shm_mq *mq, PGPROC *volatile *ptr, BackgroundWorkerHandle *handle) { bool result = false; diff --git a/src/backend/storage/ipc/shm_toc.c b/src/backend/storage/ipc/shm_toc.c index 50334cd7978..a532f4fa5cf 100644 --- a/src/backend/storage/ipc/shm_toc.c +++ b/src/backend/storage/ipc/shm_toc.c @@ -96,7 +96,7 @@ shm_toc_allocate(shm_toc *toc, Size nbytes) total_bytes = vtoc->toc_total_bytes; allocated_bytes = vtoc->toc_allocated_bytes; nentry = vtoc->toc_nentry; - toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry) + toc_bytes = offsetof(shm_toc, toc_entry) + nentry * sizeof(shm_toc_entry) + allocated_bytes; /* Check for memory exhaustion and overflow. */ @@ -132,7 +132,7 @@ shm_toc_freespace(shm_toc *toc) nentry = vtoc->toc_nentry; SpinLockRelease(&toc->toc_mutex); - toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry); + toc_bytes = offsetof(shm_toc, toc_entry) + nentry * sizeof(shm_toc_entry); Assert(allocated_bytes + BUFFERALIGN(toc_bytes) <= total_bytes); return total_bytes - (allocated_bytes + BUFFERALIGN(toc_bytes)); } @@ -176,7 +176,7 @@ shm_toc_insert(shm_toc *toc, uint64 key, void *address) total_bytes = vtoc->toc_total_bytes; allocated_bytes = vtoc->toc_allocated_bytes; nentry = vtoc->toc_nentry; - toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry) + toc_bytes = offsetof(shm_toc, toc_entry) + nentry * sizeof(shm_toc_entry) + allocated_bytes; /* Check for memory exhaustion and overflow. */ diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index 67150debf21..b5f49727f7a 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -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/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 35536e47894..a021fbb2297 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -168,7 +168,7 @@ typedef struct lwlock_stats_key { int tranche; void *instance; -} lwlock_stats_key; +} lwlock_stats_key; typedef struct lwlock_stats { @@ -178,7 +178,7 @@ typedef struct lwlock_stats int block_count; int dequeue_self_count; int spin_delay_count; -} lwlock_stats; +} lwlock_stats; static HTAB *lwlock_stats_htab; static lwlock_stats lwlock_stats_dummy; @@ -232,7 +232,7 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg) static void init_lwlock_stats(void); static void print_lwlock_stats(int code, Datum arg); -static lwlock_stats *get_lwlock_stats_entry(LWLock *lockid); +static lwlock_stats * get_lwlock_stats_entry(LWLock *lockid); static void init_lwlock_stats(void) @@ -851,7 +851,7 @@ LWLockWaitListLock(LWLock *lock) static void LWLockWaitListUnlock(LWLock *lock) { - uint32 old_state PG_USED_FOR_ASSERTS_ONLY; + uint32 old_state PG_USED_FOR_ASSERTS_ONLY; old_state = pg_atomic_fetch_and_u32(&lock->state, ~LW_FLAG_LOCKED); @@ -1092,7 +1092,7 @@ LWLockDequeueSelf(LWLock *lock) #ifdef LOCK_DEBUG { /* not waiting anymore */ - uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); + uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); Assert(nwaiters < MAX_BACKENDS); } @@ -1242,7 +1242,7 @@ LWLockAcquire(LWLock *lock, LWLockMode mode) #ifdef LOCK_DEBUG { /* not waiting anymore */ - uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); + uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); Assert(nwaiters < MAX_BACKENDS); } @@ -1400,7 +1400,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode) #ifdef LOCK_DEBUG { /* not waiting anymore */ - uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); + uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); Assert(nwaiters < MAX_BACKENDS); } @@ -1616,7 +1616,7 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval) #ifdef LOCK_DEBUG { /* not waiting anymore */ - uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); + uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); Assert(nwaiters < MAX_BACKENDS); } diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index f0b127cc600..b07ef4c21bc 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -337,7 +337,7 @@ typedef struct OldSerXidControlData TransactionId headXid; /* newest valid Xid in the SLRU */ TransactionId tailXid; /* oldest xmin we might be interested in */ bool warningIssued; /* have we issued SLRU wrap-around warning? */ -} OldSerXidControlData; +} OldSerXidControlData; typedef struct OldSerXidControlData *OldSerXidControl; diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 3e716b1c6c7..b76c170630a 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -286,7 +286,7 @@ InitProcGlobal(void) void InitProcess(void) { - PGPROC *volatile * procgloballist; + PGPROC *volatile *procgloballist; /* * ProcGlobal should be set up already (if we are a backend, we inherit @@ -781,7 +781,7 @@ static void ProcKill(int code, Datum arg) { PGPROC *proc; - PGPROC *volatile * procgloballist; + PGPROC *volatile *procgloballist; Assert(MyProc != NULL); diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index ac82e704fa6..09f1c64e46e 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -250,10 +250,10 @@ update_spins_per_delay(int shared_spins_per_delay) static void tas_dummy() { - __asm__ __volatile__( + __asm__ __volatile__( #if defined(__NetBSD__) && defined(__ELF__) /* no underscore for label and % for registers */ - "\ + "\ .global tas \n\ tas: \n\ movel %sp@(0x4),%a0 \n\ @@ -265,7 +265,7 @@ _success: \n\ moveq #0,%d0 \n\ rts \n" #else - "\ + "\ .global _tas \n\ _tas: \n\ movel sp@(0x4),a0 \n\ @@ -277,7 +277,7 @@ _success: \n\ moveq #0,d0 \n\ rts \n" #endif /* __NetBSD__ && __ELF__ */ - ); + ); } #endif /* __m68k__ && !__linux__ */ #endif /* not __GNUC__ */ diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 9bc00b62143..1b1de1f879a 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -518,7 +518,7 @@ mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, v = _mdfd_getseg(reln, forknum, blocknum, skipFsync, EXTENSION_CREATE); - seekpos = (off_t) BLCKSZ *(blocknum % ((BlockNumber) RELSEG_SIZE)); + seekpos = (off_t) BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE)); Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE); @@ -664,7 +664,7 @@ mdprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum) v = _mdfd_getseg(reln, forknum, blocknum, false, EXTENSION_FAIL); - seekpos = (off_t) BLCKSZ *(blocknum % ((BlockNumber) RELSEG_SIZE)); + seekpos = (off_t) BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE)); Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE); @@ -715,7 +715,7 @@ mdwriteback(SMgrRelation reln, ForkNumber forknum, Assert(nflush >= 1); Assert(nflush <= nblocks); - seekpos = (off_t) BLCKSZ *(blocknum % ((BlockNumber) RELSEG_SIZE)); + seekpos = (off_t) BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE)); FileWriteback(v->mdfd_vfd, seekpos, (off_t) BLCKSZ * nflush, WAIT_EVENT_DATA_FILE_FLUSH); @@ -744,7 +744,7 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, v = _mdfd_getseg(reln, forknum, blocknum, false, EXTENSION_FAIL | EXTENSION_CREATE_RECOVERY); - seekpos = (off_t) BLCKSZ *(blocknum % ((BlockNumber) RELSEG_SIZE)); + seekpos = (off_t) BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE)); Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE); @@ -820,7 +820,7 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, v = _mdfd_getseg(reln, forknum, blocknum, skipFsync, EXTENSION_FAIL | EXTENSION_CREATE_RECOVERY); - seekpos = (off_t) BLCKSZ *(blocknum % ((BlockNumber) RELSEG_SIZE)); + seekpos = (off_t) BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE)); Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE); diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 0ed1fe91d5f..e9850f79ae0 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -41,23 +41,23 @@ typedef struct f_smgr void (*smgr_shutdown) (void); /* may be NULL */ void (*smgr_close) (SMgrRelation reln, ForkNumber forknum); void (*smgr_create) (SMgrRelation reln, ForkNumber forknum, - bool isRedo); + bool isRedo); bool (*smgr_exists) (SMgrRelation reln, ForkNumber forknum); void (*smgr_unlink) (RelFileNodeBackend rnode, ForkNumber forknum, - bool isRedo); + bool isRedo); void (*smgr_extend) (SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); void (*smgr_prefetch) (SMgrRelation reln, ForkNumber forknum, - BlockNumber blocknum); + BlockNumber blocknum); void (*smgr_read) (SMgrRelation reln, ForkNumber forknum, - BlockNumber blocknum, char *buffer); + BlockNumber blocknum, char *buffer); void (*smgr_write) (SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); void (*smgr_writeback) (SMgrRelation reln, ForkNumber forknum, - BlockNumber blocknum, BlockNumber nblocks); + BlockNumber blocknum, BlockNumber nblocks); BlockNumber (*smgr_nblocks) (SMgrRelation reln, ForkNumber forknum); void (*smgr_truncate) (SMgrRelation reln, ForkNumber forknum, - BlockNumber nblocks); + BlockNumber nblocks); void (*smgr_immedsync) (SMgrRelation reln, ForkNumber forknum); void (*smgr_pre_ckpt) (void); /* may be NULL */ void (*smgr_sync) (void); /* may be NULL */ diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index 5f272d84485..ba0f06c302d 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -58,9 +58,9 @@ struct fp_info }; -static int16 parse_fcall_arguments(StringInfo msgBuf, struct fp_info * fip, +static int16 parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, FunctionCallInfo fcinfo); -static int16 parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info * fip, +static int16 parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info *fip, FunctionCallInfo fcinfo); @@ -195,7 +195,7 @@ SendFunctionResult(Datum retval, bool isnull, Oid rettype, int16 format) * function 'func_id'. */ static void -fetch_fp_info(Oid func_id, struct fp_info * fip) +fetch_fp_info(Oid func_id, struct fp_info *fip) { HeapTuple func_htp; Form_pg_proc pp; @@ -405,7 +405,7 @@ HandleFunctionRequest(StringInfo msgBuf) * is returned. */ static int16 -parse_fcall_arguments(StringInfo msgBuf, struct fp_info * fip, +parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, FunctionCallInfo fcinfo) { int nargs; @@ -543,7 +543,7 @@ parse_fcall_arguments(StringInfo msgBuf, struct fp_info * fip, * is returned. */ static int16 -parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info * fip, +parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info *fip, FunctionCallInfo fcinfo) { int nargs; diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index f99dd0a2d49..fd6c9cf039d 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3041,10 +3041,10 @@ ia64_get_bsp(void) char *ret; /* the ;; is a "stop", seems to be required before fetching BSP */ - __asm__ __volatile__( - ";;\n" - " mov %0=ar.bsp \n" - : "=r"(ret)); + __asm__ __volatile__( + ";;\n" + " mov %0=ar.bsp \n" +: "=r"(ret)); return ret; } diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index a22fd5397e5..dd1916f366a 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1221,7 +1221,7 @@ ProcessUtilitySlow(ParseState *pstate, AlterDomainValidateConstraint(stmt->typeName, stmt->name); break; - default: /* oops */ + default: /* oops */ elog(ERROR, "unrecognized alter domain type: %d", (int) stmt->subtype); break; diff --git a/src/backend/tsearch/regis.c b/src/backend/tsearch/regis.c index aea76e85b52..2b89f596f08 100644 --- a/src/backend/tsearch/regis.c +++ b/src/backend/tsearch/regis.c @@ -115,7 +115,7 @@ RS_compile(Regis *r, bool issuffix, const char *str) ptr->type = RSF_ONEOF; state = RS_IN_ONEOF; } - else /* shouldn't get here */ + else /* shouldn't get here */ elog(ERROR, "invalid regis pattern: \"%s\"", str); } else if (state == RS_IN_ONEOF) @@ -131,7 +131,7 @@ RS_compile(Regis *r, bool issuffix, const char *str) ptr->len = pg_mblen(c); state = RS_IN_ONEOF_IN; } - else /* shouldn't get here */ + else /* shouldn't get here */ elog(ERROR, "invalid regis pattern: \"%s\"", str); } else if (state == RS_IN_ONEOF_IN || state == RS_IN_NONEOF) @@ -143,7 +143,7 @@ RS_compile(Regis *r, bool issuffix, const char *str) } else if (t_iseq(c, ']')) state = RS_IN_WAIT; - else /* shouldn't get here */ + else /* shouldn't get here */ elog(ERROR, "invalid regis pattern: \"%s\"", str); } else diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index c1e194a8f57..817237ce4d2 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -803,7 +803,7 @@ get_nextfield(char **str, char *next) state = PAE_INMASK; } } - else /* state == PAE_INMASK */ + else /* state == PAE_INMASK */ { if (t_isspace(*str)) { diff --git a/src/backend/tsearch/ts_typanalyze.c b/src/backend/tsearch/ts_typanalyze.c index 017435cc59b..f4298ca9aa4 100644 --- a/src/backend/tsearch/ts_typanalyze.c +++ b/src/backend/tsearch/ts_typanalyze.c @@ -501,8 +501,8 @@ lexeme_compare(const void *key1, const void *key2) static int trackitem_compare_frequencies_desc(const void *e1, const void *e2) { - const TrackItem *const * t1 = (const TrackItem *const *) e1; - const TrackItem *const * t2 = (const TrackItem *const *) e2; + const TrackItem *const *t1 = (const TrackItem *const *) e1; + const TrackItem *const *t2 = (const TrackItem *const *) e2; return (*t2)->frequency - (*t1)->frequency; } @@ -513,8 +513,8 @@ trackitem_compare_frequencies_desc(const void *e1, const void *e2) static int trackitem_compare_lexemes(const void *e1, const void *e2) { - const TrackItem *const * t1 = (const TrackItem *const *) e1; - const TrackItem *const * t2 = (const TrackItem *const *) e2; + const TrackItem *const *t1 = (const TrackItem *const *) e1; + const TrackItem *const *t2 = (const TrackItem *const *) e2; return lexeme_compare(&(*t1)->key, &(*t2)->key); } diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c index bb7edc1516b..0cfc6552d75 100644 --- a/src/backend/tsearch/wparser_def.c +++ b/src/backend/tsearch/wparser_def.c @@ -665,17 +665,17 @@ SpecialTags(TParser *prs) { switch (prs->state->lenchartoken) { - case 8: /* </script */ + case 8: /* </script */ if (pg_strncasecmp(prs->token, "</script", 8) == 0) prs->ignore = false; break; - case 7: /* <script || </style */ + case 7: /* <script || </style */ if (pg_strncasecmp(prs->token, "</style", 7) == 0) prs->ignore = false; else if (pg_strncasecmp(prs->token, "<script", 7) == 0) prs->ignore = true; break; - case 6: /* <style */ + case 6: /* <style */ if (pg_strncasecmp(prs->token, "<style", 6) == 0) prs->ignore = true; break; diff --git a/src/backend/utils/adt/array_typanalyze.c b/src/backend/utils/adt/array_typanalyze.c index 85b7a432920..e3ef18cace9 100644 --- a/src/backend/utils/adt/array_typanalyze.c +++ b/src/backend/utils/adt/array_typanalyze.c @@ -751,8 +751,8 @@ element_compare(const void *key1, const void *key2) static int trackitem_compare_frequencies_desc(const void *e1, const void *e2) { - const TrackItem *const * t1 = (const TrackItem *const *) e1; - const TrackItem *const * t2 = (const TrackItem *const *) e2; + const TrackItem *const *t1 = (const TrackItem *const *) e1; + const TrackItem *const *t2 = (const TrackItem *const *) e2; return (*t2)->frequency - (*t1)->frequency; } @@ -763,8 +763,8 @@ trackitem_compare_frequencies_desc(const void *e1, const void *e2) static int trackitem_compare_element(const void *e1, const void *e2) { - const TrackItem *const * t1 = (const TrackItem *const *) e1; - const TrackItem *const * t2 = (const TrackItem *const *) e2; + const TrackItem *const *t1 = (const TrackItem *const *) e1; + const TrackItem *const *t2 = (const TrackItem *const *) e2; return element_compare(&(*t1)->key, &(*t2)->key); } @@ -775,8 +775,8 @@ trackitem_compare_element(const void *e1, const void *e2) static int countitem_compare_count(const void *e1, const void *e2) { - const DECountItem *const * t1 = (const DECountItem *const *) e1; - const DECountItem *const * t2 = (const DECountItem *const *) e2; + const DECountItem *const *t1 = (const DECountItem *const *) e1; + const DECountItem *const *t2 = (const DECountItem *const *) e2; if ((*t1)->count < (*t2)->count) return -1; diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index d9c8aa569c9..1d202dba120 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -84,7 +84,7 @@ typedef struct ArrayIteratorData /* current position information, updated on each iteration */ char *data_ptr; /* our current position in the array */ int current_item; /* the item # we're at in the array */ -} ArrayIteratorData; +} ArrayIteratorData; static bool array_isspace(char ch); static int ArrayCount(const char *str, int *dim, char typdelim); diff --git a/src/backend/utils/adt/arrayutils.c b/src/backend/utils/adt/arrayutils.c index a46d8629c30..27b24703b0b 100644 --- a/src/backend/utils/adt/arrayutils.c +++ b/src/backend/utils/adt/arrayutils.c @@ -93,7 +93,7 @@ ArrayGetNItems(int ndim, const int *dims) errmsg("array size exceeds the maximum allowed (%d)", (int) MaxArraySize))); - prod = (int64) ret *(int64) dims[i]; + prod = (int64) ret * (int64) dims[i]; ret = (int32) prod; if ((int64) ret != prod) diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index a170294b942..677037c246b 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -84,7 +84,7 @@ num_word(Cash value) } return buf; -} /* num_word() */ +} /* num_word() */ /* cash_in() * Convert a string to a cash data type. @@ -132,7 +132,7 @@ cash_in(PG_FUNCTION_ARGS) dsymbol = '.'; if (*lconvert->mon_thousands_sep != '\0') ssymbol = lconvert->mon_thousands_sep; - else /* ssymbol should not equal dsymbol */ + else /* ssymbol should not equal dsymbol */ ssymbol = (dsymbol != ',') ? "," : "."; csymbol = (*lconvert->currency_symbol != '\0') ? lconvert->currency_symbol : "$"; psymbol = (*lconvert->positive_sign != '\0') ? lconvert->positive_sign : "+"; @@ -347,7 +347,7 @@ cash_out(PG_FUNCTION_ARGS) dsymbol = '.'; if (*lconvert->mon_thousands_sep != '\0') ssymbol = lconvert->mon_thousands_sep; - else /* ssymbol should not equal dsymbol */ + else /* ssymbol should not equal dsymbol */ ssymbol = (dsymbol != ',') ? "," : "."; csymbol = (*lconvert->currency_symbol != '\0') ? lconvert->currency_symbol : "$"; diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c index 76ab9496e2e..3095047f0b4 100644 --- a/src/backend/utils/adt/date.c +++ b/src/backend/utils/adt/date.c @@ -41,10 +41,10 @@ #endif -static int time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec); -static int timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp); -static int tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result); -static int tm2timetz(struct pg_tm * tm, fsec_t fsec, int tz, TimeTzADT *result); +static int time2tm(TimeADT time, struct pg_tm *tm, fsec_t *fsec); +static int timetz2tm(TimeTzADT *time, struct pg_tm *tm, fsec_t *fsec, int *tzp); +static int tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result); +static int tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result); static void AdjustTimeForTypmod(TimeADT *time, int32 typmod); @@ -302,7 +302,7 @@ EncodeSpecialDate(DateADT dt, char *str) strcpy(str, EARLY); else if (DATE_IS_NOEND(dt)) strcpy(str, LATE); - else /* shouldn't happen */ + else /* shouldn't happen */ elog(ERROR, "invalid argument for EncodeSpecialDate"); } @@ -1235,7 +1235,7 @@ time_in(PG_FUNCTION_ARGS) * Convert a tm structure to a time data type. */ static int -tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result) +tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result) { *result = ((((tm->tm_hour * MINS_PER_HOUR + tm->tm_min) * SECS_PER_MINUTE) + tm->tm_sec) * USECS_PER_SEC) + fsec; @@ -1250,7 +1250,7 @@ tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result) * if pg_time_t is just 32 bits) - thomas 97/05/27 */ static int -time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec) +time2tm(TimeADT time, struct pg_tm *tm, fsec_t *fsec) { tm->tm_hour = time / USECS_PER_HOUR; time -= tm->tm_hour * USECS_PER_HOUR; @@ -1934,7 +1934,7 @@ time_part(PG_FUNCTION_ARGS) * Convert a tm structure to a time data type. */ static int -tm2timetz(struct pg_tm * tm, fsec_t fsec, int tz, TimeTzADT *result) +tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result) { result->time = ((((tm->tm_hour * MINS_PER_HOUR + tm->tm_min) * SECS_PER_MINUTE) + tm->tm_sec) * USECS_PER_SEC) + fsec; @@ -2068,7 +2068,7 @@ timetztypmodout(PG_FUNCTION_ARGS) * Convert TIME WITH TIME ZONE data type to POSIX time structure. */ static int -timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp) +timetz2tm(TimeTzADT *time, struct pg_tm *tm, fsec_t *fsec, int *tzp) { TimeOffset trem = time->time; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 30db3bf7e59..107b8fdad97 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -34,22 +34,22 @@ static int DecodeNumber(int flen, char *field, bool haveTextMonth, int fmask, int *tmask, - struct pg_tm * tm, fsec_t *fsec, bool *is2digits); + struct pg_tm *tm, fsec_t *fsec, bool *is2digits); static int DecodeNumberField(int len, char *str, int fmask, int *tmask, - struct pg_tm * tm, fsec_t *fsec, bool *is2digits); + struct pg_tm *tm, fsec_t *fsec, bool *is2digits); static int DecodeTime(char *str, int fmask, int range, - int *tmask, struct pg_tm * tm, fsec_t *fsec); + int *tmask, struct pg_tm *tm, fsec_t *fsec); static const datetkn *datebsearch(const char *key, const datetkn *base, int nel); static int DecodeDate(char *str, int fmask, int *tmask, bool *is2digits, - struct pg_tm * tm); + struct pg_tm *tm); static char *AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros); -static void AdjustFractSeconds(double frac, struct pg_tm * tm, fsec_t *fsec, +static void AdjustFractSeconds(double frac, struct pg_tm *tm, fsec_t *fsec, int scale); -static void AdjustFractDays(double frac, struct pg_tm * tm, fsec_t *fsec, +static void AdjustFractDays(double frac, struct pg_tm *tm, fsec_t *fsec, int scale); -static int DetermineTimeZoneOffsetInternal(struct pg_tm * tm, pg_tz *tzp, +static int DetermineTimeZoneOffsetInternal(struct pg_tm *tm, pg_tz *tzp, pg_time_t *tp); static bool DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr, pg_tz *tzp, @@ -311,7 +311,7 @@ date2j(int y, int m, int d) julian += 7834 * m / 256 + d; return julian; -} /* date2j() */ +} /* date2j() */ void j2date(int jd, int *year, int *month, int *day) @@ -338,7 +338,7 @@ j2date(int jd, int *year, int *month, int *day) *month = (quad + 10) % MONTHS_PER_YEAR + 1; return; -} /* j2date() */ +} /* j2date() */ /* @@ -358,7 +358,7 @@ j2day(int date) date += 7; return date; -} /* j2day() */ +} /* j2day() */ /* @@ -367,7 +367,7 @@ j2day(int date) * Get the transaction start time ("now()") broken down as a struct pg_tm. */ void -GetCurrentDateTime(struct pg_tm * tm) +GetCurrentDateTime(struct pg_tm *tm) { int tz; fsec_t fsec; @@ -384,7 +384,7 @@ GetCurrentDateTime(struct pg_tm * tm) * including fractional seconds and timezone offset. */ void -GetCurrentTimeUsec(struct pg_tm * tm, fsec_t *fsec, int *tzp) +GetCurrentTimeUsec(struct pg_tm *tm, fsec_t *fsec, int *tzp) { int tz; @@ -471,7 +471,7 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros) * there; callers are responsible for NUL terminating str themselves. */ static char * -AppendTimestampSeconds(char *cp, struct pg_tm * tm, fsec_t fsec) +AppendTimestampSeconds(char *cp, struct pg_tm *tm, fsec_t fsec) { return AppendSeconds(cp, tm->tm_sec, fsec, MAX_TIMESTAMP_PRECISION, true); } @@ -481,7 +481,7 @@ AppendTimestampSeconds(char *cp, struct pg_tm * tm, fsec_t fsec) * We assume the input frac is less than 1 so overflow is not an issue. */ static void -AdjustFractSeconds(double frac, struct pg_tm * tm, fsec_t *fsec, int scale) +AdjustFractSeconds(double frac, struct pg_tm *tm, fsec_t *fsec, int scale) { int sec; @@ -496,7 +496,7 @@ AdjustFractSeconds(double frac, struct pg_tm * tm, fsec_t *fsec, int scale) /* As above, but initial scale produces days */ static void -AdjustFractDays(double frac, struct pg_tm * tm, fsec_t *fsec, int scale) +AdjustFractDays(double frac, struct pg_tm *tm, fsec_t *fsec, int scale) { int extra_days; @@ -781,7 +781,7 @@ ParseDateTime(const char *timestr, char *workbuf, size_t buflen, */ int DecodeDateTime(char **field, int *ftype, int nf, - int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp) + int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp) { int fmask = 0, tmask, @@ -1468,7 +1468,7 @@ DecodeDateTime(char **field, int *ftype, int nf, * though probably some higher-level code will. */ int -DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp) +DetermineTimeZoneOffset(struct pg_tm *tm, pg_tz *tzp) { pg_time_t t; @@ -1490,7 +1490,7 @@ DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp) * of mktime(), anyway. */ static int -DetermineTimeZoneOffsetInternal(struct pg_tm * tm, pg_tz *tzp, pg_time_t *tp) +DetermineTimeZoneOffsetInternal(struct pg_tm *tm, pg_tz *tzp, pg_time_t *tp) { int date, sec; @@ -1626,7 +1626,7 @@ overflow: * back to doing DetermineTimeZoneOffset().) */ int -DetermineTimeZoneAbbrevOffset(struct pg_tm * tm, const char *abbr, pg_tz *tzp) +DetermineTimeZoneAbbrevOffset(struct pg_tm *tm, const char *abbr, pg_tz *tzp) { pg_time_t t; int zone_offset; @@ -1742,7 +1742,7 @@ DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr, pg_tz *tzp, */ int DecodeTimeOnly(char **field, int *ftype, int nf, - int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp) + int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp) { int fmask = 0, tmask, @@ -2367,7 +2367,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, */ static int DecodeDate(char *str, int fmask, int *tmask, bool *is2digits, - struct pg_tm * tm) + struct pg_tm *tm) { fsec_t fsec; int nf = 0; @@ -2477,7 +2477,7 @@ DecodeDate(char *str, int fmask, int *tmask, bool *is2digits, */ int ValidateDate(int fmask, bool isjulian, bool is2digits, bool bc, - struct pg_tm * tm) + struct pg_tm *tm) { if (fmask & DTK_M(YEAR)) { @@ -2556,7 +2556,7 @@ ValidateDate(int fmask, bool isjulian, bool is2digits, bool bc, */ static int DecodeTime(char *str, int fmask, int range, - int *tmask, struct pg_tm * tm, fsec_t *fsec) + int *tmask, struct pg_tm *tm, fsec_t *fsec) { char *cp; int dterr; @@ -2632,7 +2632,7 @@ DecodeTime(char *str, int fmask, int range, */ static int DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask, - int *tmask, struct pg_tm * tm, fsec_t *fsec, bool *is2digits) + int *tmask, struct pg_tm *tm, fsec_t *fsec, bool *is2digits) { int val; char *cp; @@ -2817,7 +2817,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask, */ static int DecodeNumberField(int len, char *str, int fmask, - int *tmask, struct pg_tm * tm, fsec_t *fsec, bool *is2digits) + int *tmask, struct pg_tm *tm, fsec_t *fsec, bool *is2digits) { char *cp; @@ -3068,7 +3068,7 @@ DecodeSpecial(int field, char *lowtoken, int *val) * Zero out a pg_tm and associated fsec_t */ static inline void -ClearPgTm(struct pg_tm * tm, fsec_t *fsec) +ClearPgTm(struct pg_tm *tm, fsec_t *fsec) { tm->tm_year = 0; tm->tm_mon = 0; @@ -3093,7 +3093,7 @@ ClearPgTm(struct pg_tm * tm, fsec_t *fsec) */ int DecodeInterval(char **field, int *ftype, int nf, int range, - int *dtype, struct pg_tm * tm, fsec_t *fsec) + int *dtype, struct pg_tm *tm, fsec_t *fsec) { bool is_before = FALSE; char *cp; @@ -3519,7 +3519,7 @@ ISO8601IntegerWidth(char *fieldstart) */ int DecodeISO8601Interval(char *str, - int *dtype, struct pg_tm * tm, fsec_t *fsec) + int *dtype, struct pg_tm *tm, fsec_t *fsec) { bool datepart = true; bool havefield = false; @@ -3749,7 +3749,7 @@ DecodeUnits(int field, char *lowtoken, int *val) } return type; -} /* DecodeUnits() */ +} /* DecodeUnits() */ /* * Report an error detected by one of the datetime input processing routines. @@ -3881,7 +3881,7 @@ EncodeTimezone(char *str, int tz, int style) * Encode date as local time. */ void -EncodeDateOnly(struct pg_tm * tm, int style, char *str) +EncodeDateOnly(struct pg_tm *tm, int style, char *str) { Assert(tm->tm_mon >= 1 && tm->tm_mon <= MONTHS_PER_YEAR); @@ -3966,7 +3966,7 @@ EncodeDateOnly(struct pg_tm * tm, int style, char *str) * output. */ void -EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, int style, char *str) +EncodeTimeOnly(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, int style, char *str) { str = pg_ltostr_zeropad(str, tm->tm_hour, 2); *str++ = ':'; @@ -3996,7 +3996,7 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, int style, * XSD - yyyy-mm-ddThh:mm:ss.ss+/-tz */ void -EncodeDateTime(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str) +EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str) { int day; @@ -4238,7 +4238,7 @@ AddVerboseIntPart(char *cp, int value, const char *units, * "day-time literal"s (that look like ('4 5:6:7') */ void -EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str) +EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str) { char *cp = str; int year = tm->tm_year; diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index f0725860b4b..ac4feddbfd3 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -889,7 +889,7 @@ pg_relation_filenode(PG_FUNCTION_ARGS) /* okay, these have storage */ if (relform->relfilenode) result = relform->relfilenode; - else /* Consult the relation mapper */ + else /* Consult the relation mapper */ result = RelationMapOidToFilenode(relid, relform->relisshared); break; @@ -976,7 +976,7 @@ pg_relation_filepath(PG_FUNCTION_ARGS) rnode.dbNode = MyDatabaseId; if (relform->relfilenode) rnode.relNode = relform->relfilenode; - else /* Consult the relation mapper */ + else /* Consult the relation mapper */ rnode.relNode = RelationMapOidToFilenode(relid, relform->relisshared); break; diff --git a/src/backend/utils/adt/encode.c b/src/backend/utils/adt/encode.c index 8fd8ede39e5..8773538b8d5 100644 --- a/src/backend/utils/adt/encode.c +++ b/src/backend/utils/adt/encode.c @@ -520,7 +520,7 @@ static const struct { const char *name; struct pg_encoding enc; -} enclist[] = +} enclist[] = { { diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 4127bece12a..ba7e4fc934f 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -667,7 +667,7 @@ typedef enum /* last */ _DCH_last_ -} DCH_poz; +} DCH_poz; typedef enum { @@ -710,7 +710,7 @@ typedef enum /* last */ _NUM_last_ -} NUM_poz; +} NUM_poz; /* ---------- * KeyWords for DATE-TIME version @@ -976,10 +976,10 @@ static void from_char_set_mode(TmFromChar *tmfc, const FromCharDateMode mode); static void from_char_set_int(int *dest, const int value, const FormatNode *node); static int from_char_parse_int_len(int *dest, char **src, const int len, FormatNode *node); static int from_char_parse_int(int *dest, char **src, FormatNode *node); -static int seq_search(char *name, const char *const * array, int type, int max, int *len); -static int from_char_seq_search(int *dest, char **src, const char *const * array, int type, int max, FormatNode *node); +static int seq_search(char *name, const char *const *array, int type, int max, int *len); +static int from_char_seq_search(int *dest, char **src, const char *const *array, int type, int max, FormatNode *node); static void do_to_timestamp(text *date_txt, text *fmt, - struct pg_tm * tm, fsec_t *fsec); + struct pg_tm *tm, fsec_t *fsec); static char *fill_str(char *str, int c, int max); static FormatNode *NUM_cache(int len, NUMDesc *Num, text *pars_str, bool *shouldFree); static char *int_to_roman(int number); @@ -1450,9 +1450,9 @@ str_numth(char *dest, char *num, int type) #ifdef USE_ICU typedef int32_t (*ICU_Convert_Func) (UChar *dest, int32_t destCapacity, - const UChar *src, int32_t srcLength, - const char *locale, - UErrorCode *pErrorCode); + const UChar *src, int32_t srcLength, + const char *locale, + UErrorCode *pErrorCode); static int32_t icu_convert_case(ICU_Convert_Func func, pg_locale_t mylocale, @@ -2303,10 +2303,10 @@ from_char_parse_int(int *dest, char **src, FormatNode *node) * ---------- */ static int -seq_search(char *name, const char *const * array, int type, int max, int *len) +seq_search(char *name, const char *const *array, int type, int max, int *len) { const char *p; - const char *const * a; + const char *const *a; char *n; int last, i; @@ -2381,7 +2381,7 @@ seq_search(char *name, const char *const * array, int type, int max, int *len) * If the string doesn't match, throw an error. */ static int -from_char_seq_search(int *dest, char **src, const char *const * array, int type, int max, +from_char_seq_search(int *dest, char **src, const char *const *array, int type, int max, FormatNode *node) { int len; @@ -3609,7 +3609,7 @@ to_date(PG_FUNCTION_ARGS) */ static void do_to_timestamp(text *date_txt, text *fmt, - struct pg_tm * tm, fsec_t *fsec) + struct pg_tm *tm, fsec_t *fsec) { FormatNode *format; TmFromChar tmfc; diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 655b81cc468..40de01b7bc9 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -126,7 +126,7 @@ single_decode(char *num, char **endptr_p, const char *type_name, const char *orig_string) { return float8in_internal(num, endptr_p, type_name, orig_string); -} /* single_decode() */ +} /* single_decode() */ static void single_encode(float8 x, StringInfo str) @@ -135,7 +135,7 @@ single_encode(float8 x, StringInfo str) appendStringInfoString(str, xstr); pfree(xstr); -} /* single_encode() */ +} /* single_encode() */ static void pair_decode(char *str, double *x, double *y, char **endptr_p, @@ -264,7 +264,7 @@ path_decode(char *str, bool opentype, int npts, Point *p, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for type %s: \"%s\"", type_name, orig_string))); -} /* path_decode() */ +} /* path_decode() */ static char * path_encode(enum path_delim path_delim, int npts, Point *pt) @@ -309,7 +309,7 @@ path_encode(enum path_delim path_delim, int npts, Point *pt) } return str.data; -} /* path_encode() */ +} /* path_encode() */ /*------------------------------------------------------------- * pair_count - count the number of points @@ -1333,7 +1333,7 @@ path_in(PG_FUNCTION_ARGS) } base_size = sizeof(path->p[0]) * npts; - size = offsetof(PATH, p) +base_size; + size = offsetof(PATH, p) + base_size; /* Check for integer overflow */ if (base_size / npts != sizeof(path->p[0]) || size <= base_size) @@ -1403,7 +1403,7 @@ path_recv(PG_FUNCTION_ARGS) (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), errmsg("invalid number of points in external \"path\" value"))); - size = offsetof(PATH, p) +sizeof(path->p[0]) * npts; + size = offsetof(PATH, p) + sizeof(path->p[0]) * npts; path = (PATH *) palloc(size); SET_VARSIZE(path, size); @@ -3431,7 +3431,7 @@ poly_in(PG_FUNCTION_ARGS) "polygon", str))); base_size = sizeof(poly->p[0]) * npts; - size = offsetof(POLYGON, p) +base_size; + size = offsetof(POLYGON, p) + base_size; /* Check for integer overflow */ if (base_size / npts != sizeof(poly->p[0]) || size <= base_size) @@ -3486,7 +3486,7 @@ poly_recv(PG_FUNCTION_ARGS) (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), errmsg("invalid number of points in external \"polygon\" value"))); - size = offsetof(POLYGON, p) +sizeof(poly->p[0]) * npts; + size = offsetof(POLYGON, p) + sizeof(poly->p[0]) * npts; poly = (POLYGON *) palloc0(size); /* zero any holes */ SET_VARSIZE(poly, size); @@ -4243,7 +4243,7 @@ path_add(PG_FUNCTION_ARGS) PG_RETURN_NULL(); base_size = sizeof(p1->p[0]) * (p1->npts + p2->npts); - size = offsetof(PATH, p) +base_size; + size = offsetof(PATH, p) + base_size; /* Check for integer overflow */ if (base_size / sizeof(p1->p[0]) != (p1->npts + p2->npts) || @@ -4385,7 +4385,7 @@ path_poly(PG_FUNCTION_ARGS) * Never overflows: the old size fit in MaxAllocSize, and the new size is * just a small constant larger. */ - size = offsetof(POLYGON, p) +sizeof(poly->p[0]) * path->npts; + size = offsetof(POLYGON, p) + sizeof(poly->p[0]) * path->npts; poly = (POLYGON *) palloc(size); SET_VARSIZE(poly, size); @@ -4460,7 +4460,7 @@ box_poly(PG_FUNCTION_ARGS) int size; /* map four corners of the box to a polygon */ - size = offsetof(POLYGON, p) +sizeof(poly->p[0]) * 4; + size = offsetof(POLYGON, p) + sizeof(poly->p[0]) * 4; poly = (POLYGON *) palloc(size); SET_VARSIZE(poly, size); @@ -4494,7 +4494,7 @@ poly_path(PG_FUNCTION_ARGS) * Never overflows: the old size fit in MaxAllocSize, and the new size is * smaller by a small constant. */ - size = offsetof(PATH, p) +sizeof(path->p[0]) * poly->npts; + size = offsetof(PATH, p) + sizeof(path->p[0]) * poly->npts; path = (PATH *) palloc(size); SET_VARSIZE(path, size); @@ -5172,7 +5172,7 @@ circle_poly(PG_FUNCTION_ARGS) errmsg("must request at least 2 points"))); base_size = sizeof(poly->p[0]) * npts; - size = offsetof(POLYGON, p) +base_size; + size = offsetof(POLYGON, p) + base_size; /* Check for integer overflow */ if (base_size / npts != sizeof(poly->p[0]) || size <= base_size) diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index bd4422e08a1..96ef25b900e 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -822,7 +822,7 @@ int2mul(PG_FUNCTION_ARGS) * The most practical way to detect overflow is to do the arithmetic in * int32 (so that the result can't overflow) and then do a range check. */ - result32 = (int32) arg1 *(int32) arg2; + result32 = (int32) arg1 * (int32) arg2; if (result32 < SHRT_MIN || result32 > SHRT_MAX) ereport(ERROR, diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index e256eaf55e5..3e206c21213 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -1661,7 +1661,7 @@ jsonb_agg_transfn(PG_FUNCTION_ARGS) { /* same for numeric */ v.val.numeric = - DatumGetNumeric(DirectFunctionCall1(numeric_uplus, + DatumGetNumeric(DirectFunctionCall1(numeric_uplus, NumericGetDatum(v.val.numeric))); } result->res = pushJsonbValue(&result->parseState, @@ -1891,7 +1891,7 @@ jsonb_object_agg_transfn(PG_FUNCTION_ARGS) { /* same for numeric */ v.val.numeric = - DatumGetNumeric(DirectFunctionCall1(numeric_uplus, + DatumGetNumeric(DirectFunctionCall1(numeric_uplus, NumericGetDatum(v.val.numeric))); } result->res = pushJsonbValue(&result->parseState, diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index d7ece68c18d..01df06ebfdb 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -84,7 +84,8 @@ typedef struct GetState char **path_names; /* field name(s) being sought */ int *path_indexes; /* array index(es) being sought */ bool *pathok; /* is path matched to current depth? */ - int *array_cur_index; /* current element index at each path level */ + int *array_cur_index; /* current element index at each path + * level */ } GetState; /* state for json_array_length */ diff --git a/src/backend/utils/adt/like_match.c b/src/backend/utils/adt/like_match.c index 1c37229e09f..634953ae672 100644 --- a/src/backend/utils/adt/like_match.c +++ b/src/backend/utils/adt/like_match.c @@ -236,7 +236,7 @@ MatchText(char *t, int tlen, char *p, int plen, * matching this pattern. */ return LIKE_ABORT; -} /* MatchText() */ +} /* MatchText() */ /* * like_escape() --- given a pattern and an ESCAPE string, diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index 3f6a9d3b828..38dc1266e04 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -71,8 +71,8 @@ * Function prototypes -- internal to this file only */ -static AbsoluteTime tm2abstime(struct pg_tm * tm, int tz); -static void reltime2tm(RelativeTime time, struct pg_tm * tm); +static AbsoluteTime tm2abstime(struct pg_tm *tm, int tz); +static void reltime2tm(RelativeTime time, struct pg_tm *tm); static void parsetinterval(char *i_string, AbsoluteTime *i_start, AbsoluteTime *i_end); @@ -96,7 +96,7 @@ GetCurrentAbsoluteTime(void) void -abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm * tm, char **tzn) +abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm *tm, char **tzn) { pg_time_t time = (pg_time_t) _time; struct pg_tm *tx; @@ -148,7 +148,7 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm * tm, char **tzn) * Note that tm has full year (not 1900-based) and 1-based month. */ static AbsoluteTime -tm2abstime(struct pg_tm * tm, int tz) +tm2abstime(struct pg_tm *tm, int tz) { int day; AbsoluteTime sec; @@ -680,7 +680,7 @@ reltimesend(PG_FUNCTION_ARGS) static void -reltime2tm(RelativeTime time, struct pg_tm * tm) +reltime2tm(RelativeTime time, struct pg_tm *tm) { double dtime = time; diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 24ae3c6886e..a2855984d51 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -390,7 +390,7 @@ assign_locale_messages(const char *newval, void *extra) * itself.) It's important that this not throw elog(ERROR). */ static void -free_struct_lconv(struct lconv * s) +free_struct_lconv(struct lconv *s) { if (s->decimal_point) free(s->decimal_point); @@ -419,7 +419,7 @@ free_struct_lconv(struct lconv * s) * about) are non-NULL. The field list must match free_struct_lconv(). */ static bool -struct_lconv_is_valid(struct lconv * s) +struct_lconv_is_valid(struct lconv *s) { if (s->decimal_point == NULL) return false; @@ -705,7 +705,7 @@ PGLC_localeconv(void) */ static size_t strftime_win32(char *dst, size_t dstlen, - const char *format, const struct tm * tm) + const char *format, const struct tm *tm) { size_t len; wchar_t wformat[8]; /* formats used below need 3 bytes */ @@ -756,7 +756,7 @@ strftime_win32(char *dst, size_t dstlen, /* Subroutine for cache_locale_time(). */ static void -cache_single_time(char **dst, const char *format, const struct tm * tm) +cache_single_time(char **dst, const char *format, const struct tm *tm) { char buf[MAX_L10N_DATA]; char *ptr; diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c index 304345b9044..94a77c9b6a3 100644 --- a/src/backend/utils/adt/rangetypes.c +++ b/src/backend/utils/adt/rangetypes.c @@ -2051,7 +2051,7 @@ range_parse(const char *string, char *flags, char **lbound_str, } else if (*ptr == ')') ptr++; - else /* must be a comma */ + else /* must be a comma */ ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed range literal: \"%s\"", diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 6a0d273bd26..5f3f7968d55 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -1260,7 +1260,7 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, quote_identifier(NameStr(idxrelrec->relname)), generate_relation_name(indrelid, NIL), quote_identifier(NameStr(amrec->amname))); - else /* currently, must be EXCLUDE constraint */ + else /* currently, must be EXCLUDE constraint */ appendStringInfo(&buf, "EXCLUDE USING %s (", quote_identifier(NameStr(amrec->amname))); } @@ -7374,17 +7374,17 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags) return false; return true; /* own parentheses */ } - case T_BoolExpr: /* lower precedence */ - case T_ArrayRef: /* other separators */ + case T_BoolExpr: /* lower precedence */ + case T_ArrayRef: /* other separators */ case T_ArrayExpr: /* other separators */ - case T_RowExpr: /* other separators */ + case T_RowExpr: /* other separators */ case T_CoalesceExpr: /* own parentheses */ case T_MinMaxExpr: /* own parentheses */ - case T_XmlExpr: /* own parentheses */ + case T_XmlExpr: /* own parentheses */ case T_NullIfExpr: /* other separators */ case T_Aggref: /* own parentheses */ case T_WindowFunc: /* own parentheses */ - case T_CaseExpr: /* other separators */ + case T_CaseExpr: /* other separators */ return true; default: return false; @@ -7425,16 +7425,16 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags) return false; return true; /* own parentheses */ } - case T_ArrayRef: /* other separators */ + case T_ArrayRef: /* other separators */ case T_ArrayExpr: /* other separators */ - case T_RowExpr: /* other separators */ + case T_RowExpr: /* other separators */ case T_CoalesceExpr: /* own parentheses */ case T_MinMaxExpr: /* own parentheses */ - case T_XmlExpr: /* own parentheses */ + case T_XmlExpr: /* own parentheses */ case T_NullIfExpr: /* other separators */ case T_Aggref: /* own parentheses */ case T_WindowFunc: /* own parentheses */ - case T_CaseExpr: /* other separators */ + case T_CaseExpr: /* other separators */ return true; default: return false; diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 22dabf59af2..33788a2b364 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -4205,7 +4205,7 @@ convert_string_datum(Datum value, Oid typid) { char *xfrmstr; size_t xfrmlen; - size_t xfrmlen2 PG_USED_FOR_ASSERTS_ONLY; + size_t xfrmlen2 PG_USED_FOR_ASSERTS_ONLY; /* * XXX: We could guess at a suitable output buffer size and only call @@ -4221,7 +4221,8 @@ convert_string_datum(Datum value, Oid typid) /* * * http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx? - * FeedbackID=99694 */ + * FeedbackID=99694 + */ { char x[1]; diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 3f6e0d4497b..d477e235507 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -455,7 +455,7 @@ timestamptz_in(PG_FUNCTION_ARGS) * don't care, so we don't bother being consistent. */ static int -parse_sane_timezone(struct pg_tm * tm, text *zone) +parse_sane_timezone(struct pg_tm *tm, text *zone) { char tzname[TZ_STRLEN_MAX + 1]; int rt; @@ -1526,7 +1526,7 @@ EncodeSpecialTimestamp(Timestamp dt, char *str) strcpy(str, EARLY); else if (TIMESTAMP_IS_NOEND(dt)) strcpy(str, LATE); - else /* shouldn't happen */ + else /* shouldn't happen */ elog(ERROR, "invalid argument for EncodeSpecialTimestamp"); } @@ -1740,7 +1740,7 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec) time -= (*min) * USECS_PER_MINUTE; *sec = time / USECS_PER_SEC; *fsec = time - (*sec * USECS_PER_SEC); -} /* dt2time() */ +} /* dt2time() */ /* @@ -1755,7 +1755,7 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec) * If attimezone is NULL, the global timezone setting will be used. */ int -timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone) +timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone) { Timestamp date; Timestamp time; @@ -1851,7 +1851,7 @@ timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, const char * Returns -1 on failure (value out of range). */ int -tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result) +tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result) { TimeOffset date; TimeOffset time; @@ -1899,7 +1899,7 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result) * Convert an interval data type to a tm structure. */ int -interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec) +interval2tm(Interval span, struct pg_tm *tm, fsec_t *fsec) { TimeOffset time; TimeOffset tfrac; @@ -1927,7 +1927,7 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec) } int -tm2interval(struct pg_tm * tm, fsec_t fsec, Interval *span) +tm2interval(struct pg_tm *tm, fsec_t fsec, Interval *span) { double total_months = (double) tm->tm_year * MONTHS_PER_YEAR + tm->tm_mon; @@ -1981,7 +1981,7 @@ interval_finite(PG_FUNCTION_ARGS) *---------------------------------------------------------*/ void -GetEpochTime(struct pg_tm * tm) +GetEpochTime(struct pg_tm *tm) { struct pg_tm *t0; pg_time_t epoch = 0; @@ -2011,7 +2011,7 @@ SetEpochTimestamp(void) tm2timestamp(tm, 0, NULL, &dt); return dt; -} /* SetEpochTimestamp() */ +} /* SetEpochTimestamp() */ /* * We are currently sharing some code between timestamp and timestamptz. @@ -4930,7 +4930,7 @@ timestamp_izone(PG_FUNCTION_ARGS) errmsg("timestamp out of range"))); PG_RETURN_TIMESTAMPTZ(result); -} /* timestamp_izone() */ +} /* timestamp_izone() */ /* timestamp_timestamptz() * Convert local timestamp to timestamp at GMT diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index 3e2fc6e9dfa..41e1ecd70f2 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -1015,7 +1015,8 @@ tsqueryrecv(PG_FUNCTION_ARGS) if (item->type == QI_VAL) { - size_t val_len; /* length after recoding to server encoding */ + size_t val_len; /* length after recoding to server + * encoding */ uint8 weight; uint8 prefix; const char *val; diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 76e5e541b63..a41eb1fa9c4 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -910,7 +910,7 @@ calc_rank_cd(const float4 *arrdata, TSVector txt, TSQuery query, int method) CurExtPos = ((double) (ext.q + ext.p)) / 2.0; if (NExtent > 0 && CurExtPos > PrevExtPos /* prevent division by * zero in a case of - multiple lexize */ ) + * multiple lexize */ ) SumDist += 1.0 / (CurExtPos - PrevExtPos); PrevExtPos = CurExtPos; diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index c694637c8fd..89aa0f1b32b 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -411,7 +411,7 @@ tsvector_bsearch(const TSVector tsv, char *lexeme, int lexeme_len) StopHigh = StopMiddle; else if (cmp > 0) StopLow = StopMiddle + 1; - else /* found it */ + else /* found it */ return StopMiddle; } @@ -1058,7 +1058,7 @@ tsvector_concat(PG_FUNCTION_ARGS) if (ptr2->haspos) dataoff += add_pos(in2, ptr2, out, ptr, maxpos) * sizeof(WordEntryPos); } - else /* must have ptr2->haspos */ + else /* must have ptr2->haspos */ { int addlen = add_pos(in2, ptr2, out, ptr, maxpos); @@ -1255,7 +1255,7 @@ checkclass_str(CHKVAL *chkval, WordEntry *entry, QueryOperand *val, posvec_iter++; } } - else /* data != NULL */ + else /* data != NULL */ { data->npos = posvec->npos; data->pos = posvec->pos; @@ -1489,7 +1489,7 @@ TS_phrase_output(ExecPhraseData *data, Lindex++; Rindex++; } - else /* Lpos > Rpos */ + else /* Lpos > Rpos */ { /* Rpos is not matched in Ldata, should we output it? */ if (emit & TSPO_R_ONLY) diff --git a/src/backend/utils/adt/tsvector_parser.c b/src/backend/utils/adt/tsvector_parser.c index 2680114f7c9..060d073fb71 100644 --- a/src/backend/utils/adt/tsvector_parser.c +++ b/src/backend/utils/adt/tsvector_parser.c @@ -363,7 +363,7 @@ gettoken_tsvector(TSVectorParseState state, else if (!t_isdigit(state->prsbuf)) PRSSYNTAXERROR; } - else /* internal error */ + else /* internal error */ elog(ERROR, "unrecognized state in gettoken_tsvector: %d", statecode); diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 5fe82400e72..cb1fd4d9cef 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -221,7 +221,7 @@ text_to_cstring_buffer(const text *src, char *dst, size_t dst_len) dst_len--; if (dst_len >= src_len) dst_len = src_len; - else /* ensure truncation is encoding-safe */ + else /* ensure truncation is encoding-safe */ dst_len = pg_mbcliplen(VARDATA_ANY(srcunpacked), src_len, dst_len); memcpy(dst, VARDATA_ANY(srcunpacked), dst_len); dst[dst_len] = '\0'; diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index b19044c46ca..74bfd56169a 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -1571,7 +1571,7 @@ SearchCatCacheList(CatCache *cache, oldcxt = MemoryContextSwitchTo(CacheMemoryContext); nmembers = list_length(ctlist); cl = (CatCList *) - palloc(offsetof(CatCList, members) +nmembers * sizeof(CatCTup *)); + palloc(offsetof(CatCList, members) + nmembers * sizeof(CatCTup *)); heap_copytuple_with_tuple(ntp, &cl->tuple); MemoryContextSwitchTo(oldcxt); heap_freetuple(ntp); diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 819121638ea..055705136a9 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -194,7 +194,7 @@ static struct SYSCACHECALLBACK int16 link; /* next callback index+1 for same cache */ SyscacheCallbackFunction function; Datum arg; -} syscache_callback_list[MAX_SYSCACHE_CALLBACKS]; +} syscache_callback_list[MAX_SYSCACHE_CALLBACKS]; static int16 syscache_callback_links[SysCacheSize]; @@ -204,7 +204,7 @@ static struct RELCACHECALLBACK { RelcacheCallbackFunction function; Datum arg; -} relcache_callback_list[MAX_RELCACHE_CALLBACKS]; +} relcache_callback_list[MAX_RELCACHE_CALLBACKS]; static int relcache_callback_count = 0; diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 0cf5001a758..6ba199b40df 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -888,8 +888,8 @@ load_domaintype_info(TypeCacheEntry *typentry) static int dcs_cmp(const void *a, const void *b) { - const DomainConstraintState *const * ca = (const DomainConstraintState *const *) a; - const DomainConstraintState *const * cb = (const DomainConstraintState *const *) b; + const DomainConstraintState *const *ca = (const DomainConstraintState *const *) a; + const DomainConstraintState *const *cb = (const DomainConstraintState *const *) b; return strcmp((*ca)->name, (*cb)->name); } diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 22004cb8192..cad75c80d8f 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -627,7 +627,7 @@ errcode_for_file_access(void) case ENOTDIR: /* Not a directory */ case EISDIR: /* Is a directory */ #if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */ - case ENOTEMPTY: /* Directory not empty */ + case ENOTEMPTY: /* Directory not empty */ #endif edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE; break; diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 28c2583f960..bfd1b118500 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -214,7 +214,7 @@ internal_load_library(const char *libname) * File not loaded yet. */ file_scanner = (DynamicFileList *) - malloc(offsetof(DynamicFileList, filename) +strlen(libname) + 1); + malloc(offsetof(DynamicFileList, filename) + strlen(libname) + 1); if (file_scanner == NULL) ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index f6d2b7d63ee..0382c158c54 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -1828,7 +1828,7 @@ Float8GetDatum(float8 X) */ struct varlena * -pg_detoast_datum(struct varlena * datum) +pg_detoast_datum(struct varlena *datum) { if (VARATT_IS_EXTENDED(datum)) return heap_tuple_untoast_attr(datum); @@ -1837,7 +1837,7 @@ pg_detoast_datum(struct varlena * datum) } struct varlena * -pg_detoast_datum_copy(struct varlena * datum) +pg_detoast_datum_copy(struct varlena *datum) { if (VARATT_IS_EXTENDED(datum)) return heap_tuple_untoast_attr(datum); @@ -1853,14 +1853,14 @@ pg_detoast_datum_copy(struct varlena * datum) } struct varlena * -pg_detoast_datum_slice(struct varlena * datum, int32 first, int32 count) +pg_detoast_datum_slice(struct varlena *datum, int32 first, int32 count) { /* Only get the specified portion from the toast rel */ return heap_tuple_untoast_attr_slice(datum, first, count); } struct varlena * -pg_detoast_datum_packed(struct varlena * datum) +pg_detoast_datum_packed(struct varlena *datum) { if (VARATT_IS_COMPRESSED(datum) || VARATT_IS_EXTERNAL(datum)) return heap_tuple_untoast_attr(datum); diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 1adc5841f73..578b1daccf2 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -331,7 +331,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags) } /* Initialize the hash header, plus a copy of the table name */ - hashp = (HTAB *) DynaHashAlloc(sizeof(HTAB) + strlen(tabname) +1); + hashp = (HTAB *) DynaHashAlloc(sizeof(HTAB) + strlen(tabname) + 1); MemSet(hashp, 0, sizeof(HTAB)); hashp->tabname = (char *) (hashp + 1); diff --git a/src/backend/utils/mb/wchar.c b/src/backend/utils/mb/wchar.c index fd51eedf7c6..9334039f78c 100644 --- a/src/backend/utils/mb/wchar.c +++ b/src/backend/utils/mb/wchar.c @@ -98,7 +98,7 @@ pg_euc2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) *to |= *from++; len -= 2; } - else /* must be ASCII */ + else /* must be ASCII */ { *to = *from++; len--; @@ -581,7 +581,7 @@ struct mbinterval /* auxiliary function for binary search in interval table */ static int -mbbisearch(pg_wchar ucs, const struct mbinterval * table, int max) +mbbisearch(pg_wchar ucs, const struct mbinterval *table, int max) { int min = 0; int mid; diff --git a/src/backend/utils/misc/backend_random.c b/src/backend/utils/misc/backend_random.c index d8556143dcd..9a0b2ce9ebc 100644 --- a/src/backend/utils/misc/backend_random.c +++ b/src/backend/utils/misc/backend_random.c @@ -69,9 +69,9 @@ typedef struct { bool initialized; unsigned short seed[3]; -} BackendRandomShmemStruct; +} BackendRandomShmemStruct; -static BackendRandomShmemStruct *BackendRandomShmem; +static BackendRandomShmemStruct * BackendRandomShmem; Size BackendRandomShmemSize(void) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 92e1d63b2f5..d9469e4181d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -136,15 +136,15 @@ static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg static void set_config_sourcefile(const char *name, char *sourcefile, int sourceline); -static bool call_bool_check_hook(struct config_bool * conf, bool *newval, +static bool call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, GucSource source, int elevel); -static bool call_int_check_hook(struct config_int * conf, int *newval, +static bool call_int_check_hook(struct config_int *conf, int *newval, void **extra, GucSource source, int elevel); -static bool call_real_check_hook(struct config_real * conf, double *newval, +static bool call_real_check_hook(struct config_real *conf, double *newval, void **extra, GucSource source, int elevel); -static bool call_string_check_hook(struct config_string * conf, char **newval, +static bool call_string_check_hook(struct config_string *conf, char **newval, void **extra, GucSource source, int elevel); -static bool call_enum_check_hook(struct config_enum * conf, int *newval, +static bool call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, GucSource source, int elevel); static bool check_log_destination(char **newval, void **extra, GucSource source); @@ -3951,17 +3951,17 @@ static int GUCNestLevel = 0; /* 1 when in main transaction */ static int guc_var_compare(const void *a, const void *b); static int guc_name_compare(const char *namea, const char *nameb); static void InitializeGUCOptionsFromEnvironment(void); -static void InitializeOneGUCOption(struct config_generic * gconf); -static void push_old_value(struct config_generic * gconf, GucAction action); -static void ReportGUCOption(struct config_generic * record); -static void reapply_stacked_values(struct config_generic * variable, - struct config_string * pHolder, +static void InitializeOneGUCOption(struct config_generic *gconf); +static void push_old_value(struct config_generic *gconf, GucAction action); +static void ReportGUCOption(struct config_generic *record); +static void reapply_stacked_values(struct config_generic *variable, + struct config_string *pHolder, GucStack *stack, const char *curvalue, GucContext curscontext, GucSource cursource); static void ShowGUCConfigOption(const char *name, DestReceiver *dest); static void ShowAllGUCConfig(DestReceiver *dest); -static char *_ShowOption(struct config_generic * record, bool use_units); +static char *_ShowOption(struct config_generic *record, bool use_units); static bool validate_option_array_item(const char *name, const char *value, bool skipIfNoPermissions); static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head_p); @@ -4022,7 +4022,7 @@ guc_strdup(int elevel, const char *src) * Detect whether strval is referenced anywhere in a GUC string item */ static bool -string_field_used(struct config_string * conf, char *strval) +string_field_used(struct config_string *conf, char *strval) { GucStack *stack; @@ -4045,7 +4045,7 @@ string_field_used(struct config_string * conf, char *strval) * states). */ static void -set_string_field(struct config_string * conf, char **field, char *newval) +set_string_field(struct config_string *conf, char **field, char *newval) { char *oldval = *field; @@ -4061,7 +4061,7 @@ set_string_field(struct config_string * conf, char **field, char *newval) * Detect whether an "extra" struct is referenced anywhere in a GUC item */ static bool -extra_field_used(struct config_generic * gconf, void *extra) +extra_field_used(struct config_generic *gconf, void *extra) { GucStack *stack; @@ -4106,7 +4106,7 @@ extra_field_used(struct config_generic * gconf, void *extra) * states). */ static void -set_extra_field(struct config_generic * gconf, void **field, void *newval) +set_extra_field(struct config_generic *gconf, void **field, void *newval) { void *oldval = *field; @@ -4126,7 +4126,7 @@ set_extra_field(struct config_generic * gconf, void **field, void *newval) * initialized to NULL before this is used, else we'll try to free() them. */ static void -set_stack_value(struct config_generic * gconf, config_var_value *val) +set_stack_value(struct config_generic *gconf, config_var_value *val) { switch (gconf->vartype) { @@ -4160,7 +4160,7 @@ set_stack_value(struct config_generic * gconf, config_var_value *val) * The "extra" field associated with the stack entry is cleared, too. */ static void -discard_stack_value(struct config_generic * gconf, config_var_value *val) +discard_stack_value(struct config_generic *gconf, config_var_value *val) { switch (gconf->vartype) { @@ -4283,7 +4283,7 @@ build_guc_variables(void) * list is expanded if needed. */ static bool -add_guc_variable(struct config_generic * var, int elevel) +add_guc_variable(struct config_generic *var, int elevel) { if (num_guc_variables + 1 >= size_guc_variables) { @@ -4420,8 +4420,8 @@ find_option(const char *name, bool create_placeholders, int elevel) static int guc_var_compare(const void *a, const void *b) { - const struct config_generic *confa = *(struct config_generic * const *) a; - const struct config_generic *confb = *(struct config_generic * const *) b; + const struct config_generic *confa = *(struct config_generic *const *) a; + const struct config_generic *confb = *(struct config_generic *const *) b; return guc_name_compare(confa->name, confb->name); } @@ -4566,7 +4566,7 @@ InitializeGUCOptionsFromEnvironment(void) * might fail, but that the hooks might wish to compute an "extra" struct. */ static void -InitializeOneGUCOption(struct config_generic * gconf) +InitializeOneGUCOption(struct config_generic *gconf) { gconf->status = 0; gconf->source = PGC_S_DEFAULT; @@ -4961,7 +4961,7 @@ ResetAllOptions(void) * Push previous state during transactional assignment to a GUC variable. */ static void -push_old_value(struct config_generic * gconf, GucAction action) +push_old_value(struct config_generic *gconf, GucAction action) { GucStack *stack; @@ -5138,7 +5138,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel) /* we keep the current active value */ discard_stack_value(gconf, &stack->prior); } - else /* must be GUC_LOCAL */ + else /* must be GUC_LOCAL */ restorePrior = true; } else if (prev == NULL || @@ -5385,7 +5385,7 @@ BeginReportingGUCOptions(void) * ReportGUCOption: if appropriate, transmit option value to frontend */ static void -ReportGUCOption(struct config_generic * record) +ReportGUCOption(struct config_generic *record) { if (reporting_enabled && (record->flags & GUC_REPORT)) { @@ -5614,7 +5614,7 @@ parse_real(const char *value, double *result) * allocated for modification. */ const char * -config_enum_lookup_by_value(struct config_enum * record, int val) +config_enum_lookup_by_value(struct config_enum *record, int val) { const struct config_enum_entry *entry; @@ -5637,7 +5637,7 @@ config_enum_lookup_by_value(struct config_enum * record, int val) * true. If it's not found, return FALSE and retval is set to 0. */ bool -config_enum_lookup_by_name(struct config_enum * record, const char *value, +config_enum_lookup_by_name(struct config_enum *record, const char *value, int *retval) { const struct config_enum_entry *entry; @@ -5663,7 +5663,7 @@ config_enum_lookup_by_name(struct config_enum * record, const char *value, * If suffix is non-NULL, it is added to the end of the string. */ static char * -config_enum_get_options(struct config_enum * record, const char *prefix, +config_enum_get_options(struct config_enum *record, const char *prefix, const char *suffix, const char *separator) { const struct config_enum_entry *entry; @@ -5721,10 +5721,10 @@ config_enum_get_options(struct config_enum * record, const char *prefix, * Returns true if OK, false if not (or throws error, if elevel >= ERROR) */ static bool -parse_and_validate_value(struct config_generic * record, +parse_and_validate_value(struct config_generic *record, const char *name, const char *value, GucSource source, int elevel, - union config_var_val * newval, void **newextra) + union config_var_val *newval, void **newextra) { switch (record->vartype) { @@ -7545,7 +7545,7 @@ init_custom_variable(const char *name, * variable into the GUC variable array, replacing any placeholder. */ static void -define_custom_variable(struct config_generic * variable) +define_custom_variable(struct config_generic *variable) { const char *name = variable->name; const char **nameAddr = &name; @@ -7645,8 +7645,8 @@ define_custom_variable(struct config_generic * variable) * fashion implied by the stack entry. */ static void -reapply_stacked_values(struct config_generic * variable, - struct config_string * pHolder, +reapply_stacked_values(struct config_generic *variable, + struct config_string *pHolder, GucStack *stack, const char *curvalue, GucContext curscontext, GucSource cursource) @@ -7842,7 +7842,7 @@ DefineCustomEnumVariable(const char *name, const char *long_desc, int *valueAddr, int bootValue, - const struct config_enum_entry * options, + const struct config_enum_entry *options, GucContext context, int flags, GucEnumCheckHook check_hook, @@ -8630,7 +8630,7 @@ show_all_file_settings(PG_FUNCTION_ARGS) } static char * -_ShowOption(struct config_generic * record, bool use_units) +_ShowOption(struct config_generic *record, bool use_units) { char buffer[256]; const char *val; @@ -8741,7 +8741,7 @@ _ShowOption(struct config_generic * record, bool use_units) * variable scontext, integer */ static void -write_one_nondefault_variable(FILE *fp, struct config_generic * gconf) +write_one_nondefault_variable(FILE *fp, struct config_generic *gconf) { if (gconf->source == PGC_S_DEFAULT) return; @@ -8977,7 +8977,7 @@ read_nondefault_variables(void) * never sends these, and RestoreGUCState() never changes them. */ static bool -can_skip_gucvar(struct config_generic * gconf) +can_skip_gucvar(struct config_generic *gconf) { return gconf->context == PGC_POSTMASTER || gconf->context == PGC_INTERNAL || gconf->source == PGC_S_DEFAULT; @@ -8990,7 +8990,7 @@ can_skip_gucvar(struct config_generic * gconf) * It's OK to overestimate, but not to underestimate. */ static Size -estimate_variable_size(struct config_generic * gconf) +estimate_variable_size(struct config_generic *gconf) { Size size; Size valsize = 0; @@ -9162,7 +9162,7 @@ do_serialize_binary(char **destptr, Size *maxbytes, void *val, Size valsize) */ static void serialize_variable(char **destptr, Size *maxbytes, - struct config_generic * gconf) + struct config_generic *gconf) { if (can_skip_gucvar(gconf)) return; @@ -9783,7 +9783,7 @@ GUC_check_errcode(int sqlerrcode) */ static bool -call_bool_check_hook(struct config_bool * conf, bool *newval, void **extra, +call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -9817,7 +9817,7 @@ call_bool_check_hook(struct config_bool * conf, bool *newval, void **extra, } static bool -call_int_check_hook(struct config_int * conf, int *newval, void **extra, +call_int_check_hook(struct config_int *conf, int *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -9851,7 +9851,7 @@ call_int_check_hook(struct config_int * conf, int *newval, void **extra, } static bool -call_real_check_hook(struct config_real * conf, double *newval, void **extra, +call_real_check_hook(struct config_real *conf, double *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -9885,7 +9885,7 @@ call_real_check_hook(struct config_real * conf, double *newval, void **extra, } static bool -call_string_check_hook(struct config_string * conf, char **newval, void **extra, +call_string_check_hook(struct config_string *conf, char **newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -9919,7 +9919,7 @@ call_string_check_hook(struct config_string * conf, char **newval, void **extra, } static bool -call_enum_check_hook(struct config_enum * conf, int *newval, void **extra, +call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c index 45d793c1e86..9d8f02a1799 100644 --- a/src/backend/utils/mmgr/aset.c +++ b/src/backend/utils/mmgr/aset.c @@ -152,7 +152,7 @@ typedef struct AllocBlockData AllocBlock next; /* next block in aset's blocks list, if any */ char *freeptr; /* start of free space in this block */ char *endptr; /* end of space in this block */ -} AllocBlockData; +} AllocBlockData; /* * AllocChunk @@ -176,7 +176,7 @@ typedef struct AllocChunkData void *aset; /* there must not be any padding to reach a MAXALIGN boundary here! */ -} AllocChunkData; +} AllocChunkData; /* * AllocPointerIsValid diff --git a/src/backend/utils/mmgr/slab.c b/src/backend/utils/mmgr/slab.c index e59154ddda4..2cf58059d03 100644 --- a/src/backend/utils/mmgr/slab.c +++ b/src/backend/utils/mmgr/slab.c @@ -190,7 +190,7 @@ SlabContextCreate(MemoryContext parent, Size freelistSize; SlabContext *slab; - StaticAssertStmt(offsetof(SlabChunk, slab) +sizeof(MemoryContext) == + StaticAssertStmt(offsetof(SlabChunk, slab) + sizeof(MemoryContext) == MAXALIGN(sizeof(SlabChunk)), "padding calculation in SlabChunk is wrong"); @@ -221,7 +221,7 @@ SlabContextCreate(MemoryContext parent, /* Do the type-independent part of context creation */ slab = (SlabContext *) MemoryContextCreate(T_SlabContext, - (offsetof(SlabContext, freelist) +freelistSize), + (offsetof(SlabContext, freelist) + freelistSize), &SlabMethods, parent, name); diff --git a/src/backend/utils/resowner/resowner.c b/src/backend/utils/resowner/resowner.c index af46d781253..8f324cd5804 100644 --- a/src/backend/utils/resowner/resowner.c +++ b/src/backend/utils/resowner/resowner.c @@ -128,7 +128,7 @@ typedef struct ResourceOwnerData /* We can remember up to MAX_RESOWNER_LOCKS references to local locks. */ int nlocks; /* number of owned locks */ LOCALLOCK *locks[MAX_RESOWNER_LOCKS]; /* list of owned locks */ -} ResourceOwnerData; +} ResourceOwnerData; /***************************************************************************** diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index 8a8db0fd337..5614d970bd6 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -263,7 +263,7 @@ typedef enum #define RUN_SECOND 1 typedef int (*SortTupleComparator) (const SortTuple *a, const SortTuple *b, - Tuplesortstate *state); + Tuplesortstate *state); /* * Private state of a Tuplesort operation. @@ -314,7 +314,7 @@ struct Tuplesortstate * memory space thereby released. */ void (*writetup) (Tuplesortstate *state, int tapenum, - SortTuple *stup); + SortTuple *stup); /* * Function to read a stored tuple from tape back into memory. 'len' is @@ -322,7 +322,7 @@ struct Tuplesortstate * from the slab memory arena, or is palloc'd, see readtup_alloc(). */ void (*readtup) (Tuplesortstate *state, SortTuple *stup, - int tapenum, unsigned int len); + int tapenum, unsigned int len); /* * This array holds the tuples now in sort memory. If we are in state @@ -2391,7 +2391,7 @@ inittapes(Tuplesortstate *state) * case it's not important to account for tuple space, so we don't care if * LACKMEM becomes inaccurate.) */ - tapeSpace = (int64) maxTapes *TAPE_BUFFER_OVERHEAD; + tapeSpace = (int64) maxTapes * TAPE_BUFFER_OVERHEAD; if (tapeSpace + GetMemoryChunkSpace(state->memtuples) < state->allowedMem) USEMEM(state, tapeSpace); |