diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c index dbad776431..ed16f93acc 100644 --- a/src/backend/access/brin/brin_minmax_multi.c +++ b/src/backend/access/brin/brin_minmax_multi.c @@ -223,7 +223,8 @@ typedef struct SerializedRanges static SerializedRanges *brin_range_serialize(Ranges *range); -static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range); +static Ranges *brin_range_deserialize(int maxvalues, + SerializedRanges *serialized); /* diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 0aa4b334ab..6458a9c276 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -733,11 +733,11 @@ add_reloption(relopt_gen *newoption) * 'relopt_struct_size'. */ void -init_local_reloptions(local_relopts *opts, Size relopt_struct_size) +init_local_reloptions(local_relopts *relopts, Size relopt_struct_size) { - opts->options = NIL; - opts->validators = NIL; - opts->relopt_struct_size = relopt_struct_size; + relopts->options = NIL; + relopts->validators = NIL; + relopts->relopt_struct_size = relopt_struct_size; } /* @@ -746,9 +746,9 @@ init_local_reloptions(local_relopts *opts, Size relopt_struct_size) * build_local_reloptions(). */ void -register_reloptions_validator(local_relopts *opts, relopts_validator validator) +register_reloptions_validator(local_relopts *relopts, relopts_validator validator) { - opts->validators = lappend(opts->validators, validator); + relopts->validators = lappend(relopts->validators, validator); } /* diff --git a/src/backend/access/gin/ginpostinglist.c b/src/backend/access/gin/ginpostinglist.c index 6b73715496..68356d55c0 100644 --- a/src/backend/access/gin/ginpostinglist.c +++ b/src/backend/access/gin/ginpostinglist.c @@ -281,11 +281,11 @@ ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize, * The number of items is returned in *ndecoded. */ ItemPointer -ginPostingListDecode(GinPostingList *plist, int *ndecoded) +ginPostingListDecode(GinPostingList *plist, int *ndecoded_out) { return ginPostingListDecodeAllSegments(plist, SizeOfGinPostingList(plist), - ndecoded); + ndecoded_out); } /* diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index 374e64e808..fb0f466708 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -162,7 +162,7 @@ static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate, BlockNumber parentblk, OffsetNumber downlinkoffnum); static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate, BlockNumber childblkno, int level, - BlockNumber *parentblk, + BlockNumber *parentblkno, OffsetNumber *downlinkoffnum); static void gistProcessEmptyingQueue(GISTBuildState *buildstate); static void gistEmptyAllBuffers(GISTBuildState *buildstate); @@ -171,7 +171,8 @@ static int gistGetMaxLevel(Relation index); static void gistInitParentMap(GISTBuildState *buildstate); static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, BlockNumber parent); -static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent); +static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, + Buffer parentbuf); static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child); diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c index c6c7dfe4c2..538e3880c9 100644 --- a/src/backend/access/gist/gistbuildbuffers.c +++ b/src/backend/access/gist/gistbuildbuffers.c @@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb, static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb, GISTNodeBuffer *nodeBuffer); static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer, - IndexTuple item); + IndexTuple itup); static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer, - IndexTuple *item); + IndexTuple *itup); static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb); static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum); diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c index f190decdff..0aa6e58a62 100644 --- a/src/backend/access/gist/gistvacuum.c +++ b/src/backend/access/gist/gistvacuum.c @@ -49,7 +49,7 @@ static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno, static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info, GistVacState *vstate); static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, - Buffer buffer, OffsetNumber downlink, + Buffer parentBuffer, OffsetNumber downlink, Buffer leafBuffer); /* diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c index bbb542b322..6db9a1fca1 100644 --- a/src/backend/access/transam/generic_xlog.c +++ b/src/backend/access/transam/generic_xlog.c @@ -69,7 +69,7 @@ struct GenericXLogState }; static void writeFragment(PageData *pageData, OffsetNumber offset, - OffsetNumber len, const char *data); + OffsetNumber length, const char *data); static void computeRegionDelta(PageData *pageData, const char *curpage, const char *targetpage, int targetStart, int targetEnd, diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 7abc6a0705..2bb975943c 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -354,7 +354,7 @@ static void AtSubStart_Memory(void); static void AtSubStart_ResourceOwner(void); static void ShowTransactionState(const char *str); -static void ShowTransactionStateRec(const char *str, TransactionState state); +static void ShowTransactionStateRec(const char *str, TransactionState s); static const char *BlockStateAsString(TBlockState blockState); static const char *TransStateAsString(TransState state); diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 81d339d57d..eb0430fe98 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -648,7 +648,7 @@ static void XLogReportParameters(void); static int LocalSetXLogInsertAllowed(void); static void CreateEndOfRecoveryRecord(void); static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn, - XLogRecPtr missingContrecPtr, + XLogRecPtr pagePtr, TimeLineID newTLI); static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags); static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo); diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c index 24f9755e5d..5ca15ebbf2 100644 --- a/src/backend/access/transam/xloginsert.c +++ b/src/backend/access/transam/xloginsert.c @@ -1094,7 +1094,7 @@ XLogSaveBufferForHint(Buffer buffer, bool buffer_std) * the unused space to be left out from the WAL record, making it smaller. */ XLogRecPtr -log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno, +log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno, Page page, bool page_std) { int flags; @@ -1105,7 +1105,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno, flags |= REGBUF_STANDARD; XLogBeginInsert(); - XLogRegisterBlock(0, rlocator, forkNum, blkno, page, flags); + XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags); recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI); /* @@ -1126,7 +1126,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno, * because we can write multiple pages in a single WAL record. */ void -log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages, +log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages, BlockNumber *blknos, Page *pages, bool page_std) { int flags; @@ -1156,7 +1156,7 @@ log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages, nbatch = 0; while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages) { - XLogRegisterBlock(nbatch, rlocator, forkNum, blknos[i], pages[i], flags); + XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags); i++; nbatch++; } @@ -1192,15 +1192,15 @@ log_newpage_buffer(Buffer buffer, bool page_std) { Page page = BufferGetPage(buffer); RelFileLocator rlocator; - ForkNumber forkNum; + ForkNumber forknum; BlockNumber blkno; /* Shared buffers should be modified in a critical section. */ Assert(CritSectionCount > 0); - BufferGetTag(buffer, &rlocator, &forkNum, &blkno); + BufferGetTag(buffer, &rlocator, &forknum, &blkno); - return log_newpage(&rlocator, forkNum, blkno, page, page_std); + return log_newpage(&rlocator, forknum, blkno, page, page_std); } /* @@ -1221,7 +1221,7 @@ log_newpage_buffer(Buffer buffer, bool page_std) * cause a deadlock through some other means. */ void -log_newpage_range(Relation rel, ForkNumber forkNum, +log_newpage_range(Relation rel, ForkNumber forknum, BlockNumber startblk, BlockNumber endblk, bool page_std) { @@ -1253,7 +1253,7 @@ log_newpage_range(Relation rel, ForkNumber forkNum, nbufs = 0; while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk) { - Buffer buf = ReadBufferExtended(rel, forkNum, blkno, + Buffer buf = ReadBufferExtended(rel, forknum, blkno, RBM_NORMAL, NULL); LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index 050d2f424e..c1c9f1995b 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -47,7 +47,7 @@ static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength); static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen); static void XLogReaderInvalReadState(XLogReaderState *state); -static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking); +static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking); static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr, XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess); static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record, diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index dc4c1e748d..aa5a2ed948 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -104,17 +104,17 @@ typedef struct bool binary_upgrade_record_init_privs = false; static void ExecGrantStmt_oids(InternalGrant *istmt); -static void ExecGrant_Relation(InternalGrant *grantStmt); -static void ExecGrant_Database(InternalGrant *grantStmt); -static void ExecGrant_Fdw(InternalGrant *grantStmt); -static void ExecGrant_ForeignServer(InternalGrant *grantStmt); -static void ExecGrant_Function(InternalGrant *grantStmt); -static void ExecGrant_Language(InternalGrant *grantStmt); -static void ExecGrant_Largeobject(InternalGrant *grantStmt); -static void ExecGrant_Namespace(InternalGrant *grantStmt); -static void ExecGrant_Tablespace(InternalGrant *grantStmt); -static void ExecGrant_Type(InternalGrant *grantStmt); -static void ExecGrant_Parameter(InternalGrant *grantStmt); +static void ExecGrant_Relation(InternalGrant *istmt); +static void ExecGrant_Database(InternalGrant *istmt); +static void ExecGrant_Fdw(InternalGrant *istmt); +static void ExecGrant_ForeignServer(InternalGrant *istmt); +static void ExecGrant_Function(InternalGrant *istmt); +static void ExecGrant_Language(InternalGrant *istmt); +static void ExecGrant_Largeobject(InternalGrant *istmt); +static void ExecGrant_Namespace(InternalGrant *istmt); +static void ExecGrant_Tablespace(InternalGrant *istmt); +static void ExecGrant_Type(InternalGrant *istmt); +static void ExecGrant_Parameter(InternalGrant *istmt); static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames); static void SetDefaultACL(InternalDefaultACL *iacls); diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index dbb4b008a0..a7022824d8 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -3644,7 +3644,7 @@ PopOverrideSearchPath(void) * database's encoding. */ Oid -get_collation_oid(List *name, bool missing_ok) +get_collation_oid(List *collname, bool missing_ok) { char *schemaname; char *collation_name; @@ -3654,7 +3654,7 @@ get_collation_oid(List *name, bool missing_ok) ListCell *l; /* deconstruct the name list */ - DeconstructQualifiedName(name, &schemaname, &collation_name); + DeconstructQualifiedName(collname, &schemaname, &collation_name); if (schemaname) { @@ -3690,7 +3690,7 @@ get_collation_oid(List *name, bool missing_ok) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("collation \"%s\" for encoding \"%s\" does not exist", - NameListToString(name), GetDatabaseEncodingName()))); + NameListToString(collname), GetDatabaseEncodingName()))); return InvalidOid; } @@ -3698,7 +3698,7 @@ get_collation_oid(List *name, bool missing_ok) * get_conversion_oid - find a conversion by possibly qualified name */ Oid -get_conversion_oid(List *name, bool missing_ok) +get_conversion_oid(List *conname, bool missing_ok) { char *schemaname; char *conversion_name; @@ -3707,7 +3707,7 @@ get_conversion_oid(List *name, bool missing_ok) ListCell *l; /* deconstruct the name list */ - DeconstructQualifiedName(name, &schemaname, &conversion_name); + DeconstructQualifiedName(conname, &schemaname, &conversion_name); if (schemaname) { @@ -3745,7 +3745,7 @@ get_conversion_oid(List *name, bool missing_ok) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("conversion \"%s\" does not exist", - NameListToString(name)))); + NameListToString(conname)))); return conoid; } diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index f248ad42b7..308dc93f63 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -125,9 +125,9 @@ static bool have_createdb_privilege(void); static void remove_dbtablespaces(Oid db_id); static bool check_db_file_conflict(Oid db_id); static int errdetail_busy_db(int notherbackends, int npreparedxacts); -static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid, +static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid, Oid dst_tsid); -static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath); +static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath); static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid, Oid dbid, char *srcpath, List *rlocatorlist, Snapshot snapshot); @@ -136,8 +136,8 @@ static CreateDBRelInfo *ScanSourceDatabasePgClassTuple(HeapTupleData *tuple, char *srcpath); static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid, bool isRedo); -static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid, - Oid dst_tsid); +static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid, + Oid src_tsid, Oid dst_tsid); static void recovery_create_dbdir(char *path, bool only_tblspc); /* diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c index 6a8735edf7..1f1181b560 100644 --- a/src/backend/executor/execIndexing.c +++ b/src/backend/executor/execIndexing.c @@ -130,7 +130,7 @@ static bool check_exclusion_or_unique_constraint(Relation heap, Relation index, Datum *values, bool *isnull, EState *estate, bool newIndex, CEOUC_WAIT_MODE waitMode, - bool errorOK, + bool violationOK, ItemPointer conflictTid); static bool index_recheck_constraint(Relation index, Oid *constr_procs, diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c index f1fd7f7e8b..99512826c5 100644 --- a/src/backend/executor/execParallel.c +++ b/src/backend/executor/execParallel.c @@ -126,9 +126,9 @@ typedef struct ExecParallelInitializeDSMContext /* Helper functions that run in the parallel leader. */ static char *ExecSerializePlan(Plan *plan, EState *estate); -static bool ExecParallelEstimate(PlanState *node, +static bool ExecParallelEstimate(PlanState *planstate, ExecParallelEstimateContext *e); -static bool ExecParallelInitializeDSM(PlanState *node, +static bool ExecParallelInitializeDSM(PlanState *planstate, ExecParallelInitializeDSMContext *d); static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize); diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 933c304901..fe74e49814 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -396,7 +396,7 @@ static void prepare_projection_slot(AggState *aggstate, TupleTableSlot *slot, int currentSet); static void finalize_aggregates(AggState *aggstate, - AggStatePerAgg peragg, + AggStatePerAgg peraggs, AggStatePerGroup pergroup); static TupleTableSlot *project_aggregates(AggState *aggstate); static void find_cols(AggState *aggstate, Bitmapset **aggregated, @@ -407,12 +407,11 @@ static void build_hash_table(AggState *aggstate, int setno, long nbuckets); static void hashagg_recompile_expressions(AggState *aggstate, bool minslot, bool nullcheck); static long hash_choose_num_buckets(double hashentrysize, - long estimated_nbuckets, - Size memory); + long ngroups, Size memory); static int hash_choose_num_partitions(double input_groups, double hashentrysize, int used_bits, - int *log2_npartittions); + int *log2_npartitions); static void initialize_hash_entry(AggState *aggstate, TupleHashTable hashtable, TupleHashEntry entry); @@ -432,11 +431,11 @@ static HashAggBatch *hashagg_batch_new(LogicalTape *input_tape, int setno, int64 input_tuples, double input_card, int used_bits); static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp); -static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts, +static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset, int used_bits, double input_groups, double hashentrysize); static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill, - TupleTableSlot *slot, uint32 hash); + TupleTableSlot *inputslot, uint32 hash); static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill, int setno); static Datum GetAggInitVal(Datum textInitVal, Oid transtype); diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index 77dd1dae8b..6622b202c2 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -62,9 +62,9 @@ static HashJoinTuple ExecParallelHashTupleAlloc(HashJoinTable hashtable, dsa_pointer *shared); static void MultiExecPrivateHash(HashState *node); static void MultiExecParallelHash(HashState *node); -static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table, +static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable, int bucketno); -static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table, +static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable, HashJoinTuple tuple); static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head, HashJoinTuple tuple, @@ -73,7 +73,7 @@ static void ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable); static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable); static void ExecParallelHashRepartitionRest(HashJoinTable hashtable); -static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table, +static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable, dsa_pointer *shared); static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable, int batchno, diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 87403e2478..2718c2113f 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -145,7 +145,7 @@ static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate, TupleTableSlot *tupleSlot); static bool ExecHashJoinNewBatch(HashJoinState *hjstate); static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate); -static void ExecParallelHashJoinPartitionOuter(HashJoinState *node); +static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate); /* ---------------------------------------------------------------- @@ -1502,11 +1502,11 @@ ExecHashJoinInitializeDSM(HashJoinState *state, ParallelContext *pcxt) * ---------------------------------------------------------------- */ void -ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt) +ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt) { int plan_node_id = state->js.ps.plan->plan_node_id; ParallelHashJoinState *pstate = - shm_toc_lookup(cxt->toc, plan_node_id, false); + shm_toc_lookup(pcxt->toc, plan_node_id, false); /* * It would be possible to reuse the shared hash table in single-batch diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c index d2bceb97c3..7bfe02464e 100644 --- a/src/backend/executor/nodeMemoize.c +++ b/src/backend/executor/nodeMemoize.c @@ -133,8 +133,8 @@ typedef struct MemoizeEntry static uint32 MemoizeHash_hash(struct memoize_hash *tb, const MemoizeKey *key); static bool MemoizeHash_equal(struct memoize_hash *tb, - const MemoizeKey *params1, - const MemoizeKey *params2); + const MemoizeKey *key1, + const MemoizeKey *key2); #define SH_PREFIX memoize #define SH_ELEMENT_TYPE MemoizeEntry diff --git a/src/backend/lib/bloomfilter.c b/src/backend/lib/bloomfilter.c index 465ca7cf67..3ef67d35ac 100644 --- a/src/backend/lib/bloomfilter.c +++ b/src/backend/lib/bloomfilter.c @@ -55,7 +55,7 @@ static int my_bloom_power(uint64 target_bitset_bits); static int optimal_k(uint64 bitset_bits, int64 total_elems); static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem, size_t len); -static inline uint32 mod_m(uint32 a, uint64 m); +static inline uint32 mod_m(uint32 val, uint64 m); /* * Create Bloom filter in caller's memory context. We aim for a false positive diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c index 4264da5bb0..98c40e17b6 100644 --- a/src/backend/replication/logical/decode.c +++ b/src/backend/replication/logical/decode.c @@ -62,13 +62,13 @@ static void DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf, /* common function to decode tuples */ -static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tup); +static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tuple); /* helper functions for decoding transactions */ static inline bool FilterPrepare(LogicalDecodingContext *ctx, TransactionId xid, const char *gid); static bool DecodeTXNNeedSkip(LogicalDecodingContext *ctx, - XLogRecordBuffer *buf, Oid dbId, + XLogRecordBuffer *buf, Oid txn_dbid, RepOriginId origin_id); /* diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index eaca406d30..56f753d987 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -312,7 +312,8 @@ static inline void cleanup_subxact_info(void); * Serialize and deserialize changes for a toplevel transaction. */ static void stream_cleanup_files(Oid subid, TransactionId xid); -static void stream_open_file(Oid subid, TransactionId xid, bool first); +static void stream_open_file(Oid subid, TransactionId xid, + bool first_segment); static void stream_write_change(char action, StringInfo s); static void stream_close_file(void); diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 62e0ffecd8..03b13ae679 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -44,7 +44,7 @@ static void pgoutput_begin_txn(LogicalDecodingContext *ctx, static void pgoutput_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); static void pgoutput_change(LogicalDecodingContext *ctx, - ReorderBufferTXN *txn, Relation rel, + ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); static void pgoutput_truncate(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int nrelations, Relation relations[], @@ -212,7 +212,7 @@ typedef struct PGOutputTxnData /* Map used to remember which relation schemas we sent. */ static HTAB *RelationSyncCache = NULL; -static void init_rel_sync_cache(MemoryContext decoding_context); +static void init_rel_sync_cache(MemoryContext cachectx); static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit); static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data, Relation relation); diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index 8fec1cb4a5..0bd0031188 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -108,7 +108,7 @@ static void ReplicationSlotDropPtr(ReplicationSlot *slot); /* internal persistency functions */ static void RestoreSlotFromDisk(const char *name); static void CreateSlotOnDisk(ReplicationSlot *slot); -static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel); +static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel); /* * Report shared-memory space needed by ReplicationSlotsShmemInit. diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index e898ffad7b..5b0e531f97 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -459,7 +459,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) ) -static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, +static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, bool *hit); @@ -493,7 +493,7 @@ static void RelationCopyStorageUsingBuffer(RelFileLocator srclocator, static void AtProcExit_Buffers(int code, Datum arg); static void CheckForBufferLeaks(void); static int rlocator_comparator(const void *p1, const void *p2); -static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b); +static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb); static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b); static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg); diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index 56b88594cc..b0b4eeb3bd 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -104,7 +104,7 @@ static void extendBufFile(BufFile *file); static void BufFileLoadBuffer(BufFile *file); static void BufFileDumpBuffer(BufFile *file); static void BufFileFlush(BufFile *file); -static File MakeNewFileSetSegment(BufFile *file, int segment); +static File MakeNewFileSetSegment(BufFile *buffile, int segment); /* * Create BufFile and perform the common initialization. diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c index 005def56dc..a6b0533103 100644 --- a/src/backend/storage/freespace/freespace.c +++ b/src/backend/storage/freespace/freespace.c @@ -111,7 +111,7 @@ static int fsm_set_and_search(Relation rel, FSMAddress addr, uint16 slot, static BlockNumber fsm_search(Relation rel, uint8 min_cat); static uint8 fsm_vacuum_page(Relation rel, FSMAddress addr, BlockNumber start, BlockNumber end, - bool *eof); + bool *eof_p); /******** Public API ********/ diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index 9d86bbe872..a360325f86 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -1045,7 +1045,7 @@ dsm_unpin_segment(dsm_handle handle) * Find an existing mapping for a shared memory segment, if there is one. */ dsm_segment * -dsm_find_mapping(dsm_handle h) +dsm_find_mapping(dsm_handle handle) { dlist_iter iter; dsm_segment *seg; @@ -1053,7 +1053,7 @@ dsm_find_mapping(dsm_handle h) dlist_foreach(iter, &dsm_segment_list) { seg = dlist_container(dsm_segment, node, iter.cur); - if (seg->handle == h) + if (seg->handle == handle) return seg; } diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index 0555b02a8d..382f4cfb73 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -343,7 +343,7 @@ static bool KnownAssignedXidExists(TransactionId xid); static void KnownAssignedXidsRemove(TransactionId xid); static void KnownAssignedXidsRemoveTree(TransactionId xid, int nsubxids, TransactionId *subxids); -static void KnownAssignedXidsRemovePreceding(TransactionId xid); +static void KnownAssignedXidsRemovePreceding(TransactionId removeXid); static int KnownAssignedXidsGet(TransactionId *xarray, TransactionId xmax); static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray, TransactionId *xmin, diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 38317edaf9..d274c9b1dc 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -1913,13 +1913,13 @@ LWLockReleaseAll(void) * This is meant as debug support only. */ bool -LWLockHeldByMe(LWLock *l) +LWLockHeldByMe(LWLock *lock) { int i; for (i = 0; i < num_held_lwlocks; i++) { - if (held_lwlocks[i].lock == l) + if (held_lwlocks[i].lock == lock) return true; } return false; @@ -1931,14 +1931,14 @@ LWLockHeldByMe(LWLock *l) * This is meant as debug support only. */ bool -LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride) +LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride) { char *held_lock_addr; char *begin; char *end; int i; - begin = (char *) l; + begin = (char *) lock; end = begin + nlocks * stride; for (i = 0; i < num_held_lwlocks; i++) { @@ -1957,13 +1957,13 @@ LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride) * This is meant as debug support only. */ bool -LWLockHeldByMeInMode(LWLock *l, LWLockMode mode) +LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode) { int i; for (i = 0; i < num_held_lwlocks; i++) { - if (held_lwlocks[i].lock == l && held_lwlocks[i].mode == mode) + if (held_lwlocks[i].lock == lock && held_lwlocks[i].mode == mode) return true; } return false; diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 562ac5b432..5f2a4805d8 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -446,7 +446,7 @@ static void SerialSetActiveSerXmin(TransactionId xid); static uint32 predicatelock_hash(const void *key, Size keysize); static void SummarizeOldestCommittedSxact(void); -static Snapshot GetSafeSnapshot(Snapshot snapshot); +static Snapshot GetSafeSnapshot(Snapshot origSnapshot); static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot, VirtualTransactionId *sourcevxid, int sourcepid); diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 3deac496ee..a515bb36ac 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -121,7 +121,7 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */ /* local routines */ -static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, +static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo); static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior); static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum, @@ -135,9 +135,9 @@ static void _fdvec_resize(SMgrRelation reln, int nseg); static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum, BlockNumber segno); -static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno, +static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum, BlockNumber segno, int oflags); -static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno, +static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno, bool skipFsync, int behavior); static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum, MdfdVec *seg); @@ -160,7 +160,7 @@ mdinit(void) * Note: this will return true for lingering files, with pending deletions */ bool -mdexists(SMgrRelation reln, ForkNumber forkNum) +mdexists(SMgrRelation reln, ForkNumber forknum) { /* * Close it first, to ensure that we notice if the fork has been unlinked @@ -168,9 +168,9 @@ mdexists(SMgrRelation reln, ForkNumber forkNum) * which already closes relations when dropping them. */ if (!InRecovery) - mdclose(reln, forkNum); + mdclose(reln, forknum); - return (mdopenfork(reln, forkNum, EXTENSION_RETURN_NULL) != NULL); + return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != NULL); } /* @@ -179,16 +179,16 @@ mdexists(SMgrRelation reln, ForkNumber forkNum) * If isRedo is true, it's okay for the relation to exist already. */ void -mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo) +mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo) { MdfdVec *mdfd; char *path; File fd; - if (isRedo && reln->md_num_open_segs[forkNum] > 0) + if (isRedo && reln->md_num_open_segs[forknum] > 0) return; /* created and opened already... */ - Assert(reln->md_num_open_segs[forkNum] == 0); + Assert(reln->md_num_open_segs[forknum] == 0); /* * We may be using the target table space for the first time in this @@ -203,7 +203,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo) reln->smgr_rlocator.locator.dbOid, isRedo); - path = relpath(reln->smgr_rlocator, forkNum); + path = relpath(reln->smgr_rlocator, forknum); fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY); @@ -225,8 +225,8 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo) pfree(path); - _fdvec_resize(reln, forkNum, 1); - mdfd = &reln->md_seg_fds[forkNum][0]; + _fdvec_resize(reln, forknum, 1); + mdfd = &reln->md_seg_fds[forknum][0]; mdfd->mdfd_vfd = fd; mdfd->mdfd_segno = 0; } @@ -237,7 +237,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo) * Note that we're passed a RelFileLocatorBackend --- by the time this is called, * there won't be an SMgrRelation hashtable entry anymore. * - * forkNum can be a fork number to delete a specific fork, or InvalidForkNumber + * forknum can be a fork number to delete a specific fork, or InvalidForkNumber * to delete all forks. * * For regular relations, we don't unlink the first segment file of the rel, @@ -278,16 +278,16 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo) * we are usually not in a transaction anymore when this is called. */ void -mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo) +mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo) { /* Now do the per-fork work */ - if (forkNum == InvalidForkNumber) + if (forknum == InvalidForkNumber) { - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - mdunlinkfork(rlocator, forkNum, isRedo); + for (forknum = 0; forknum <= MAX_FORKNUM; forknum++) + mdunlinkfork(rlocator, forknum, isRedo); } else - mdunlinkfork(rlocator, forkNum, isRedo); + mdunlinkfork(rlocator, forknum, isRedo); } /* @@ -315,18 +315,18 @@ do_truncate(const char *path) } static void -mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo) +mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo) { char *path; int ret; BlockNumber segno = 0; - path = relpath(rlocator, forkNum); + path = relpath(rlocator, forknum); /* * Delete or truncate the first segment. */ - if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator)) + if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator)) { if (!RelFileLocatorBackendIsTemp(rlocator)) { @@ -334,7 +334,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo) ret = do_truncate(path); /* Forget any pending sync requests for the first segment */ - register_forget_request(rlocator, forkNum, 0 /* first seg */ ); + register_forget_request(rlocator, forknum, 0 /* first seg */ ); } else ret = 0; @@ -367,7 +367,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo) */ if (!IsBinaryUpgrade) { - register_unlink_segment(rlocator, forkNum, 0 /* first seg */ ); + register_unlink_segment(rlocator, forknum, 0 /* first seg */ ); ++segno; } } @@ -403,7 +403,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo) * Forget any pending sync requests for this segment before we * try to unlink. */ - register_forget_request(rlocator, forkNum, segno); + register_forget_request(rlocator, forknum, segno); } if (unlink(segpath) < 0) diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c index 93493d4151..25791e23e1 100644 --- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c +++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c @@ -54,8 +54,8 @@ static int sjis2mic(const unsigned char *sjis, unsigned char *p, int len, bool n static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError); static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError); static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError); -static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError); -static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError); +static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError); +static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError); Datum euc_jp_to_sjis(PG_FUNCTION_ARGS) diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c index e00a2ca415..88e0deb5e9 100644 --- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c +++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c @@ -41,7 +41,7 @@ PG_FUNCTION_INFO_V1(mic_to_big5); */ static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError); -static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError); +static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError); static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError); static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError); static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError); diff --git a/src/include/access/genam.h b/src/include/access/genam.h index 134b20f1e6..e1c4fdbd03 100644 --- a/src/include/access/genam.h +++ b/src/include/access/genam.h @@ -161,9 +161,10 @@ extern void index_rescan(IndexScanDesc scan, extern void index_endscan(IndexScanDesc scan); extern void index_markpos(IndexScanDesc scan); extern void index_restrpos(IndexScanDesc scan); -extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot); -extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel, - Snapshot snapshot, ParallelIndexScanDesc target); +extern Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot); +extern void index_parallelscan_initialize(Relation heapRelation, + Relation indexRelation, Snapshot snapshot, + ParallelIndexScanDesc target); extern void index_parallelrescan(IndexScanDesc scan); extern IndexScanDesc index_beginscan_parallel(Relation heaprel, Relation indexrel, int nkeys, int norderbys, @@ -191,7 +192,7 @@ extern void index_store_float8_orderby_distances(IndexScanDesc scan, Oid *orderByTypes, IndexOrderByDistance *distances, bool recheckOrderBy); -extern bytea *index_opclass_options(Relation relation, AttrNumber attnum, +extern bytea *index_opclass_options(Relation indrel, AttrNumber attnum, Datum attoptions, bool validate); diff --git a/src/include/access/generic_xlog.h b/src/include/access/generic_xlog.h index c8363a4766..da45656427 100644 --- a/src/include/access/generic_xlog.h +++ b/src/include/access/generic_xlog.h @@ -40,6 +40,6 @@ extern void GenericXLogAbort(GenericXLogState *state); extern void generic_redo(XLogReaderState *record); extern const char *generic_identify(uint8 info); extern void generic_desc(StringInfo buf, XLogReaderState *record); -extern void generic_mask(char *pagedata, BlockNumber blkno); +extern void generic_mask(char *page, BlockNumber blkno); #endif /* GENERIC_XLOG_H */ diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h index 2935d2f353..145ec7743c 100644 --- a/src/include/access/gin_private.h +++ b/src/include/access/gin_private.h @@ -240,7 +240,8 @@ extern void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page */ typedef struct GinVacuumState GinVacuumState; -extern void ginVacuumPostingTreeLeaf(Relation rel, Buffer buf, GinVacuumState *gvs); +extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, + GinVacuumState *gvs); /* ginscan.c */ @@ -385,7 +386,7 @@ typedef GinScanOpaqueData *GinScanOpaque; extern IndexScanDesc ginbeginscan(Relation rel, int nkeys, int norderbys); extern void ginendscan(IndexScanDesc scan); -extern void ginrescan(IndexScanDesc scan, ScanKey key, int nscankeys, +extern void ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys); extern void ginNewScanKey(IndexScanDesc scan); extern void ginFreeScanKeys(GinScanOpaque so); @@ -469,10 +470,11 @@ extern void ginInsertCleanup(GinState *ginstate, bool full_clean, extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize, int *nwritten); -extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm); +extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm); -extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *ptr, int len, int *ndecoded); -extern ItemPointer ginPostingListDecode(GinPostingList *ptr, int *ndecoded); +extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len, + int *ndecoded_out); +extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out); extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na, ItemPointerData *b, uint32 nb, int *nmerged); diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index 240131ef71..093bf23443 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -445,16 +445,16 @@ extern void gistXLogPageReuse(Relation rel, BlockNumber blkno, extern XLogRecPtr gistXLogUpdate(Buffer buffer, OffsetNumber *todelete, int ntodelete, - IndexTuple *itup, int ntup, - Buffer leftchild); + IndexTuple *itup, int ituplen, + Buffer leftchildbuf); extern XLogRecPtr gistXLogDelete(Buffer buffer, OffsetNumber *todelete, int ntodelete, TransactionId latestRemovedXid); extern XLogRecPtr gistXLogSplit(bool page_is_leaf, SplitedPageLayout *dist, - BlockNumber origrlink, GistNSN oldnsn, - Buffer leftchild, bool markfollowright); + BlockNumber origrlink, GistNSN orignsn, + Buffer leftchildbuf, bool markfollowright); extern XLogRecPtr gistXLogAssignLSN(void); @@ -516,8 +516,8 @@ extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e, bool l, bool isNull); extern float gistpenalty(GISTSTATE *giststate, int attno, - GISTENTRY *key1, bool isNull1, - GISTENTRY *key2, bool isNull2); + GISTENTRY *orig, bool isNullOrig, + GISTENTRY *add, bool isNullAdd); extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len, Datum *attr, bool *isnull); extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b); @@ -556,11 +556,11 @@ extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep, int maxLevel); extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate, - BlockNumber blkno, int level); + BlockNumber nodeBlocknum, int level); extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb, - GISTNodeBuffer *nodeBuffer, IndexTuple item); + GISTNodeBuffer *nodeBuffer, IndexTuple itup); extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb, - GISTNodeBuffer *nodeBuffer, IndexTuple *item); + GISTNodeBuffer *nodeBuffer, IndexTuple *itup); extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb); extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate, Relation r, diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h index f740513303..21bde78ed0 100644 --- a/src/include/access/reloptions.h +++ b/src/include/access/reloptions.h @@ -195,16 +195,16 @@ extern void add_string_reloption(bits32 kinds, const char *name, const char *des const char *default_val, validate_string_relopt validator, LOCKMODE lockmode); -extern void init_local_reloptions(local_relopts *opts, Size relopt_struct_size); -extern void register_reloptions_validator(local_relopts *opts, +extern void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size); +extern void register_reloptions_validator(local_relopts *relopts, relopts_validator validator); -extern void add_local_bool_reloption(local_relopts *opts, const char *name, +extern void add_local_bool_reloption(local_relopts *relopts, const char *name, const char *desc, bool default_val, int offset); -extern void add_local_int_reloption(local_relopts *opts, const char *name, +extern void add_local_int_reloption(local_relopts *relopts, const char *name, const char *desc, int default_val, int min_val, int max_val, int offset); -extern void add_local_real_reloption(local_relopts *opts, const char *name, +extern void add_local_real_reloption(local_relopts *relopts, const char *name, const char *desc, double default_val, double min_val, double max_val, int offset); @@ -213,7 +213,7 @@ extern void add_local_enum_reloption(local_relopts *relopts, relopt_enum_elt_def *members, int default_val, const char *detailmsg, int offset); -extern void add_local_string_reloption(local_relopts *opts, const char *name, +extern void add_local_string_reloption(local_relopts *relopts, const char *name, const char *desc, const char *default_val, validate_string_relopt validator, diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h index f5a5fd826a..a37dafc666 100644 --- a/src/include/access/tupconvert.h +++ b/src/include/access/tupconvert.h @@ -44,7 +44,7 @@ extern HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map extern TupleTableSlot *execute_attr_map_slot(AttrMap *attrMap, TupleTableSlot *in_slot, TupleTableSlot *out_slot); -extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap); +extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols); extern void free_conversion_map(TupleConversionMap *map); diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h index 28dd6de18b..cf27356ba9 100644 --- a/src/include/access/tupdesc.h +++ b/src/include/access/tupdesc.h @@ -127,7 +127,7 @@ extern void DecrTupleDescRefCount(TupleDesc tupdesc); extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2); -extern uint32 hashTupleDesc(TupleDesc tupdesc); +extern uint32 hashTupleDesc(TupleDesc desc); extern void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h index 5d6544e267..f94fded100 100644 --- a/src/include/access/twophase.h +++ b/src/include/access/twophase.h @@ -60,6 +60,6 @@ extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn, XLogRecPtr end_lsn, RepOriginId origin_id); extern void PrepareRedoRemove(TransactionId xid, bool giveWarning); extern void restoreTwoPhaseData(void); -extern bool LookupGXact(const char *gid, XLogRecPtr prepare_at_lsn, +extern bool LookupGXact(const char *gid, XLogRecPtr prepare_end_lsn, TimestampTz origin_prepare_timestamp); #endif /* TWOPHASE_H */ diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 300baae120..c604ee11f8 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -490,8 +490,8 @@ extern int xactGetCommittedChildren(TransactionId **ptr); extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileLocator *rels, - int nstats, - xl_xact_stats_item *stats, + int ndroppedstats, + xl_xact_stats_item *droppedstats, int nmsgs, SharedInvalidationMessage *msgs, bool relcacheInval, int xactflags, @@ -501,8 +501,8 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time, extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileLocator *rels, - int nstats, - xl_xact_stats_item *stats, + int ndroppedstats, + xl_xact_stats_item *droppedstats, int xactflags, TransactionId twophase_xid, const char *twophase_gid); extern void xact_redo(XLogReaderState *record); diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index 9ebd321ba7..3dbfa6b593 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -197,15 +197,15 @@ extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata, uint8 flags, int num_fpi, bool topxid_included); -extern void XLogFlush(XLogRecPtr RecPtr); +extern void XLogFlush(XLogRecPtr record); extern bool XLogBackgroundFlush(void); -extern bool XLogNeedsFlush(XLogRecPtr RecPtr); -extern int XLogFileInit(XLogSegNo segno, TimeLineID tli); +extern bool XLogNeedsFlush(XLogRecPtr record); +extern int XLogFileInit(XLogSegNo logsegno, TimeLineID logtli); extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli); extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli); extern XLogSegNo XLogGetLastRemovedSegno(void); -extern void XLogSetAsyncXactLSN(XLogRecPtr record); +extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN); extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn); extern void xlog_redo(XLogReaderState *record); diff --git a/src/include/access/xloginsert.h b/src/include/access/xloginsert.h index aed4643d1c..001ff2f521 100644 --- a/src/include/access/xloginsert.h +++ b/src/include/access/xloginsert.h @@ -52,12 +52,12 @@ extern void XLogRegisterBufData(uint8 block_id, char *data, uint32 len); extern void XLogResetInsertion(void); extern bool XLogCheckBufferNeedsBackup(Buffer buffer); -extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, - BlockNumber blk, char *page, bool page_std); -extern void log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages, +extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forknum, + BlockNumber blkno, char *page, bool page_std); +extern void log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages, BlockNumber *blknos, char **pages, bool page_std); extern XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std); -extern void log_newpage_range(Relation rel, ForkNumber forkNum, +extern void log_newpage_range(Relation rel, ForkNumber forknum, BlockNumber startblk, BlockNumber endblk, bool page_std); extern XLogRecPtr XLogSaveBufferForHint(Buffer buffer, bool buffer_std); diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h index 6afec33d41..6dcde2523a 100644 --- a/src/include/access/xlogreader.h +++ b/src/include/access/xlogreader.h @@ -400,7 +400,7 @@ extern bool DecodeXLogRecord(XLogReaderState *state, DecodedXLogRecord *decoded, XLogRecord *record, XLogRecPtr lsn, - char **errmsg); + char **errormsg); /* * Macros that provide access to parts of the record most recently returned by diff --git a/src/include/access/xlogrecovery.h b/src/include/access/xlogrecovery.h index 0aa85d90e8..0e3e246bd2 100644 --- a/src/include/access/xlogrecovery.h +++ b/src/include/access/xlogrecovery.h @@ -80,7 +80,9 @@ extern PGDLLIMPORT bool StandbyMode; extern Size XLogRecoveryShmemSize(void); extern void XLogRecoveryShmemInit(void); -extern void InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdownPtr, bool *haveBackupLabel, bool *haveTblspcMap); +extern void InitWalRecovery(ControlFileData *ControlFile, + bool *wasShutdown_ptr, bool *haveBackupLabel_ptr, + bool *haveTblspcMap_ptr); extern void PerformWalRecovery(void); /* diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h index ef182977bf..18dc5f99a6 100644 --- a/src/include/access/xlogutils.h +++ b/src/include/access/xlogutils.h @@ -82,10 +82,10 @@ typedef struct ReadLocalXLogPageNoWaitPrivate } ReadLocalXLogPageNoWaitPrivate; extern XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record, - uint8 buffer_id, Buffer *buf); + uint8 block_id, Buffer *buf); extern Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id); extern XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record, - uint8 buffer_id, + uint8 block_id, ReadBufferMode mode, bool get_cleanup_lock, Buffer *buf); diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h index 729c4c46c0..98a1a84289 100644 --- a/src/include/catalog/dependency.h +++ b/src/include/catalog/dependency.h @@ -249,7 +249,7 @@ extern void recordDependencyOnTablespace(Oid classId, Oid objectId, extern void changeDependencyOnTablespace(Oid classId, Oid objectId, Oid newTablespaceId); -extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId, +extern void updateAclDependencies(Oid classId, Oid objectId, int32 objsubId, Oid ownerId, int noldmembers, Oid *oldmembers, int nnewmembers, Oid *newmembers); @@ -263,8 +263,8 @@ extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId); extern void dropDatabaseDependencies(Oid databaseId); -extern void shdepDropOwned(List *relids, DropBehavior behavior); +extern void shdepDropOwned(List *roleids, DropBehavior behavior); -extern void shdepReassignOwned(List *relids, Oid newrole); +extern void shdepReassignOwned(List *roleids, Oid newrole); #endif /* DEPENDENCY_H */ diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index 1bdb00a521..91c28868d4 100644 --- a/src/include/catalog/index.h +++ b/src/include/catalog/index.h @@ -149,7 +149,7 @@ extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action); extern Oid IndexGetRelation(Oid indexId, bool missing_ok); extern void reindex_index(Oid indexId, bool skip_constraint_checks, - char relpersistence, ReindexParams *params); + char persistence, ReindexParams *params); /* Flag bits for reindex_relation(): */ #define REINDEX_REL_PROCESS_TOAST 0x01 @@ -168,7 +168,7 @@ extern Size EstimateReindexStateSpace(void); extern void SerializeReindexState(Size maxsize, char *start_address); extern void RestoreReindexState(void *reindexstate); -extern void IndexSetParentIndex(Relation idx, Oid parentOid); +extern void IndexSetParentIndex(Relation partitionIdx, Oid parentOid); /* diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index 1bc55c01a5..2a2a2e6489 100644 --- a/src/include/catalog/namespace.h +++ b/src/include/catalog/namespace.h @@ -85,7 +85,7 @@ extern Oid RangeVarGetRelidExtended(const RangeVar *relation, RangeVarGetRelidCallback callback, void *callback_arg); extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation); -extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *newRelation, +extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation, LOCKMODE lockmode, Oid *existing_relation_id); extern void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid); diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h index 567ab63e85..d754f41202 100644 --- a/src/include/catalog/objectaccess.h +++ b/src/include/catalog/objectaccess.h @@ -151,15 +151,15 @@ extern bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation); extern void RunFunctionExecuteHook(Oid objectId); /* String versions */ -extern void RunObjectPostCreateHookStr(Oid classId, const char *objectStr, int subId, +extern void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId, bool is_internal); -extern void RunObjectDropHookStr(Oid classId, const char *objectStr, int subId, +extern void RunObjectDropHookStr(Oid classId, const char *objectName, int subId, int dropflags); -extern void RunObjectTruncateHookStr(const char *objectStr); -extern void RunObjectPostAlterHookStr(Oid classId, const char *objectStr, int subId, +extern void RunObjectTruncateHookStr(const char *objectName); +extern void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId, Oid auxiliaryId, bool is_internal); -extern bool RunNamespaceSearchHookStr(const char *objectStr, bool ereport_on_violation); -extern void RunFunctionExecuteHookStr(const char *objectStr); +extern bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation); +extern void RunFunctionExecuteHookStr(const char *objectName); /* diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h index cf4d8b3107..340ffc95a0 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -77,9 +77,9 @@ extern char *getObjectDescriptionOids(Oid classid, Oid objid); extern int read_objtype_from_string(const char *objtype); extern char *getObjectTypeDescription(const ObjectAddress *object, bool missing_ok); -extern char *getObjectIdentity(const ObjectAddress *address, +extern char *getObjectIdentity(const ObjectAddress *object, bool missing_ok); -extern char *getObjectIdentityParts(const ObjectAddress *address, +extern char *getObjectIdentityParts(const ObjectAddress *object, List **objname, List **objargs, bool missing_ok); extern struct ArrayType *strlist_to_textarray(List *list); diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h index fb26123aa9..e59ed94ed3 100644 --- a/src/include/catalog/pg_conversion.h +++ b/src/include/catalog/pg_conversion.h @@ -69,7 +69,7 @@ extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace, Oid conowner, int32 conforencoding, int32 contoencoding, Oid conproc, bool def); -extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, +extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding, int32 to_encoding); #endif /* PG_CONVERSION_H */ diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h index b5a32755a6..9221c2ea57 100644 --- a/src/include/catalog/pg_inherits.h +++ b/src/include/catalog/pg_inherits.h @@ -53,13 +53,14 @@ extern List *find_inheritance_children_extended(Oid parentrelId, bool omit_detac LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin); extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, - List **parents); + List **numparents); extern bool has_subclass(Oid relationId); extern bool has_superclass(Oid relationId); extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); extern void StoreSingleInheritance(Oid relationId, Oid parentOid, int32 seqNumber); -extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached, +extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, + bool expect_detach_pending, const char *childname); extern bool PartitionHasPendingDetach(Oid partoid); diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h index c298327f5e..ecf5a28e00 100644 --- a/src/include/catalog/pg_publication.h +++ b/src/include/catalog/pg_publication.h @@ -137,7 +137,7 @@ extern List *GetPublicationSchemas(Oid pubid); extern List *GetSchemaPublications(Oid schemaid); extern List *GetSchemaPublicationRelations(Oid schemaid, PublicationPartOpt pub_partopt); -extern List *GetAllSchemaPublicationRelations(Oid puboid, +extern List *GetAllSchemaPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt); extern List *GetPubPartitionOptionRelations(List *result, PublicationPartOpt pub_partopt, diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index cb0096aeb6..3f6677b132 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -67,11 +67,11 @@ typedef struct CopyToStateData *CopyToState; typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread); -extern void DoCopy(ParseState *state, const CopyStmt *stmt, +extern void DoCopy(ParseState *pstate, const CopyStmt *stmt, int stmt_location, int stmt_len, uint64 *processed); -extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *ops_out, bool is_from, List *options); +extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options); extern CopyFromState BeginCopyFrom(ParseState *pstate, Relation rel, Node *whereClause, const char *filename, bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options); @@ -89,7 +89,7 @@ extern DestReceiver *CreateCopyDestReceiver(void); /* * internal prototypes */ -extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *query, +extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *raw_query, Oid queryRelId, const char *filename, bool is_program, List *attnamelist, List *options); extern void EndCopyTo(CopyToState cstate); diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h index 0ee2452feb..545e5430cc 100644 --- a/src/include/commands/dbcommands_xlog.h +++ b/src/include/commands/dbcommands_xlog.h @@ -53,8 +53,8 @@ typedef struct xl_dbase_drop_rec } xl_dbase_drop_rec; #define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids) -extern void dbase_redo(XLogReaderState *rptr); -extern void dbase_desc(StringInfo buf, XLogReaderState *rptr); +extern void dbase_redo(XLogReaderState *record); +extern void dbase_desc(StringInfo buf, XLogReaderState *record); extern const char *dbase_identify(uint8 info); #endif /* DBCOMMANDS_XLOG_H */ diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h index 3a1b11326f..955d0bd64d 100644 --- a/src/include/executor/execParallel.h +++ b/src/include/executor/execParallel.h @@ -38,13 +38,13 @@ typedef struct ParallelExecutorInfo } ParallelExecutorInfo; extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate, - EState *estate, Bitmapset *sendParam, int nworkers, + EState *estate, Bitmapset *sendParams, int nworkers, int64 tuples_needed); extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei); extern void ExecParallelFinish(ParallelExecutorInfo *pei); extern void ExecParallelCleanup(ParallelExecutorInfo *pei); extern void ExecParallelReinitialize(PlanState *planstate, - ParallelExecutorInfo *pei, Bitmapset *sendParam); + ParallelExecutorInfo *pei, Bitmapset *sendParams); extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc); diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index a91c472a0d..ed95ed1176 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -218,7 +218,7 @@ extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo); extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok); extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist); extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation, - Index rti, TupleTableSlot *testslot); + Index rti, TupleTableSlot *inputslot); extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam); extern void EvalPlanQualSetPlan(EPQState *epqstate, @@ -432,7 +432,7 @@ ExecQualAndReset(ExprState *state, ExprContext *econtext) } #endif -extern bool ExecCheck(ExprState *state, ExprContext *context); +extern bool ExecCheck(ExprState *state, ExprContext *econtext); /* * prototypes from functions in execSRF.c @@ -473,7 +473,7 @@ extern void ExecInitResultSlot(PlanState *planstate, extern void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops); extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, - TupleDesc tupleDesc, + TupleDesc tupledesc, const TupleTableSlotOps *tts_ops); extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, diff --git a/src/include/executor/nodeIncrementalSort.h b/src/include/executor/nodeIncrementalSort.h index 84cfd96b13..519d955951 100644 --- a/src/include/executor/nodeIncrementalSort.h +++ b/src/include/executor/nodeIncrementalSort.h @@ -22,7 +22,7 @@ extern void ExecReScanIncrementalSort(IncrementalSortState *node); /* parallel instrumentation support */ extern void ExecIncrementalSortEstimate(IncrementalSortState *node, ParallelContext *pcxt); extern void ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pcxt); -extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt); +extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt); extern void ExecIncrementalSortRetrieveInstrumentation(IncrementalSortState *node); #endif /* NODEINCREMENTALSORT_H */ diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index b2c0c7486c..697abe5fc9 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -174,7 +174,7 @@ extern void *SPI_palloc(Size size); extern void *SPI_repalloc(void *pointer, Size size); extern void SPI_pfree(void *pointer); extern Datum SPI_datumTransfer(Datum value, bool typByVal, int typLen); -extern void SPI_freetuple(HeapTuple pointer); +extern void SPI_freetuple(HeapTuple tuple); extern void SPI_freetuptable(SPITupleTable *tuptable); extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan, diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h index 1e8c3af360..4f2643742e 100644 --- a/src/include/mb/pg_wchar.h +++ b/src/include/mb/pg_wchar.h @@ -606,11 +606,11 @@ extern int pg_encoding_wchar2mb_with_len(int encoding, extern int pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2); extern int pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n); extern int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n); -extern size_t pg_wchar_strlen(const pg_wchar *wstr); +extern size_t pg_wchar_strlen(const pg_wchar *str); extern int pg_mblen(const char *mbstr); extern int pg_dsplen(const char *mbstr); extern int pg_mbstrlen(const char *mbstr); -extern int pg_mbstrlen_with_len(const char *mbstr, int len); +extern int pg_mbstrlen_with_len(const char *mbstr, int limit); extern int pg_mbcliplen(const char *mbstr, int len, int limit); extern int pg_encoding_mbcliplen(int encoding, const char *mbstr, int len, int limit); @@ -641,7 +641,7 @@ extern int pg_do_encoding_conversion_buf(Oid proc, int src_encoding, int dest_encoding, unsigned char *src, int srclen, - unsigned char *dst, int dstlen, + unsigned char *dest, int destlen, bool noError); extern char *pg_client_to_server(const char *s, int len); diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 65cf4ba50f..ee48e392ed 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -352,7 +352,7 @@ extern bool InSecurityRestrictedOperation(void); extern bool InNoForceRLSOperation(void); extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context); extern void SetUserIdAndContext(Oid userid, bool sec_def_context); -extern void InitializeSessionUserId(const char *rolename, Oid useroid); +extern void InitializeSessionUserId(const char *rolename, Oid roleid); extern void InitializeSessionUserIdStandalone(void); extern void SetSessionAuthorization(Oid userid, bool is_superuser); extern Oid GetCurrentRoleId(void); diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h index edadacd589..4ad019e25a 100644 --- a/src/include/replication/logical.h +++ b/src/include/replication/logical.h @@ -133,7 +133,8 @@ extern void DecodingContextFindStartpoint(LogicalDecodingContext *ctx); extern bool DecodingContextReady(LogicalDecodingContext *ctx); extern void FreeDecodingContext(LogicalDecodingContext *ctx); -extern void LogicalIncreaseXminForSlot(XLogRecPtr lsn, TransactionId xmin); +extern void LogicalIncreaseXminForSlot(XLogRecPtr current_lsn, + TransactionId xmin); extern void LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart_lsn); extern void LogicalConfirmReceivedLocation(XLogRecPtr lsn); diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h index a771ab8ff3..7eaa4c97ed 100644 --- a/src/include/replication/logicalproto.h +++ b/src/include/replication/logicalproto.h @@ -219,7 +219,7 @@ extern LogicalRepRelId logicalrep_read_update(StringInfo in, bool *has_oldtuple, LogicalRepTupleData *oldtup, LogicalRepTupleData *newtup); extern void logicalrep_write_delete(StringInfo out, TransactionId xid, - Relation rel, TupleTableSlot *oldtuple, + Relation rel, TupleTableSlot *oldslot, bool binary); extern LogicalRepRelId logicalrep_read_delete(StringInfo in, LogicalRepTupleData *oldtup); @@ -235,7 +235,7 @@ extern void logicalrep_write_rel(StringInfo out, TransactionId xid, extern LogicalRepRelation *logicalrep_read_rel(StringInfo in); extern void logicalrep_write_typ(StringInfo out, TransactionId xid, Oid typoid); -extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp); +extern void logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp); extern void logicalrep_write_stream_start(StringInfo out, TransactionId xid, bool first_segment); extern TransactionId logicalrep_read_stream_start(StringInfo in, @@ -243,7 +243,7 @@ extern TransactionId logicalrep_read_stream_start(StringInfo in, extern void logicalrep_write_stream_stop(StringInfo out); extern void logicalrep_write_stream_commit(StringInfo out, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); -extern TransactionId logicalrep_read_stream_commit(StringInfo out, +extern TransactionId logicalrep_read_stream_commit(StringInfo in, LogicalRepCommitData *commit_data); extern void logicalrep_write_stream_abort(StringInfo out, TransactionId xid, TransactionId subxid); diff --git a/src/include/replication/origin.h b/src/include/replication/origin.h index 2d1b5e5c28..2a50d10b52 100644 --- a/src/include/replication/origin.h +++ b/src/include/replication/origin.h @@ -38,8 +38,8 @@ extern PGDLLIMPORT XLogRecPtr replorigin_session_origin_lsn; extern PGDLLIMPORT TimestampTz replorigin_session_origin_timestamp; /* API for querying & manipulating replication origins */ -extern RepOriginId replorigin_by_name(const char *name, bool missing_ok); -extern RepOriginId replorigin_create(const char *name); +extern RepOriginId replorigin_by_name(const char *roname, bool missing_ok); +extern RepOriginId replorigin_create(const char *roname); extern void replorigin_drop_by_name(const char *name, bool missing_ok, bool nowait); extern bool replorigin_by_oid(RepOriginId roident, bool missing_ok, char **roname); diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h index 8c9f3321d5..81e31f002a 100644 --- a/src/include/replication/slot.h +++ b/src/include/replication/slot.h @@ -195,7 +195,8 @@ extern void ReplicationSlotsShmemInit(void); /* management of individual slots */ extern void ReplicationSlotCreate(const char *name, bool db_specific, - ReplicationSlotPersistency p, bool two_phase); + ReplicationSlotPersistency persistency, + bool two_phase); extern void ReplicationSlotPersist(void); extern void ReplicationSlotDrop(const char *name, bool nowait); diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h index d99a21b077..8336a6e719 100644 --- a/src/include/replication/walsender.h +++ b/src/include/replication/walsender.h @@ -36,7 +36,7 @@ extern PGDLLIMPORT int wal_sender_timeout; extern PGDLLIMPORT bool log_replication_commands; extern void InitWalSender(void); -extern bool exec_replication_command(const char *query_string); +extern bool exec_replication_command(const char *cmd_string); extern void WalSndErrorCleanup(void); extern void WalSndResourceCleanup(bool isCommit); extern void WalSndSignals(void); diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h index 57d2c52e79..4b16ab812d 100644 --- a/src/include/storage/barrier.h +++ b/src/include/storage/barrier.h @@ -34,7 +34,7 @@ typedef struct Barrier ConditionVariable condition_variable; } Barrier; -extern void BarrierInit(Barrier *barrier, int num_workers); +extern void BarrierInit(Barrier *barrier, int participants); extern bool BarrierArriveAndWait(Barrier *barrier, uint32 wait_event_info); extern bool BarrierArriveAndDetach(Barrier *barrier); extern bool BarrierArriveAndDetachExceptLast(Barrier *barrier); diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 6a947021ac..2708c4b683 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -499,9 +499,9 @@ extern Size PageGetFreeSpace(Page page); extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups); extern Size PageGetExactFreeSpace(Page page); extern Size PageGetHeapFreeSpace(Page page); -extern void PageIndexTupleDelete(Page page, OffsetNumber offset); +extern void PageIndexTupleDelete(Page page, OffsetNumber offnum); extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems); -extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset); +extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum); extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum, Item newtup, Size newsize); extern char *PageSetChecksumCopy(Page page, BlockNumber blkno); diff --git a/src/include/storage/dsm.h b/src/include/storage/dsm.h index 4dd6af23a8..edb32fe996 100644 --- a/src/include/storage/dsm.h +++ b/src/include/storage/dsm.h @@ -45,8 +45,8 @@ extern void dsm_detach(dsm_segment *seg); extern void dsm_pin_mapping(dsm_segment *seg); extern void dsm_unpin_mapping(dsm_segment *seg); extern void dsm_pin_segment(dsm_segment *seg); -extern void dsm_unpin_segment(dsm_handle h); -extern dsm_segment *dsm_find_mapping(dsm_handle h); +extern void dsm_unpin_segment(dsm_handle handle); +extern dsm_segment *dsm_find_mapping(dsm_handle handle); /* Informational functions. */ extern void *dsm_segment_address(dsm_segment *seg); diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h index 2b4a8e0ffe..5a48fccd9c 100644 --- a/src/include/storage/fd.h +++ b/src/include/storage/fd.h @@ -117,11 +117,11 @@ extern int FileGetRawFlags(File file); extern mode_t FileGetRawMode(File file); /* Operations used for sharing named temporary files */ -extern File PathNameCreateTemporaryFile(const char *name, bool error_on_failure); +extern File PathNameCreateTemporaryFile(const char *path, bool error_on_failure); extern File PathNameOpenTemporaryFile(const char *path, int mode); -extern bool PathNameDeleteTemporaryFile(const char *name, bool error_on_failure); -extern void PathNameCreateTemporaryDir(const char *base, const char *name); -extern void PathNameDeleteTemporaryDir(const char *name); +extern bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure); +extern void PathNameCreateTemporaryDir(const char *basedir, const char *directory); +extern void PathNameDeleteTemporaryDir(const char *dirname); extern void TempTablespacePath(char *path, Oid tablespace); /* Operations that allow use of regular stdio --- USE WITH CAUTION */ @@ -177,7 +177,7 @@ extern int pg_fsync(int fd); extern int pg_fsync_no_writethrough(int fd); extern int pg_fsync_writethrough(int fd); extern int pg_fdatasync(int fd); -extern void pg_flush_data(int fd, off_t offset, off_t amount); +extern void pg_flush_data(int fd, off_t offset, off_t nbytes); extern ssize_t pg_pwritev_with_retry(int fd, const struct iovec *iov, int iovcnt, @@ -185,8 +185,8 @@ extern ssize_t pg_pwritev_with_retry(int fd, extern int pg_truncate(const char *path, off_t length); extern void fsync_fname(const char *fname, bool isdir); extern int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel); -extern int durable_rename(const char *oldfile, const char *newfile, int loglevel); -extern int durable_unlink(const char *fname, int loglevel); +extern int durable_rename(const char *oldfile, const char *newfile, int elevel); +extern int durable_unlink(const char *fname, int elevel); extern void SyncDataDirectory(void); extern int data_sync_elevel(int elevel); diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h index a6f837217d..819160c789 100644 --- a/src/include/storage/fsm_internals.h +++ b/src/include/storage/fsm_internals.h @@ -61,7 +61,7 @@ typedef FSMPageData *FSMPage; #define SlotsPerFSMPage LeafNodesPerPage /* Prototypes for functions in fsmpage.c */ -extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext, +extern int fsm_search_avail(Buffer buf, uint8 minvalue, bool advancenext, bool exclusive_lock_held); extern uint8 fsm_get_avail(Page page, int slot); extern uint8 fsm_get_max_avail(Page page); diff --git a/src/include/storage/indexfsm.h b/src/include/storage/indexfsm.h index 04c1a051b2..129590863f 100644 --- a/src/include/storage/indexfsm.h +++ b/src/include/storage/indexfsm.h @@ -18,8 +18,8 @@ #include "utils/relcache.h" extern BlockNumber GetFreeIndexPage(Relation rel); -extern void RecordFreeIndexPage(Relation rel, BlockNumber page); -extern void RecordUsedIndexPage(Relation rel, BlockNumber page); +extern void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock); +extern void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock); extern void IndexFreeSpaceMapVacuum(Relation rel); diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index e03d317eea..ca4eca76f4 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -124,7 +124,7 @@ extern bool LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride); extern bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode); extern bool LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval); -extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 value); +extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 val); extern Size LWLockShmemSize(void); extern void CreateLWLocks(void); diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h index 8dfcb3944b..dbef2ffb01 100644 --- a/src/include/storage/predicate.h +++ b/src/include/storage/predicate.h @@ -58,7 +58,7 @@ extern void RegisterPredicateLockingXid(TransactionId xid); extern void PredicateLockRelation(Relation relation, Snapshot snapshot); extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot); extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot, - TransactionId insert_xid); + TransactionId tuple_xid); extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void TransferPredicateLocksToHeapRelation(Relation relation); diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index 1b2cfac5ad..9761f5374c 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -57,7 +57,7 @@ extern TransactionId GetOldestNonRemovableTransactionId(Relation rel); extern TransactionId GetOldestTransactionIdConsideredRunning(void); extern TransactionId GetOldestActiveTransactionId(void); extern TransactionId GetOldestSafeDecodingTransactionId(bool catalogOnly); -extern void GetReplicationHorizons(TransactionId *slot_xmin, TransactionId *catalog_xmin); +extern void GetReplicationHorizons(TransactionId *xmin, TransactionId *catalog_xmin); extern VirtualTransactionId *GetVirtualXIDsDelayingChkpt(int *nvxids, int type); extern bool HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids, diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h index dacef92f44..f5da98dc73 100644 --- a/src/include/storage/standby.h +++ b/src/include/storage/standby.h @@ -43,7 +43,7 @@ extern void StandbyDeadLockHandler(void); extern void StandbyTimeoutHandler(void); extern void StandbyLockTimeoutHandler(void); extern void LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start, - TimestampTz cur_ts, VirtualTransactionId *wait_list, + TimestampTz now, VirtualTransactionId *wait_list, bool still_waiting); /*