From e93c583772b0c9ef25397703e2ae79f147f4b4c8 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 16:48:24 -0700
Subject: [PATCH v1 1/2] Harmonize parameter names

---
 src/include/access/genam.h                    |  9 ++-
 src/include/access/generic_xlog.h             |  2 +-
 src/include/access/gin_private.h              |  8 +-
 src/include/access/gist_private.h             | 18 ++---
 src/include/access/heapam.h                   | 26 +++----
 src/include/access/heapam_xlog.h              |  4 +-
 src/include/access/htup_details.h             |  2 +-
 src/include/access/multixact.h                |  7 +-
 src/include/access/rewriteheap.h              | 12 +--
 src/include/access/tableam.h                  |  8 +-
 src/include/access/tupconvert.h               |  2 +-
 src/include/access/twophase.h                 |  2 +-
 src/include/access/xact.h                     |  8 +-
 src/include/access/xlog.h                     |  8 +-
 src/include/access/xlogreader.h               |  2 +-
 src/include/access/xlogrecovery.h             |  4 +-
 src/include/access/xlogutils.h                |  4 +-
 src/include/catalog/dependency.h              |  6 +-
 src/include/catalog/objectaccess.h            | 12 +--
 src/include/catalog/objectaddress.h           |  4 +-
 src/include/catalog/pg_conversion.h           |  2 +-
 src/include/catalog/pg_inherits.h             |  5 +-
 src/include/catalog/pg_publication.h          |  2 +-
 src/include/commands/alter.h                  |  2 +-
 src/include/commands/cluster.h                |  2 +-
 src/include/commands/conversioncmds.h         |  2 +-
 src/include/commands/copy.h                   |  4 +-
 src/include/commands/dbcommands_xlog.h        |  4 +-
 src/include/commands/policy.h                 |  2 +-
 src/include/commands/publicationcmds.h        |  2 +-
 src/include/commands/schemacmds.h             |  2 +-
 src/include/commands/sequence.h               |  8 +-
 src/include/commands/tablecmds.h              |  2 +-
 src/include/commands/tablespace.h             |  4 +-
 src/include/commands/trigger.h                |  8 +-
 src/include/commands/typecmds.h               |  2 +-
 src/include/common/fe_memutils.h              |  4 +-
 src/include/common/kwlookup.h                 |  2 +-
 src/include/common/scram-common.h             |  2 +-
 src/include/executor/execParallel.h           |  4 +-
 src/include/executor/executor.h               |  2 +-
 src/include/executor/spi.h                    |  2 +-
 src/include/fe_utils/parallel_slot.h          |  2 +-
 src/include/fe_utils/simple_list.h            |  2 +-
 src/include/fe_utils/string_utils.h           |  2 +-
 src/include/funcapi.h                         |  2 +-
 src/include/libpq/hba.h                       |  2 +-
 src/include/libpq/pqmq.h                      |  2 +-
 src/include/mb/pg_wchar.h                     |  4 +-
 src/include/miscadmin.h                       |  2 +-
 src/include/nodes/nodes.h                     |  2 +-
 src/include/nodes/params.h                    |  4 +-
 src/include/nodes/value.h                     |  2 +-
 src/include/optimizer/appendinfo.h            |  2 +-
 src/include/optimizer/clauses.h               |  4 +-
 src/include/optimizer/paths.h                 |  4 +-
 src/include/optimizer/planmain.h              |  2 +-
 src/include/parser/analyze.h                  |  2 +-
 src/include/parser/parse_agg.h                |  2 +-
 src/include/parser/parse_oper.h               |  4 +-
 src/include/parser/parse_relation.h           |  2 +-
 src/include/partitioning/partbounds.h         |  4 +-
 src/include/pgstat.h                          | 10 +--
 src/include/port.h                            |  6 +-
 src/include/replication/logicalproto.h        |  6 +-
 src/include/replication/reorderbuffer.h       | 12 +--
 src/include/replication/slot.h                |  2 +-
 src/include/replication/snapbuild.h           | 13 ++--
 src/include/replication/walsender.h           |  2 +-
 src/include/rewrite/rewriteManip.h            |  2 +-
 src/include/snowball/libstemmer/header.h      |  2 +-
 src/include/statistics/statistics.h           |  4 +-
 src/include/storage/barrier.h                 |  2 +-
 src/include/storage/bufpage.h                 |  4 +-
 src/include/storage/fd.h                      | 14 ++--
 src/include/storage/fsm_internals.h           |  2 +-
 src/include/storage/indexfsm.h                |  4 +-
 src/include/storage/predicate.h               |  2 +-
 src/include/storage/standby.h                 |  2 +-
 src/include/tcop/cmdtag.h                     |  2 +-
 src/include/tsearch/ts_utils.h                |  4 +-
 src/include/utils/acl.h                       |  6 +-
 src/include/utils/attoptcache.h               |  2 +-
 src/include/utils/builtins.h                  |  8 +-
 src/include/utils/datetime.h                  |  2 +-
 src/include/utils/jsonb.h                     |  4 +-
 src/include/utils/multirangetypes.h           |  6 +-
 src/include/utils/numeric.h                   |  2 +-
 src/include/utils/pgstat_internal.h           |  4 +-
 src/include/utils/rangetypes.h                |  4 +-
 src/include/utils/regproc.h                   |  2 +-
 src/include/utils/relcache.h                  |  2 +-
 src/include/utils/relmapper.h                 |  2 +-
 src/include/utils/selfuncs.h                  |  4 +-
 src/include/utils/snapmgr.h                   |  2 +-
 src/include/utils/timestamp.h                 |  4 +-
 src/backend/access/brin/brin_minmax_multi.c   |  3 +-
 src/backend/access/common/heaptuple.c         | 14 ++--
 src/backend/access/gist/gistbuildbuffers.c    |  4 +-
 src/backend/access/heap/heapam.c              |  2 +-
 src/backend/access/heap/visibilitymap.c       | 50 ++++++------
 src/backend/access/table/tableam.c            | 11 ++-
 src/backend/access/transam/generic_xlog.c     |  2 +-
 src/backend/access/transam/multixact.c        |  6 +-
 src/backend/access/transam/xact.c             |  2 +-
 src/backend/access/transam/xlog.c             |  2 +-
 src/backend/access/transam/xlogreader.c       |  2 +-
 src/backend/catalog/aclchk.c                  | 22 +++---
 src/backend/commands/dbcommands.c             |  8 +-
 src/backend/commands/event_trigger.c          |  2 +-
 src/backend/commands/explain.c                |  2 +-
 src/backend/commands/lockcmds.c               |  2 +-
 src/backend/commands/schemacmds.c             |  6 +-
 src/backend/commands/tablecmds.c              |  6 +-
 src/backend/commands/trigger.c                |  8 +-
 src/backend/executor/execIndexing.c           |  2 +-
 src/backend/executor/execParallel.c           |  4 +-
 src/backend/executor/nodeAgg.c                | 11 ++-
 src/backend/executor/nodeHash.c               |  6 +-
 src/backend/executor/nodeHashjoin.c           |  6 +-
 src/backend/executor/nodeIncrementalSort.c    |  4 +-
 src/backend/executor/nodeMemoize.c            |  4 +-
 src/backend/lib/bloomfilter.c                 |  2 +-
 src/backend/lib/integerset.c                  |  4 +-
 src/backend/optimizer/geqo/geqo_selection.c   |  2 +-
 src/backend/optimizer/util/plancat.c          |  3 +-
 src/backend/parser/gram.y                     |  3 +-
 src/backend/parser/parse_clause.c             |  2 +-
 src/backend/parser/parse_utilcmd.c            |  2 +-
 src/backend/partitioning/partbounds.c         |  6 +-
 src/backend/postmaster/postmaster.c           |  6 +-
 .../replication/logical/reorderbuffer.c       |  2 +-
 src/backend/replication/pgoutput/pgoutput.c   |  4 +-
 src/backend/replication/slot.c                |  2 +-
 src/backend/statistics/extended_stats.c       |  4 +-
 src/backend/storage/buffer/bufmgr.c           |  4 +-
 src/backend/storage/lmgr/predicate.c          |  2 +-
 src/backend/storage/smgr/md.c                 | 42 +++++-----
 src/backend/utils/adt/datetime.c              | 22 +++---
 src/backend/utils/adt/geo_ops.c               |  8 +-
 src/backend/utils/adt/jsonb_util.c            | 77 ++++++++++---------
 src/backend/utils/adt/jsonpath_exec.c         |  4 +-
 src/backend/utils/adt/numeric.c               |  6 +-
 src/backend/utils/adt/rangetypes.c            |  4 +-
 src/backend/utils/adt/ri_triggers.c           |  2 +-
 src/backend/utils/adt/timestamp.c             |  4 +-
 src/backend/utils/cache/relmapper.c           |  2 +-
 .../euc_jp_and_sjis/euc_jp_and_sjis.c         |  4 +-
 .../euc_tw_and_big5/euc_tw_and_big5.c         |  2 +-
 src/backend/utils/misc/queryjumble.c          |  3 +-
 src/backend/utils/time/snapmgr.c              | 29 +++----
 src/bin/initdb/initdb.c                       |  2 +-
 src/bin/pg_basebackup/pg_receivewal.c         |  2 +-
 src/bin/pg_basebackup/streamutil.h            |  2 +-
 src/bin/pg_rewind/file_ops.h                  |  4 +-
 src/bin/pg_rewind/pg_rewind.h                 |  2 +-
 src/bin/pg_upgrade/info.c                     |  2 +-
 src/bin/pg_verifybackup/pg_verifybackup.c     |  2 +-
 src/bin/pgbench/pgbench.h                     |  8 +-
 src/bin/psql/describe.h                       |  6 +-
 src/bin/scripts/common.h                      |  2 +-
 src/interfaces/libpq/fe-connect.c             |  2 +-
 src/interfaces/libpq/fe-exec.c                | 14 ++--
 src/interfaces/libpq/fe-secure-common.h       |  4 +-
 src/interfaces/libpq/libpq-fe.h               |  4 +-
 src/pl/plpgsql/src/pl_exec.c                  |  2 +-
 src/interfaces/ecpg/preproc/c_keywords.c      |  8 +-
 src/interfaces/ecpg/preproc/output.c          |  2 +-
 src/interfaces/ecpg/preproc/preproc_extern.h  |  4 +-
 src/timezone/zic.c                            | 12 +--
 170 files changed, 480 insertions(+), 470 deletions(-)

diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 134b20f1e..e1c4fdbd0 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 c8363a476..da4565642 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 2935d2f35..39b51573d 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -240,7 +240,7 @@ 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 */
 
@@ -469,10 +469,10 @@ 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);
 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 240131ef7..093bf2344 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/heapam.h b/src/include/access/heapam.h
index abf62d9df..9dab35551 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -118,13 +118,13 @@ extern TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot,
 									int nkeys, ScanKey key,
 									ParallelTableScanDesc parallel_scan,
 									uint32 flags);
-extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
+extern void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk,
 							   BlockNumber numBlks);
-extern void heapgetpage(TableScanDesc scan, BlockNumber page);
-extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
+extern void heapgetpage(TableScanDesc sscan, BlockNumber page);
+extern void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params,
 						bool allow_strat, bool allow_sync, bool allow_pagemode);
-extern void heap_endscan(TableScanDesc scan);
-extern HeapTuple heap_getnext(TableScanDesc scan, ScanDirection direction);
+extern void heap_endscan(TableScanDesc sscan);
+extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
 extern bool heap_getnextslot(TableScanDesc sscan,
 							 ScanDirection direction, struct TupleTableSlot *slot);
 extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
@@ -138,7 +138,7 @@ extern bool heap_hot_search_buffer(ItemPointer tid, Relation relation,
 								   Buffer buffer, Snapshot snapshot, HeapTuple heapTuple,
 								   bool *all_dead, bool first_call);
 
-extern void heap_get_latest_tid(TableScanDesc scan, ItemPointer tid);
+extern void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid);
 
 extern BulkInsertState GetBulkInsertState(void);
 extern void FreeBulkInsertState(BulkInsertState);
@@ -160,7 +160,7 @@ extern TM_Result heap_update(Relation relation, ItemPointer otid,
 							 struct TM_FailureData *tmfd, LockTupleMode *lockmode);
 extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
 								 CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
-								 bool follow_update,
+								 bool follow_updates,
 								 Buffer *buffer, struct TM_FailureData *tmfd);
 
 extern void heap_inplace_update(Relation relation, HeapTuple tuple);
@@ -187,7 +187,7 @@ extern void heap_page_prune_opt(Relation relation, Buffer buffer);
 extern int	heap_page_prune(Relation relation, Buffer buffer,
 							struct GlobalVisState *vistest,
 							TransactionId old_snap_xmin,
-							TimestampTz old_snap_ts_ts,
+							TimestampTz old_snap_ts,
 							int *nnewlpdead,
 							OffsetNumber *off_loc);
 extern void heap_page_prune_execute(Buffer buffer,
@@ -202,13 +202,13 @@ extern void heap_vacuum_rel(Relation rel,
 							struct VacuumParams *params, BufferAccessStrategy bstrategy);
 
 /* in heap/heapam_visibility.c */
-extern bool HeapTupleSatisfiesVisibility(HeapTuple stup, Snapshot snapshot,
+extern bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot,
 										 Buffer buffer);
-extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple stup, CommandId curcid,
+extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
 										  Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple stup, TransactionId OldestXmin,
+extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
 											Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple stup, Buffer buffer,
+extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple htup, Buffer buffer,
 												   TransactionId *dead_after);
 extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
 								 uint16 infomask, TransactionId xid);
@@ -227,7 +227,7 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
 										  HeapTuple htup,
 										  Buffer buffer,
 										  CommandId *cmin, CommandId *cmax);
-extern void HeapCheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
+extern void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple,
 												Buffer buffer, Snapshot snapshot);
 
 #endif							/* HEAPAM_H */
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 1705e736b..34220d93c 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -414,8 +414,8 @@ extern bool heap_prepare_freeze_tuple(HeapTupleHeader tuple,
 									  TransactionId *relfrozenxid_out,
 									  MultiXactId *relminmxid_out);
 extern void heap_execute_freeze_tuple(HeapTupleHeader tuple,
-									  xl_heap_freeze_tuple *xlrec_tp);
+									  xl_heap_freeze_tuple *frz);
 extern XLogRecPtr log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer,
-								   Buffer vm_buffer, TransactionId cutoff_xid, uint8 flags);
+								   Buffer vm_buffer, TransactionId cutoff_xid, uint8 vmflags);
 
 #endif							/* HEAPAM_XLOG_H */
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index 51a60eda0..9561c835f 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -699,7 +699,7 @@ extern void heap_fill_tuple(TupleDesc tupleDesc,
 							uint16 *infomask, bits8 *bit);
 extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
 extern Datum nocachegetattr(HeapTuple tup, int attnum,
-							TupleDesc att);
+							TupleDesc tupleDesc);
 extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
 							 bool *isnull);
 extern Datum getmissingattr(TupleDesc tupleDesc,
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index a5600a320..4cbe17de7 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -112,8 +112,8 @@ extern MultiXactId ReadNextMultiXactId(void);
 extern void ReadMultiXactIdRange(MultiXactId *oldest, MultiXactId *next);
 extern bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly);
 extern void MultiXactIdSetOldestMember(void);
-extern int	GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **xids,
-								  bool allow_old, bool isLockOnly);
+extern int	GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
+								  bool from_pgupgrade, bool isLockOnly);
 extern bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2);
 extern bool MultiXactIdPrecedesOrEquals(MultiXactId multi1,
 										MultiXactId multi2);
@@ -140,7 +140,8 @@ extern void MultiXactGetCheckptMulti(bool is_shutdown,
 									 Oid *oldestMultiDB);
 extern void CheckPointMultiXact(void);
 extern MultiXactId GetOldestMultiXactId(void);
-extern void TruncateMultiXact(MultiXactId oldestMulti, Oid oldestMultiDB);
+extern void TruncateMultiXact(MultiXactId newOldestMulti,
+							  Oid newOldestMultiDB);
 extern void MultiXactSetNextMXact(MultiXactId nextMulti,
 								  MultiXactOffset nextMultiOffset);
 extern void MultiXactAdvanceNextMXact(MultiXactId minMulti,
diff --git a/src/include/access/rewriteheap.h b/src/include/access/rewriteheap.h
index 353cbb292..5cc04756a 100644
--- a/src/include/access/rewriteheap.h
+++ b/src/include/access/rewriteheap.h
@@ -21,13 +21,13 @@
 /* struct definition is private to rewriteheap.c */
 typedef struct RewriteStateData *RewriteState;
 
-extern RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap,
-									   TransactionId OldestXmin, TransactionId FreezeXid,
-									   MultiXactId MultiXactCutoff);
+extern RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap,
+									   TransactionId oldest_xmin, TransactionId freeze_xid,
+									   MultiXactId cutoff_multi);
 extern void end_heap_rewrite(RewriteState state);
-extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple,
-							   HeapTuple newTuple);
-extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple);
+extern void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple,
+							   HeapTuple new_tuple);
+extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple);
 
 /*
  * On-Disk data format for an individual logical rewrite mapping.
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index ffe265d2a..e45d73eae 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -863,13 +863,13 @@ typedef struct TableAmRoutine
  * for the relation.  Works for tables, views, foreign tables and partitioned
  * tables.
  */
-extern const TupleTableSlotOps *table_slot_callbacks(Relation rel);
+extern const TupleTableSlotOps *table_slot_callbacks(Relation relation);
 
 /*
  * Returns slot using the callbacks returned by table_slot_callbacks(), and
  * registers it on *reglist.
  */
-extern TupleTableSlot *table_slot_create(Relation rel, List **reglist);
+extern TupleTableSlot *table_slot_create(Relation relation, List **reglist);
 
 
 /* ----------------------------------------------------------------------------
@@ -895,7 +895,7 @@ table_beginscan(Relation rel, Snapshot snapshot,
  * Like table_beginscan(), but for scanning catalog. It'll automatically use a
  * snapshot appropriate for scanning catalog relations.
  */
-extern TableScanDesc table_beginscan_catalog(Relation rel, int nkeys,
+extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
 											 struct ScanKeyData *key);
 
 /*
@@ -1133,7 +1133,7 @@ extern void table_parallelscan_initialize(Relation rel,
  *
  * Caller must hold a suitable lock on the relation.
  */
-extern TableScanDesc table_beginscan_parallel(Relation rel,
+extern TableScanDesc table_beginscan_parallel(Relation relation,
 											  ParallelTableScanDesc pscan);
 
 /*
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index f5a5fd826..a37dafc66 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/twophase.h b/src/include/access/twophase.h
index 5d6544e26..f94fded10 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 300baae12..c604ee11f 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 9ebd321ba..3dbfa6b59 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/xlogreader.h b/src/include/access/xlogreader.h
index 6afec33d4..6dcde2523 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 0aa85d90e..0e3e246bd 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 ef182977b..18dc5f99a 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 729c4c46c..98a1a8428 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/objectaccess.h b/src/include/catalog/objectaccess.h
index 567ab63e8..d754f4120 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 cf4d8b310..340ffc95a 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 fb26123aa..e59ed94ed 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 b5a32755a..9221c2ea5 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 c298327f5..ecf5a28e0 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/alter.h b/src/include/commands/alter.h
index 52f5e6f6d..fddfa3b85 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -29,7 +29,7 @@ extern Oid	AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
 									 ObjectAddresses *objsMoved);
 
 extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
-extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
+extern void AlterObjectOwner_internal(Relation rel, Oid objectId,
 									  Oid new_ownerId);
 
 #endif							/* ALTER_H */
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index df8e73af4..de9040c4b 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -45,7 +45,7 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
 							 bool check_constraints,
 							 bool is_internal,
 							 TransactionId frozenXid,
-							 MultiXactId minMulti,
+							 MultiXactId cutoffMulti,
 							 char newrelpersistence);
 
 #endif							/* CLUSTER_H */
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index ab736fb62..da3136527 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -18,6 +18,6 @@
 #include "catalog/objectaddress.h"
 #include "nodes/parsenodes.h"
 
-extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
+extern ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt);
 
 #endif							/* CONVERSIONCMDS_H */
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h
index cb0096aeb..d7efec6f2 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);
diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h
index 0ee2452fe..545e5430c 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/commands/policy.h b/src/include/commands/policy.h
index c5f3753da..f05bb66c6 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -23,7 +23,7 @@ extern void RelationBuildRowSecurity(Relation relation);
 
 extern void RemovePolicyById(Oid policy_id);
 
-extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid objid);
+extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid policy_id);
 
 extern ObjectAddress CreatePolicy(CreatePolicyStmt *stmt);
 extern ObjectAddress AlterPolicy(AlterPolicyStmt *stmt);
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 57df3fc1e..249119657 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
 extern void RemovePublicationSchemaById(Oid psoid);
 
 extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
 extern void InvalidatePublicationRels(List *relids);
 extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
 										   List *ancestors, bool pubviaroot);
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index 8c21f2a2c..3076bb891 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -18,7 +18,7 @@
 #include "catalog/objectaddress.h"
 #include "nodes/parsenodes.h"
 
-extern Oid	CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid	CreateSchemaCommand(CreateSchemaStmt *stmt,
 								const char *queryString,
 								int stmt_location, int stmt_len);
 
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d38c0e238..b3b04ccfa 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -55,16 +55,16 @@ extern int64 nextval_internal(Oid relid, bool check_permissions);
 extern Datum nextval(PG_FUNCTION_ARGS);
 extern List *sequence_options(Oid relid);
 
-extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq);
 extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
 extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
 extern void DeleteSequenceTuple(Oid relid);
 extern void ResetSequence(Oid seq_relid);
 extern void ResetSequenceCaches(void);
 
-extern void seq_redo(XLogReaderState *rptr);
-extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
+extern void seq_redo(XLogReaderState *record);
+extern void seq_desc(StringInfo buf, XLogReaderState *record);
 extern const char *seq_identify(uint8 info);
-extern void seq_mask(char *pagedata, BlockNumber blkno);
+extern void seq_mask(char *page, BlockNumber blkno);
 
 #endif							/* SEQUENCE_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0c48654b9..03f14d6be 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -66,7 +66,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
 
 extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
 extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
-								  RelFileNumber newRelFileNumber);
+								  RelFileNumber newRelFilenumber);
 
 extern ObjectAddress renameatt(RenameStmt *stmt);
 
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1f8090711..a11c9e947 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -62,8 +62,8 @@ extern char *get_tablespace_name(Oid spc_oid);
 extern bool directory_is_empty(const char *path);
 extern void remove_tablespace_symlink(const char *linkloc);
 
-extern void tblspc_redo(XLogReaderState *rptr);
-extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
+extern void tblspc_redo(XLogReaderState *record);
+extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
 extern const char *tblspc_identify(uint8 info);
 
 #endif							/* TABLESPACE_H */
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index b7b6bd600..7615519a8 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -166,7 +166,7 @@ extern void TriggerSetParentTrigger(Relation trigRel,
 									Oid parentTrigId,
 									Oid childTableId);
 extern void RemoveTriggerById(Oid trigOid);
-extern Oid	get_trigger_oid(Oid relid, const char *name, bool missing_ok);
+extern Oid	get_trigger_oid(Oid relid, const char *trigname, bool missing_ok);
 
 extern ObjectAddress renametrig(RenameStmt *stmt);
 
@@ -239,7 +239,7 @@ extern void ExecARUpdateTriggers(EState *estate,
 								 ResultRelInfo *dst_partinfo,
 								 ItemPointer tupleid,
 								 HeapTuple fdw_trigtuple,
-								 TupleTableSlot *slot,
+								 TupleTableSlot *newslot,
 								 List *recheckIndexes,
 								 TransitionCaptureState *transition_capture,
 								 bool is_crosspart_update);
@@ -267,9 +267,9 @@ extern bool AfterTriggerPendingOnRel(Oid relid);
  * in utils/adt/ri_triggers.c
  */
 extern bool RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
-										  TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+										  TupleTableSlot *oldslot, TupleTableSlot *newslot);
 extern bool RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
-										  TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+										  TupleTableSlot *oldslot, TupleTableSlot *newslot);
 extern bool RI_Initial_Check(Trigger *trigger,
 							 Relation fk_rel, Relation pk_rel);
 extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel,
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index a17bedb85..532bc49c3 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -34,7 +34,7 @@ extern Oid	AssignTypeMultirangeArrayOid(void);
 
 extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
 extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
-extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
+extern ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint,
 											  ObjectAddress *constrAddr);
 extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
 extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 63f2b6a80..a1751b370 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -26,8 +26,8 @@ extern char *pg_strdup(const char *in);
 extern void *pg_malloc(size_t size);
 extern void *pg_malloc0(size_t size);
 extern void *pg_malloc_extended(size_t size, int flags);
-extern void *pg_realloc(void *pointer, size_t size);
-extern void pg_free(void *pointer);
+extern void *pg_realloc(void *ptr, size_t size);
+extern void pg_free(void *ptr);
 
 /*
  * Variants with easier notation and more type safety
diff --git a/src/include/common/kwlookup.h b/src/include/common/kwlookup.h
index 48d7f08b8..8384e33a5 100644
--- a/src/include/common/kwlookup.h
+++ b/src/include/common/kwlookup.h
@@ -32,7 +32,7 @@ typedef struct ScanKeywordList
 } ScanKeywordList;
 
 
-extern int	ScanKeywordLookup(const char *text, const ScanKeywordList *keywords);
+extern int	ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
 
 /* Code that wants to retrieve the text of the N'th keyword should use this. */
 static inline const char *
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index d1f840c11..e1f5e786e 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -49,7 +49,7 @@
 extern int	scram_SaltedPassword(const char *password, const char *salt,
 								 int saltlen, int iterations, uint8 *result,
 								 const char **errstr);
-extern int	scram_H(const uint8 *str, int len, uint8 *result,
+extern int	scram_H(const uint8 *input, int len, uint8 *result,
 					const char **errstr);
 extern int	scram_ClientKey(const uint8 *salted_password, uint8 *result,
 							const char **errstr);
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h
index 3a1b11326..955d0bd64 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 82925b4b6..fc8a469f2 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,
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index b2c0c7486..697abe5fc 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/fe_utils/parallel_slot.h b/src/include/fe_utils/parallel_slot.h
index 8ce63c937..199df9bb0 100644
--- a/src/include/fe_utils/parallel_slot.h
+++ b/src/include/fe_utils/parallel_slot.h
@@ -58,7 +58,7 @@ ParallelSlotClearHandler(ParallelSlot *slot)
 	slot->handler_context = NULL;
 }
 
-extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *slots,
+extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *sa,
 										  const char *dbname);
 
 extern ParallelSlotArray *ParallelSlotsSetup(int numslots, ConnParams *cparams,
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 9261a7b0a..757fd6ac5 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -65,6 +65,6 @@ extern void simple_string_list_destroy(SimpleStringList *list);
 
 extern const char *simple_string_list_not_touched(SimpleStringList *list);
 
-extern void simple_ptr_list_append(SimplePtrList *list, void *val);
+extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
 
 #endif							/* SIMPLE_LIST_H */
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index fa4deb249..0927cb19b 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -24,7 +24,7 @@ extern PGDLLIMPORT int quote_all_identifiers;
 extern PQExpBuffer (*getLocalPQExpBuffer) (void);
 
 /* Functions */
-extern const char *fmtId(const char *identifier);
+extern const char *fmtId(const char *rawid);
 extern const char *fmtQualifiedId(const char *schema, const char *id);
 
 extern char *formatPGVersionNumber(int version_number, bool include_minor,
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index dc3d819a1..10dbe3981 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -348,7 +348,7 @@ extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx);
  * "VARIADIC NULL".
  */
 extern int	extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start,
-								  bool convert_unknown, Datum **values,
+								  bool convert_unknown, Datum **args,
 								  Oid **types, bool **nulls);
 
 #endif							/* FUNCAPI_H */
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h
index 90036f7bc..d06da8180 100644
--- a/src/include/libpq/hba.h
+++ b/src/include/libpq/hba.h
@@ -169,7 +169,7 @@ extern const char *hba_authname(UserAuth auth_method);
 extern void hba_getauthmethod(hbaPort *port);
 extern int	check_usermap(const char *usermap_name,
 						  const char *pg_role, const char *auth_user,
-						  bool case_sensitive);
+						  bool case_insensitive);
 extern HbaLine *parse_hba_line(TokenizedAuthLine *tok_line, int elevel);
 extern IdentLine *parse_ident_line(TokenizedAuthLine *tok_line, int elevel);
 extern bool pg_isblank(const char c);
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 6687c8f4c..0d7b43d83 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -19,6 +19,6 @@
 extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh);
 extern void pq_set_parallel_leader(pid_t pid, BackendId backend_id);
 
-extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
+extern void pq_parse_errornotice(StringInfo msg, ErrorData *edata);
 
 #endif							/* PQMQ_H */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 1e8c3af36..284b86525 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -610,7 +610,7 @@ extern size_t pg_wchar_strlen(const pg_wchar *wstr);
 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 65cf4ba50..ee48e392e 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/nodes/nodes.h b/src/include/nodes/nodes.h
index cdd6debfa..a80f43e54 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -218,7 +218,7 @@ extern int16 *readAttrNumberCols(int numCols);
 /*
  * nodes/copyfuncs.c
  */
-extern void *copyObjectImpl(const void *obj);
+extern void *copyObjectImpl(const void *from);
 
 /* cast result back to argument type, if supported by compiler */
 #ifdef HAVE_TYPEOF
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index de2dd907e..543543d68 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -163,8 +163,8 @@ extern ParamListInfo copyParamList(ParamListInfo from);
 extern Size EstimateParamListSpace(ParamListInfo paramLI);
 extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
 extern ParamListInfo RestoreParamList(char **start_address);
-extern char *BuildParamLogString(ParamListInfo params, char **paramTextValues,
-								 int valueLen);
+extern char *BuildParamLogString(ParamListInfo params, char **knownTextValues,
+								 int maxlen);
 extern void ParamsErrorCallback(void *arg);
 
 #endif							/* PARAMS_H */
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 5e83b843d..91878e8b9 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -83,7 +83,7 @@ typedef struct BitString
 
 extern Integer *makeInteger(int i);
 extern Float *makeFloat(char *numericStr);
-extern Boolean *makeBoolean(bool var);
+extern Boolean *makeBoolean(bool val);
 extern String *makeString(char *str);
 extern BitString *makeBitString(char *str);
 
diff --git a/src/include/optimizer/appendinfo.h b/src/include/optimizer/appendinfo.h
index 5e80a741a..28568fab5 100644
--- a/src/include/optimizer/appendinfo.h
+++ b/src/include/optimizer/appendinfo.h
@@ -40,7 +40,7 @@ extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
 											 List **update_colnos);
 extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
 											   Relids relids, int *nappinfos);
-extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
+extern void add_row_identity_var(PlannerInfo *root, Var *orig_var,
 								 Index rtindex, const char *rowid_name);
 extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
 									 RangeTblEntry *target_rte,
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 6c5203dc4..ff242d1b6 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -40,8 +40,8 @@ extern bool contain_leaked_vars(Node *clause);
 
 extern Relids find_nonnullable_rels(Node *clause);
 extern List *find_nonnullable_vars(Node *clause);
-extern List *find_forced_null_vars(Node *clause);
-extern Var *find_forced_null_var(Node *clause);
+extern List *find_forced_null_vars(Node *node);
+extern Var *find_forced_null_var(Node *node);
 
 extern bool is_pseudo_constant_clause(Node *clause);
 extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d11cdac7f..881386997 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -170,8 +170,8 @@ extern void add_child_rel_equivalences(PlannerInfo *root,
 extern void add_child_join_rel_equivalences(PlannerInfo *root,
 											int nappinfos,
 											AppendRelInfo **appinfos,
-											RelOptInfo *parent_rel,
-											RelOptInfo *child_rel);
+											RelOptInfo *parent_joinrel,
+											RelOptInfo *child_joinrel);
 extern List *generate_implied_equalities_for_column(PlannerInfo *root,
 													RelOptInfo *rel,
 													ec_matches_callback_type callback,
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 1566f435b..9dffdcfd1 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -115,6 +115,6 @@ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
 extern bool trivial_subqueryscan(SubqueryScan *plan);
 extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
 extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
-extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *root);
+extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *context);
 
 #endif							/* PLANMAIN_H */
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index dc379547c..3d3a5918c 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -43,7 +43,7 @@ extern List *transformInsertRow(ParseState *pstate, List *exprlist,
 								List *stmtcols, List *icolumns, List *attrnos,
 								bool strip_indirection);
 extern List *transformUpdateTargetList(ParseState *pstate,
-									   List *targetList);
+									   List *origTlist);
 extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
 extern Query *transformStmt(ParseState *pstate, Node *parseTree);
 
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index c56822f64..0856af5b4 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -19,7 +19,7 @@ extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
 								   List *args, List *aggorder,
 								   bool agg_distinct);
 
-extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *g);
+extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *p);
 
 extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
 									WindowDef *windef);
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index e15b62290..7a57b199b 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -29,8 +29,8 @@ extern Oid	LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
 
 /* Routines to find operators matching a name and given input types */
 /* NB: the selected operator may require coercion of the input types! */
-extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2,
-					 bool noError, int location);
+extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
+					 Oid rtypeId, bool noError, int location);
 extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
 						  bool noError, int location);
 
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index de21c3c64..484db165d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -88,7 +88,7 @@ extern ParseNamespaceItem *addRangeTableEntryForJoin(ParseState *pstate,
 													 List *aliasvars,
 													 List *leftcols,
 													 List *rightcols,
-													 Alias *joinalias,
+													 Alias *join_using_alias,
 													 Alias *alias,
 													 bool inFromCl);
 extern ParseNamespaceItem *addRangeTableEntryForCTE(ParseState *pstate,
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index b1e3f1b84..1f5b706d8 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -98,7 +98,7 @@ typedef struct PartitionBoundInfoData
 #define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1)
 #define partition_bound_has_default(bi) ((bi)->default_index != -1)
 
-extern int	get_hash_partition_greatest_modulus(PartitionBoundInfo b);
+extern int	get_hash_partition_greatest_modulus(PartitionBoundInfo bound);
 extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
 										   Oid *partcollation,
 										   Datum *values, bool *isnull);
@@ -125,7 +125,7 @@ extern void check_new_partition_bound(char *relname, Relation parent,
 									  PartitionBoundSpec *spec,
 									  ParseState *pstate);
 extern void check_default_partition_contents(Relation parent,
-											 Relation defaultRel,
+											 Relation default_rel,
 											 PartitionBoundSpec *new_spec);
 
 extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index ac28f813b..ad7334a0d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -417,7 +417,7 @@ extern long pgstat_report_stat(bool force);
 extern void pgstat_force_next_flush(void);
 
 extern void pgstat_reset_counters(void);
-extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objectid);
+extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objoid);
 extern void pgstat_reset_of_kind(PgStat_Kind kind);
 
 /* stats accessors */
@@ -474,7 +474,7 @@ extern void pgstat_report_connect(Oid dboid);
 #define pgstat_count_conn_txn_idle_time(n)							\
 	(pgStatTransactionIdleTime += (n))
 
-extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid);
+extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
 
 /*
  * Functions in pgstat_function.c
@@ -489,7 +489,7 @@ extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
 extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu,
 									  bool finalize);
 
-extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid);
+extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid func_id);
 extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
 
 
@@ -499,7 +499,7 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
 
 extern void pgstat_create_relation(Relation rel);
 extern void pgstat_drop_relation(Relation rel);
-extern void pgstat_copy_relation_stats(Relation dstrel, Relation srcrel);
+extern void pgstat_copy_relation_stats(Relation dst, Relation src);
 
 extern void pgstat_init_relation(Relation rel);
 extern void pgstat_assoc_relation(Relation rel);
@@ -571,7 +571,7 @@ extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
 
 extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid);
 extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry_ext(bool shared,
-														   Oid relid);
+														   Oid reloid);
 extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
 
 
diff --git a/src/include/port.h b/src/include/port.h
index cec41eae7..7ee75994d 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -46,14 +46,14 @@ extern bool pg_set_block(pgsocket sock);
 
 /* Portable path handling for Unix/Win32 (in path.c) */
 
-extern bool has_drive_prefix(const char *filename);
+extern bool has_drive_prefix(const char *path);
 extern char *first_dir_separator(const char *filename);
 extern char *last_dir_separator(const char *filename);
 extern char *first_path_var_separator(const char *pathlist);
 extern void join_path_components(char *ret_path,
 								 const char *head, const char *tail);
 extern void canonicalize_path(char *path);
-extern void make_native_path(char *path);
+extern void make_native_path(char *filename);
 extern void cleanup_path(char *path);
 extern bool path_contains_parent_reference(const char *path);
 extern bool path_is_relative_and_below_cwd(const char *path);
@@ -479,7 +479,7 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
 extern char *escape_single_quotes_ascii(const char *src);
 
 /* common/wait_error.c */
-extern char *wait_result_to_str(int exit_status);
+extern char *wait_result_to_str(int exitstatus);
 extern bool wait_result_is_signal(int exit_status, int signum);
 extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
 
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index a771ab8ff..7eaa4c97e 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/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index 8695901ba..d7902666b 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -655,11 +655,12 @@ extern void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
 										TimestampTz commit_time,
 										RepOriginId origin_id, XLogRecPtr origin_lsn,
 										char *gid, bool is_commit);
-extern void ReorderBufferAssignChild(ReorderBuffer *, TransactionId, TransactionId, XLogRecPtr commit_lsn);
+extern void ReorderBufferAssignChild(ReorderBuffer *rb, TransactionId xid,
+									 TransactionId subxid, XLogRecPtr lsn);
 extern void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId,
 									 XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
 extern void ReorderBufferAbort(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
-extern void ReorderBufferAbortOld(ReorderBuffer *, TransactionId xid);
+extern void ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid);
 extern void ReorderBufferForget(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
 extern void ReorderBufferInvalidate(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
 
@@ -667,9 +668,10 @@ extern void ReorderBufferSetBaseSnapshot(ReorderBuffer *, TransactionId, XLogRec
 extern void ReorderBufferAddSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap);
 extern void ReorderBufferAddNewCommandId(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
 										 CommandId cid);
-extern void ReorderBufferAddNewTupleCids(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
-										 RelFileLocator locator, ItemPointerData pt,
-										 CommandId cmin, CommandId cmax, CommandId combocid);
+extern void ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
+										 RelFileLocator locator, ItemPointerData tid,
+										 CommandId cmin, CommandId cmax,
+										 CommandId combocid);
 extern void ReorderBufferAddInvalidations(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
 										  Size nmsgs, SharedInvalidationMessage *msgs);
 extern void ReorderBufferImmediateInvalidation(ReorderBuffer *, uint32 ninvalidations,
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 8c9f3321d..9d68bfa64 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -195,7 +195,7 @@ 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/snapbuild.h b/src/include/replication/snapbuild.h
index e6adea24f..f126ff2e0 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -59,24 +59,24 @@ struct xl_running_xacts;
 
 extern void CheckPointSnapBuild(void);
 
-extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *cache,
+extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *reorder,
 										  TransactionId xmin_horizon, XLogRecPtr start_lsn,
 										  bool need_full_snapshot,
 										  XLogRecPtr two_phase_at);
-extern void FreeSnapshotBuilder(SnapBuild *cache);
+extern void FreeSnapshotBuilder(SnapBuild *builder);
 
 extern void SnapBuildSnapDecRefcount(Snapshot snap);
 
 extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
-extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
+extern const char *SnapBuildExportSnapshot(SnapBuild *builder);
 extern void SnapBuildClearExportedSnapshot(void);
 extern void SnapBuildResetExportedSnapshotState(void);
 
-extern SnapBuildState SnapBuildCurrentState(SnapBuild *snapstate);
+extern SnapBuildState SnapBuildCurrentState(SnapBuild *builder);
 extern Snapshot SnapBuildGetOrBuildSnapshot(SnapBuild *builder,
 											TransactionId xid);
 
-extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
+extern bool SnapBuildXactNeedsSkip(SnapBuild *builder, XLogRecPtr ptr);
 extern XLogRecPtr SnapBuildGetTwoPhaseAt(SnapBuild *builder);
 extern void SnapBuildSetTwoPhaseAt(SnapBuild *builder, XLogRecPtr ptr);
 
@@ -86,7 +86,8 @@ extern void SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn,
 extern bool SnapBuildProcessChange(SnapBuild *builder, TransactionId xid,
 								   XLogRecPtr lsn);
 extern void SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
-								   XLogRecPtr lsn, struct xl_heap_new_cid *cid);
+								   XLogRecPtr lsn,
+								   struct xl_heap_new_cid *xlrec);
 extern void SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn,
 										 struct xl_running_xacts *running);
 extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index d99a21b07..8336a6e71 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/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 98b9b3a28..f001ca41b 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -42,7 +42,7 @@ typedef enum ReplaceVarsNoMatchOption
 
 
 extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
-extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
+extern void ChangeVarNodes(Node *node, int rt_index, int new_index,
 						   int sublevels_up);
 extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
 									int min_sublevels_up);
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
index bf172d5b9..ef5a54640 100644
--- a/src/include/snowball/libstemmer/header.h
+++ b/src/include/snowball/libstemmer/header.h
@@ -45,7 +45,7 @@ extern int eq_v_b(struct SN_env * z, const symbol * p);
 extern int find_among(struct SN_env * z, const struct among * v, int v_size);
 extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
 
-extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr);
 extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
 extern int slice_from_v(struct SN_env * z, const symbol * p);
 extern int slice_del(struct SN_env * z);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index bb7ef1240..0351927a2 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -102,8 +102,8 @@ extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalro
 									   int numrows, HeapTuple *rows,
 									   int natts, VacAttrStats **vacattrstats);
 extern int	ComputeExtStatisticsRows(Relation onerel,
-									 int natts, VacAttrStats **stats);
-extern bool statext_is_kind_built(HeapTuple htup, char kind);
+									 int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char type);
 extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
 													   List *clauses,
 													   int varRelid,
diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h
index 57d2c52e7..4b16ab812 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 6a947021a..2708c4b68 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/fd.h b/src/include/storage/fd.h
index 2b4a8e0ff..5a48fccd9 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 a6f837217..819160c78 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 04c1a051b..129590863 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/predicate.h b/src/include/storage/predicate.h
index 8dfcb3944..dbef2ffb0 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/standby.h b/src/include/storage/standby.h
index dacef92f4..f5da98dc7 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);
 
 /*
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
index b9e8992a4..60e3179c7 100644
--- a/src/include/tcop/cmdtag.h
+++ b/src/include/tcop/cmdtag.h
@@ -53,6 +53,6 @@ extern const char *GetCommandTagName(CommandTag commandTag);
 extern bool command_tag_display_rowcount(CommandTag commandTag);
 extern bool command_tag_event_trigger_ok(CommandTag commandTag);
 extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
-extern CommandTag GetCommandTagEnum(const char *tagname);
+extern CommandTag GetCommandTagEnum(const char *commandname);
 
 #endif							/* CMDTAG_H */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index c36c711da..fd73b3844 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -32,8 +32,8 @@ typedef struct TSVectorParseStateData *TSVectorParseState;
 extern TSVectorParseState init_tsvector_parser(char *input, int flags);
 extern void reset_tsvector_parser(TSVectorParseState state, char *input);
 extern bool gettoken_tsvector(TSVectorParseState state,
-							  char **token, int *len,
-							  WordEntryPos **pos, int *poslen,
+							  char **strval, int *lenval,
+							  WordEntryPos **pos_ptr, int *poslen,
 							  char **endptr);
 extern void close_tsvector_parser(TSVectorParseState state);
 
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 3d6411197..9a4df3a5d 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -214,8 +214,8 @@ extern bool is_member_of_role_nosuper(Oid member, Oid role);
 extern bool is_admin_of_role(Oid member, Oid role);
 extern Oid	select_best_admin(Oid member, Oid role);
 extern void check_is_member_of_role(Oid member, Oid role);
-extern Oid	get_role_oid(const char *rolename, bool missing_ok);
-extern Oid	get_role_oid_or_public(const char *rolename);
+extern Oid	get_role_oid(const char *rolname, bool missing_ok);
+extern Oid	get_role_oid_or_public(const char *rolname);
 extern Oid	get_rolespec_oid(const RoleSpec *role, bool missing_ok);
 extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
 extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
@@ -285,7 +285,7 @@ extern AclResult pg_parameter_acl_aclcheck(Oid acl_oid, Oid roleid,
 										   AclMode mode);
 extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
 extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
-extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
+extern AclResult pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid,
 												  AclMode mode, Snapshot snapshot);
 extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
 extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index ee37af950..49ae64721 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -23,6 +23,6 @@ typedef struct AttributeOpts
 	float8		n_distinct_inherited;
 } AttributeOpts;
 
-extern AttributeOpts *get_attribute_options(Oid spcid, int attnum);
+extern AttributeOpts *get_attribute_options(Oid attrelid, int attnum);
 
 #endif							/* ATTOPTCACHE_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 221c3e6c3..81631f164 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,10 +47,10 @@ extern int16 pg_strtoint16(const char *s);
 extern int32 pg_strtoint32(const char *s);
 extern int64 pg_strtoint64(const char *s);
 extern int	pg_itoa(int16 i, char *a);
-extern int	pg_ultoa_n(uint32 l, char *a);
-extern int	pg_ulltoa_n(uint64 l, char *a);
-extern int	pg_ltoa(int32 l, char *a);
-extern int	pg_lltoa(int64 ll, char *a);
+extern int	pg_ultoa_n(uint32 value, char *a);
+extern int	pg_ulltoa_n(uint64 value, char *a);
+extern int	pg_ltoa(int32 value, char *a);
+extern int	pg_lltoa(int64 value, char *a);
 extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
 extern char *pg_ultostr(char *str, uint32 value);
 
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 4527e8251..2cae346be 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -327,7 +327,7 @@ extern int	DecodeTimezoneAbbrev(int field, char *lowtoken,
 extern int	DecodeSpecial(int field, char *lowtoken, int *val);
 extern int	DecodeUnits(int field, char *lowtoken, int *val);
 
-extern int	j2day(int jd);
+extern int	j2day(int date);
 
 extern Node *TemporalSimplify(int32 max_precis, Node *node);
 
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 4cbe6edf2..8f1b3dc5e 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -379,13 +379,13 @@ typedef struct JsonbIterator
 extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
 extern uint32 getJsonbLength(const JsonbContainer *jc, int index);
 extern int	compareJsonbContainers(JsonbContainer *a, JsonbContainer *b);
-extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *container,
 											   uint32 flags,
 											   JsonbValue *key);
 extern JsonbValue *getKeyJsonValueFromContainer(JsonbContainer *container,
 												const char *keyVal, int keyLen,
 												JsonbValue *res);
-extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *container,
 												 uint32 i);
 extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
 								  JsonbIteratorToken seq, JsonbValue *jbval);
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 915330f99..bc3339205 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -64,7 +64,7 @@ extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
 								   const MultirangeType *mr2);
 extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
 											  const MultirangeType *mr,
-											  Datum elem);
+											  Datum val);
 extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
 											   const MultirangeType *mr,
 											   const RangeType *r);
@@ -115,11 +115,11 @@ extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
 extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
 											   Oid mltrngtypid);
 extern void multirange_deserialize(TypeCacheEntry *rangetyp,
-								   const MultirangeType *range,
+								   const MultirangeType *multirange,
 								   int32 *range_count,
 								   RangeType ***ranges);
 extern MultirangeType *make_multirange(Oid mltrngtypoid,
-									   TypeCacheEntry *typcache,
+									   TypeCacheEntry *rangetyp,
 									   int32 range_count, RangeType **ranges);
 extern MultirangeType *make_empty_multirange(Oid mltrngtypoid,
 											 TypeCacheEntry *rangetyp);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3caa74dfe..09d355e81 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -85,6 +85,6 @@ extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
 									 bool *have_error);
 extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
 									 bool *have_error);
-extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *have_error);
 
 #endif							/* _PG_NUMERIC_H_ */
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 901d2041d..40a360285 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -567,7 +567,7 @@ extern void pgstat_relation_delete_pending_cb(PgStat_EntryRef *entry_ref);
  */
 
 extern void pgstat_replslot_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
-extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *tmp, NameData *name);
+extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *header, NameData *name);
 extern bool pgstat_replslot_from_serialized_name_cb(const NameData *name, PgStat_HashKey *key);
 
 
@@ -579,7 +579,7 @@ extern void pgstat_attach_shmem(void);
 extern void pgstat_detach_shmem(void);
 
 extern PgStat_EntryRef *pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid,
-											 bool create, bool *found);
+											 bool create, bool *created_entry);
 extern bool pgstat_lock_entry(PgStat_EntryRef *entry_ref, bool nowait);
 extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
 extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index 993fad4fc..b62f1ea48 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -141,8 +141,8 @@ extern int	range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1,
 extern int	range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1,
 								   const RangeBound *b2);
 extern int	range_compare(const void *key1, const void *key2, void *arg);
-extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
-							RangeBound bound2);
+extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA,
+							RangeBound boundB);
 extern RangeType *make_empty_range(TypeCacheEntry *typcache);
 extern bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1,
 								 const RangeType *r2, RangeType **output1,
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
index a36ceba7a..0e2965ff9 100644
--- a/src/include/utils/regproc.h
+++ b/src/include/utils/regproc.h
@@ -28,7 +28,7 @@ extern char *format_operator_extended(Oid operator_oid, bits16 flags);
 extern List *stringToQualifiedNameList(const char *string);
 extern char *format_procedure(Oid procedure_oid);
 extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
+extern void format_procedure_parts(Oid procedure_oid, List **objnames,
 								   List **objargs, bool missing_ok);
 
 extern char *format_operator(Oid operator_oid);
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index ba35d6b3b..73106b6fc 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -50,7 +50,7 @@ extern Oid	RelationGetReplicaIndex(Relation relation);
 extern List *RelationGetIndexExpressions(Relation relation);
 extern List *RelationGetDummyIndexExpressions(Relation relation);
 extern List *RelationGetIndexPredicate(Relation relation);
-extern Datum *RelationGetIndexRawAttOptions(Relation relation);
+extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
 extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
 
 typedef enum IndexAttrBitmapKind
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 2bb2e255f..92f1f779a 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -37,7 +37,7 @@ typedef struct xl_relmap_update
 
 extern RelFileNumber RelationMapOidToFilenumber(Oid relationId, bool shared);
 
-extern Oid	RelationMapFilenumberToOid(RelFileNumber relationId, bool shared);
+extern Oid	RelationMapFilenumberToOid(RelFileNumber filenumber, bool shared);
 extern RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath,
 														   Oid relationId);
 extern void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath,
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index d485b9bfc..49af4ed2e 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -181,11 +181,11 @@ extern double ineq_histogram_selectivity(PlannerInfo *root,
 										 Oid collation,
 										 Datum constval, Oid consttype);
 extern double var_eq_const(VariableStatData *vardata,
-						   Oid oproid, Oid collation,
+						   Oid operator, Oid collation,
 						   Datum constval, bool constisnull,
 						   bool varonleft, bool negate);
 extern double var_eq_non_const(VariableStatData *vardata,
-							   Oid oproid, Oid collation,
+							   Oid operator, Oid collation,
 							   Node *other,
 							   bool varonleft, bool negate);
 
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 06eafdf11..9f4dd5360 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -169,7 +169,7 @@ extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
 /* Support for catalog timetravel for logical decoding */
 struct HTAB;
 extern struct HTAB *HistoricSnapshotGetTupleCids(void);
-extern void SetupHistoricSnapshot(Snapshot snapshot_now, struct HTAB *tuplecids);
+extern void SetupHistoricSnapshot(Snapshot historic_snapshot, struct HTAB *tuplecids);
 extern void TeardownHistoricSnapshot(bool is_error);
 extern bool HistoricSnapshotActive(void);
 
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index edf3a9731..820c08941 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -83,10 +83,10 @@ extern pg_time_t timestamptz_to_time_t(TimestampTz t);
 
 extern const char *timestamptz_to_str(TimestampTz t);
 
-extern int	tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *dt);
+extern int	tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result);
 extern int	timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm,
 						 fsec_t *fsec, const char **tzn, pg_tz *attimezone);
-extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
+extern void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec);
 
 extern void interval2itm(Interval span, struct pg_itm *itm);
 extern int	itm2interval(struct pg_itm *itm, Interval *span);
diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index dbad77643..ed16f93ac 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/heaptuple.c b/src/backend/access/common/heaptuple.c
index 503cda46e..7e355585a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -420,13 +420,13 @@ heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
  * ----------------
  */
 Datum
-nocachegetattr(HeapTuple tuple,
+nocachegetattr(HeapTuple tup,
 			   int attnum,
 			   TupleDesc tupleDesc)
 {
-	HeapTupleHeader tup = tuple->t_data;
+	HeapTupleHeader td = tup->t_data;
 	char	   *tp;				/* ptr to data part of tuple */
-	bits8	   *bp = tup->t_bits;	/* ptr to null bitmap in tuple */
+	bits8	   *bp = td->t_bits;	/* ptr to null bitmap in tuple */
 	bool		slow = false;	/* do we have to walk attrs? */
 	int			off;			/* current offset within data */
 
@@ -441,7 +441,7 @@ nocachegetattr(HeapTuple tuple,
 
 	attnum--;
 
-	if (!HeapTupleNoNulls(tuple))
+	if (!HeapTupleNoNulls(tup))
 	{
 		/*
 		 * there's a null somewhere in the tuple
@@ -470,7 +470,7 @@ nocachegetattr(HeapTuple tuple,
 		}
 	}
 
-	tp = (char *) tup + tup->t_hoff;
+	tp = (char *) td + td->t_hoff;
 
 	if (!slow)
 	{
@@ -489,7 +489,7 @@ nocachegetattr(HeapTuple tuple,
 		 * target.  If there aren't any, it's safe to cheaply initialize the
 		 * cached offsets for these attrs.
 		 */
-		if (HeapTupleHasVarWidth(tuple))
+		if (HeapTupleHasVarWidth(tup))
 		{
 			int			j;
 
@@ -565,7 +565,7 @@ nocachegetattr(HeapTuple tuple,
 		{
 			Form_pg_attribute att = TupleDescAttr(tupleDesc, i);
 
-			if (HeapTupleHasNulls(tuple) && att_isnull(i, bp))
+			if (HeapTupleHasNulls(tup) && att_isnull(i, bp))
 			{
 				usecache = false;
 				continue;		/* this cannot be the target att */
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
index c6c7dfe4c..538e3880c 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/heap/heapam.c b/src/backend/access/heap/heapam.c
index 588716606..eb811d751 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -108,7 +108,7 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status
 static void index_delete_sort(TM_IndexDeleteOp *delstate);
 static int	bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate);
 static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
-static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_required,
+static HeapTuple ExtractReplicaIdentity(Relation relation, HeapTuple tp, bool key_required,
 										bool *copy);
 
 
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index ed72eb7b6..93aa5bad6 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -137,7 +137,7 @@ static void vm_extend(Relation rel, BlockNumber vm_nblocks);
  * any I/O.  Returns true if any bits have been cleared and false otherwise.
  */
 bool
-visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
+visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
 {
 	BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
 	int			mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -152,21 +152,21 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
 	elog(DEBUG1, "vm_clear %s %d", RelationGetRelationName(rel), heapBlk);
 #endif
 
-	if (!BufferIsValid(buf) || BufferGetBlockNumber(buf) != mapBlock)
+	if (!BufferIsValid(vmbuf) || BufferGetBlockNumber(vmbuf) != mapBlock)
 		elog(ERROR, "wrong buffer passed to visibilitymap_clear");
 
-	LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
-	map = PageGetContents(BufferGetPage(buf));
+	LockBuffer(vmbuf, BUFFER_LOCK_EXCLUSIVE);
+	map = PageGetContents(BufferGetPage(vmbuf));
 
 	if (map[mapByte] & mask)
 	{
 		map[mapByte] &= ~mask;
 
-		MarkBufferDirty(buf);
+		MarkBufferDirty(vmbuf);
 		cleared = true;
 	}
 
-	LockBuffer(buf, BUFFER_LOCK_UNLOCK);
+	LockBuffer(vmbuf, BUFFER_LOCK_UNLOCK);
 
 	return cleared;
 }
@@ -180,27 +180,27 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
  * shouldn't hold a lock on the heap page while doing that. Then, call
  * visibilitymap_set to actually set the bit.
  *
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by
  * an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
  * the bit for heapBlk.
  *
  * If the page doesn't exist in the map file yet, it is extended.
  */
 void
-visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
 {
 	BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
 
 	/* Reuse the old pinned buffer if possible */
-	if (BufferIsValid(*buf))
+	if (BufferIsValid(*vmbuf))
 	{
-		if (BufferGetBlockNumber(*buf) == mapBlock)
+		if (BufferGetBlockNumber(*vmbuf) == mapBlock)
 			return;
 
-		ReleaseBuffer(*buf);
+		ReleaseBuffer(*vmbuf);
 	}
-	*buf = vm_readbuf(rel, mapBlock, true);
+	*vmbuf = vm_readbuf(rel, mapBlock, true);
 }
 
 /*
@@ -314,11 +314,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
  * Are all tuples on heapBlk visible to all or are marked frozen, according
  * to the visibility map?
  *
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by an
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by an
  * earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
  * the bit for heapBlk, or InvalidBuffer. The caller is responsible for
- * releasing *buf after it's done testing and setting bits.
+ * releasing *vmbuf after it's done testing and setting bits.
  *
  * NOTE: This function is typically called without a lock on the heap page,
  * so somebody else could change the bit just after we look at it.  In fact,
@@ -328,7 +328,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
  * all concurrency issues!
  */
 uint8
-visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
 {
 	BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
 	uint32		mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -341,23 +341,23 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
 #endif
 
 	/* Reuse the old pinned buffer if possible */
-	if (BufferIsValid(*buf))
+	if (BufferIsValid(*vmbuf))
 	{
-		if (BufferGetBlockNumber(*buf) != mapBlock)
+		if (BufferGetBlockNumber(*vmbuf) != mapBlock)
 		{
-			ReleaseBuffer(*buf);
-			*buf = InvalidBuffer;
+			ReleaseBuffer(*vmbuf);
+			*vmbuf = InvalidBuffer;
 		}
 	}
 
-	if (!BufferIsValid(*buf))
+	if (!BufferIsValid(*vmbuf))
 	{
-		*buf = vm_readbuf(rel, mapBlock, false);
-		if (!BufferIsValid(*buf))
+		*vmbuf = vm_readbuf(rel, mapBlock, false);
+		if (!BufferIsValid(*vmbuf))
 			return false;
 	}
 
-	map = PageGetContents(BufferGetPage(*buf));
+	map = PageGetContents(BufferGetPage(*vmbuf));
 
 	/*
 	 * A single byte read is atomic.  There could be memory-ordering effects
diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c
index b3d1a6c3f..094b24c7c 100644
--- a/src/backend/access/table/tableam.c
+++ b/src/backend/access/table/tableam.c
@@ -172,19 +172,18 @@ table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan,
 }
 
 TableScanDesc
-table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
+table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
 {
 	Snapshot	snapshot;
 	uint32		flags = SO_TYPE_SEQSCAN |
 	SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
 
-	Assert(RelationGetRelid(relation) == parallel_scan->phs_relid);
+	Assert(RelationGetRelid(relation) == pscan->phs_relid);
 
-	if (!parallel_scan->phs_snapshot_any)
+	if (!pscan->phs_snapshot_any)
 	{
 		/* Snapshot was serialized -- restore it */
-		snapshot = RestoreSnapshot((char *) parallel_scan +
-								   parallel_scan->phs_snapshot_off);
+		snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
 		RegisterSnapshot(snapshot);
 		flags |= SO_TEMP_SNAPSHOT;
 	}
@@ -195,7 +194,7 @@ table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
 	}
 
 	return relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
-											parallel_scan, flags);
+											pscan, flags);
 }
 
 
diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c
index bbb542b32..6db9a1fca 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/multixact.c b/src/backend/access/transam/multixact.c
index ec57f56ad..a7383f553 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1214,14 +1214,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
  * range, that is, greater to or equal than oldestMultiXactId, and less than
  * nextMXact.  Otherwise, an error is raised.
  *
- * onlyLock must be set to true if caller is certain that the given multi
+ * isLockOnly must be set to true if caller is certain that the given multi
  * is used only to lock tuples; can be false without loss of correctness,
  * but passing a true means we can return quickly without checking for
  * old updates.
  */
 int
 GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
-					  bool from_pgupgrade, bool onlyLock)
+					  bool from_pgupgrade, bool isLockOnly)
 {
 	int			pageno;
 	int			prev_pageno;
@@ -1263,7 +1263,7 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
 	 * we can skip checking if the value is older than our oldest visible
 	 * multi.  It cannot possibly still be running.
 	 */
-	if (onlyLock &&
+	if (isLockOnly &&
 		MultiXactIdPrecedes(multi, OldestVisibleMXactId[MyBackendId]))
 	{
 		debug_elog2(DEBUG2, "GetMembers: a locker-only multi is too old");
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 50f092d7e..5eec4df47 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 81d339d57..eb0430fe9 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/xlogreader.c b/src/backend/access/transam/xlogreader.c
index c4fbc37c7..c2d4ab271 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 b20974bbe..6c7b05847 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/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 6ff48bb18..b5cb21fe5 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/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 635d05405..441f29d68 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
 static void error_duplicate_filter_variable(const char *defname);
 static Datum filter_list_to_array(List *filterlist);
 static Oid	insert_event_trigger_tuple(const char *trigname, const char *eventname,
-									   Oid evtOwner, Oid funcoid, List *tags);
+									   Oid evtOwner, Oid funcoid, List *taglist);
 static void validate_ddl_tags(const char *filtervar, List *taglist);
 static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
 static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 053d2ca5a..f86983c66 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
 static void show_hash_info(HashState *hashstate, ExplainState *es);
 static void show_memoize_info(MemoizeState *mstate, List *ancestors,
 							  ExplainState *es);
-static void show_hashagg_info(AggState *hashstate, ExplainState *es);
+static void show_hashagg_info(AggState *aggstate, ExplainState *es);
 static void show_tidbitmap_info(BitmapHeapScanState *planstate,
 								ExplainState *es);
 static void show_instrumentation_count(const char *qlabel, int which,
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index b97b8b043..b0747ce29 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -29,7 +29,7 @@
 #include "utils/syscache.h"
 
 static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
-static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
+static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
 static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
 										 Oid oldrelid, void *arg);
 static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index a583aa430..134610497 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
 }
 
 void
-AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
+AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
 {
 	HeapTuple	tup;
 	Relation	rel;
 
 	rel = table_open(NamespaceRelationId, RowExclusiveLock);
 
-	tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
+	tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
 	if (!HeapTupleIsValid(tup))
-		elog(ERROR, "cache lookup failed for schema %u", oid);
+		elog(ERROR, "cache lookup failed for schema %u", schemaoid);
 
 	AlterSchemaOwner_internal(tup, rel, newOwnerId);
 
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e3233a8f3..6c52edd9b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
 										   AlterTableCmd *cmd, LOCKMODE lockmode);
 static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
 static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
-static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
+static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
 static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
 								   LOCKMODE lockmode);
 static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
 								  List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
 static void CreateInheritance(Relation child_rel, Relation parent_rel);
 static void RemoveInheritance(Relation child_rel, Relation parent_rel,
-							  bool allow_detached);
+							  bool expect_detached);
 static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
 										   PartitionCmd *cmd,
 										   AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
 static void DetachPartitionFinalize(Relation rel, Relation partRel,
 									bool concurrent, Oid defaultPartOid);
 static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
-static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
+static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
 											  RangeVar *name);
 static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
 static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 5ad18d2de..6f5a5262c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
 							   ItemPointer tid,
 							   LockTupleMode lockmode,
 							   TupleTableSlot *oldslot,
-							   TupleTableSlot **newSlot,
-							   TM_FailureData *tmfpd);
+							   TupleTableSlot **epqslot,
+							   TM_FailureData *tmfdp);
 static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
 						   Trigger *trigger, TriggerEvent event,
 						   Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
 								  ResultRelInfo *src_partinfo,
 								  ResultRelInfo *dst_partinfo,
 								  int event, bool row_trigger,
-								  TupleTableSlot *oldtup, TupleTableSlot *newtup,
+								  TupleTableSlot *oldslot, TupleTableSlot *newslot,
 								  List *recheckIndexes, Bitmapset *modifiedCols,
 								  TransitionCaptureState *transition_capture,
 								  bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
 									Tuplestorestate *tuplestore);
 static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
 static SetConstraintState SetConstraintStateCreate(int numalloc);
-static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
+static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
 static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
 													Oid tgoid, bool tgisdeferred);
 static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);
diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c
index 6a8735edf..1f1181b56 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 f1fd7f7e8..99512826c 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 933c30490..fe74e4981 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 77dd1dae8..6622b202c 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 87403e247..2718c2113 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/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index d1b97d46b..972e024db 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -1229,10 +1229,10 @@ ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pc
  * ----------------------------------------------------------------
  */
 void
-ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt)
+ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt)
 {
 	node->shared_info =
-		shm_toc_lookup(pwcxt->toc, node->ss.ps.plan->plan_node_id, true);
+		shm_toc_lookup(pcxt->toc, node->ss.ps.plan->plan_node_id, true);
 	node->am_worker = true;
 }
 
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index d2bceb97c..7bfe02464 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 465ca7cf6..3ef67d35a 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/lib/integerset.c b/src/backend/lib/integerset.c
index 41d3abdb0..345cd1b3a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -264,9 +264,9 @@ static void intset_update_upper(IntegerSet *intset, int level,
 								intset_node *child, uint64 child_key);
 static void intset_flush_buffered_values(IntegerSet *intset);
 
-static int	intset_binsrch_uint64(uint64 value, uint64 *arr, int arr_elems,
+static int	intset_binsrch_uint64(uint64 item, uint64 *arr, int arr_elems,
 								  bool nextkey);
-static int	intset_binsrch_leaf(uint64 value, leaf_item *arr, int arr_elems,
+static int	intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems,
 								bool nextkey);
 
 static uint64 simple8b_encode(const uint64 *ints, int *num_encoded, uint64 base);
diff --git a/src/backend/optimizer/geqo/geqo_selection.c b/src/backend/optimizer/geqo/geqo_selection.c
index 50f678a49..fd3f6894d 100644
--- a/src/backend/optimizer/geqo/geqo_selection.c
+++ b/src/backend/optimizer/geqo/geqo_selection.c
@@ -42,7 +42,7 @@
 #include "optimizer/geqo_random.h"
 #include "optimizer/geqo_selection.h"
 
-static int	linear_rand(PlannerInfo *root, int max, double bias);
+static int	linear_rand(PlannerInfo *root, int pool_size, double bias);
 
 
 /*
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 5012bfe14..6d5718ee4 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -75,7 +75,8 @@ static List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
 static List *get_relation_statistics(RelOptInfo *rel, Relation relation);
 static void set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
 										Relation relation);
-static PartitionScheme find_partition_scheme(PlannerInfo *root, Relation rel);
+static PartitionScheme find_partition_scheme(PlannerInfo *root,
+											 Relation relation);
 static void set_baserel_partition_key_exprs(Relation relation,
 											RelOptInfo *rel);
 static void set_baserel_partition_constraint(Relation relation,
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index ea3378431..581a6cbf8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -205,8 +205,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
 static List *mergeTableFuncParameters(List *func_args, List *columns);
 static TypeName *TableFuncTypeName(List *columns);
 static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static RangeVar *makeRangeVarFromQualifiedName(char *name, List *rels,
-											   int location,
+static RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location,
 											   core_yyscan_t yyscanner);
 static void SplitColQualList(List *qualList,
 							 List **constraintList, CollateClause **collClause,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 061d0bcc5..202a38f81 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -67,7 +67,7 @@ static ParseNamespaceItem *transformRangeSubselect(ParseState *pstate,
 static ParseNamespaceItem *transformRangeFunction(ParseState *pstate,
 												  RangeFunction *r);
 static ParseNamespaceItem *transformRangeTableFunc(ParseState *pstate,
-												   RangeTableFunc *t);
+												   RangeTableFunc *rtf);
 static TableSampleClause *transformRangeTableSample(ParseState *pstate,
 													RangeTableSample *rts);
 static ParseNamespaceItem *getNSItemForSpecialRelationTypes(ParseState *pstate,
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 6d283006e..bd068bba0 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -139,7 +139,7 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
 static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
 										   Relation parent);
 static void validateInfiniteBounds(ParseState *pstate, List *blist);
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *con,
+static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
 										   const char *colName, Oid colType, int32 colTypmod,
 										   Oid partCollation);
 
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 57c9b5181..7f74ed212 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -104,7 +104,7 @@ static PartitionBoundInfo create_list_bounds(PartitionBoundSpec **boundspecs,
 static PartitionBoundInfo create_range_bounds(PartitionBoundSpec **boundspecs,
 											  int nparts, PartitionKey key, int **mapping);
 static PartitionBoundInfo merge_list_bounds(FmgrInfo *partsupfunc,
-											Oid *collations,
+											Oid *partcollation,
 											RelOptInfo *outer_rel,
 											RelOptInfo *inner_rel,
 											JoinType jointype,
@@ -123,8 +123,8 @@ static void free_partition_map(PartitionMap *map);
 static bool is_dummy_partition(RelOptInfo *rel, int part_index);
 static int	merge_matching_partitions(PartitionMap *outer_map,
 									  PartitionMap *inner_map,
-									  int outer_part,
-									  int inner_part,
+									  int outer_index,
+									  int inner_index,
 									  int *next_index);
 static int	process_outer_partition(PartitionMap *outer_map,
 									PartitionMap *inner_map,
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index de1184ad7..383bc4776 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -414,7 +414,7 @@ static void report_fork_failure_to_client(Port *port, int errnum);
 static CAC_state canAcceptConnections(int backend_type);
 static bool RandomCancelKey(int32 *cancel_key);
 static void signal_child(pid_t pid, int signal);
-static bool SignalSomeChildren(int signal, int targets);
+static bool SignalSomeChildren(int signal, int target);
 static void TerminateChildren(int signal);
 
 #define SignalChildren(sig)			   SignalSomeChildren(sig, BACKEND_TYPE_ALL)
@@ -2598,9 +2598,9 @@ ConnCreate(int serverFd)
  * to do here.
  */
 static void
-ConnFree(Port *conn)
+ConnFree(Port *port)
 {
-	free(conn);
+	free(port);
 }
 
 
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 89cf9f938..7d41aabd5 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -250,7 +250,7 @@ static void ReorderBufferSerializeChange(ReorderBuffer *rb, ReorderBufferTXN *tx
 static Size ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
 										TXNEntryFile *file, XLogSegNo *segno);
 static void ReorderBufferRestoreChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
-									   char *change);
+									   char *data);
 static void ReorderBufferRestoreCleanup(ReorderBuffer *rb, ReorderBufferTXN *txn);
 static void ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn,
 									 bool txn_prepared);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 62e0ffecd..03b13ae67 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 8fec1cb4a..0bd003118 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/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index ee05e230e..ab97e71dd 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -83,7 +83,7 @@ static void statext_store(Oid statOid, bool inh,
 						  MVNDistinct *ndistinct, MVDependencies *dependencies,
 						  MCVList *mcv, Datum exprs, VacAttrStats **stats);
 static int	statext_compute_stattarget(int stattarget,
-									   int natts, VacAttrStats **stats);
+									   int nattrs, VacAttrStats **stats);
 
 /* Information needed to analyze a single simple expression. */
 typedef struct AnlExprData
@@ -99,7 +99,7 @@ static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
 static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
 static AnlExprData *build_expr_data(List *exprs, int stattarget);
 
-static StatsBuildData *make_build_data(Relation onerel, StatExtEntry *stat,
+static StatsBuildData *make_build_data(Relation rel, StatExtEntry *stat,
 									   int numrows, HeapTuple *rows,
 									   VacAttrStats **stats, int stattarget);
 
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e898ffad7..5b0e531f9 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/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 562ac5b43..5f2a4805d 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 3deac496e..9939e6aee 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);
@@ -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/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 43fff50d4..350039cc8 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -32,7 +32,7 @@
 #include "utils/memutils.h"
 #include "utils/tzparser.h"
 
-static int	DecodeNumber(int flen, char *field, bool haveTextMonth,
+static int	DecodeNumber(int flen, char *str, bool haveTextMonth,
 						 int fmask, int *tmask,
 						 struct pg_tm *tm, fsec_t *fsec, bool *is2digits);
 static int	DecodeNumberField(int len, char *str,
@@ -281,26 +281,26 @@ static const datetkn *abbrevcache[MAXDATEFIELDS] = {NULL};
  */
 
 int
-date2j(int y, int m, int d)
+date2j(int year, int month, int day)
 {
 	int			julian;
 	int			century;
 
-	if (m > 2)
+	if (month > 2)
 	{
-		m += 1;
-		y += 4800;
+		month += 1;
+		year += 4800;
 	}
 	else
 	{
-		m += 13;
-		y += 4799;
+		month += 13;
+		year += 4799;
 	}
 
-	century = y / 100;
-	julian = y * 365 - 32167;
-	julian += y / 4 - century + century / 4;
-	julian += 7834 * m / 256 + d;
+	century = year / 100;
+	julian = year * 365 - 32167;
+	julian += year / 4 - century + century / 4;
+	julian += 7834 * month / 256 + day;
 
 	return julian;
 }								/* date2j() */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f1b632ef3..d78002b90 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -90,7 +90,7 @@ static inline float8 line_sl(LINE *line);
 static inline float8 line_invsl(LINE *line);
 static bool line_interpt_line(Point *result, LINE *l1, LINE *l2);
 static bool line_contain_point(LINE *line, Point *point);
-static float8 line_closept_point(Point *result, LINE *line, Point *pt);
+static float8 line_closept_point(Point *result, LINE *line, Point *point);
 
 /* Routines for line segments */
 static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
@@ -98,8 +98,8 @@ static inline float8 lseg_sl(LSEG *lseg);
 static inline float8 lseg_invsl(LSEG *lseg);
 static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line);
 static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2);
-static int	lseg_crossing(float8 x, float8 y, float8 px, float8 py);
-static bool lseg_contain_point(LSEG *lseg, Point *point);
+static int	lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y);
+static bool lseg_contain_point(LSEG *lseg, Point *pt);
 static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt);
 static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line);
 static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg);
@@ -115,7 +115,7 @@ static bool box_contain_point(BOX *box, Point *point);
 static bool box_contain_box(BOX *contains_box, BOX *contained_box);
 static bool box_contain_lseg(BOX *box, LSEG *lseg);
 static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg);
-static float8 box_closept_point(Point *result, BOX *box, Point *point);
+static float8 box_closept_point(Point *result, BOX *box, Point *pt);
 static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg);
 
 /* Routines for circles */
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index 60442758b..e5cc4c945 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -57,14 +57,15 @@ static short padBufferToInt(StringInfo buffer);
 static JsonbIterator *iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent);
 static JsonbIterator *freeAndGetParent(JsonbIterator *it);
 static JsonbParseState *pushState(JsonbParseState **pstate);
-static void appendKey(JsonbParseState *pstate, JsonbValue *scalarVal);
+static void appendKey(JsonbParseState *pstate, JsonbValue *string);
 static void appendValue(JsonbParseState *pstate, JsonbValue *scalarVal);
 static void appendElement(JsonbParseState *pstate, JsonbValue *scalarVal);
 static int	lengthCompareJsonbStringValue(const void *a, const void *b);
 static int	lengthCompareJsonbString(const char *val1, int len1,
 									 const char *val2, int len2);
-static int	lengthCompareJsonbPair(const void *a, const void *b, void *arg);
-static void uniqueifyJsonbObject(JsonbValue *object);
+static int	lengthCompareJsonbPair(const void *a, const void *b, void *binequal);
+static void uniqueifyJsonbObject(JsonbValue *object, bool unique_keys,
+								 bool skip_nulls);
 static JsonbValue *pushJsonbValueScalar(JsonbParseState **pstate,
 										JsonbIteratorToken seq,
 										JsonbValue *scalarVal);
@@ -1394,22 +1395,22 @@ JsonbHashScalarValueExtended(const JsonbValue *scalarVal, uint64 *hash,
  * Are two scalar JsonbValues of the same type a and b equal?
  */
 static bool
-equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+equalsJsonbScalarValue(JsonbValue *a, JsonbValue *b)
 {
-	if (aScalar->type == bScalar->type)
+	if (a->type == b->type)
 	{
-		switch (aScalar->type)
+		switch (a->type)
 		{
 			case jbvNull:
 				return true;
 			case jbvString:
-				return lengthCompareJsonbStringValue(aScalar, bScalar) == 0;
+				return lengthCompareJsonbStringValue(a, b) == 0;
 			case jbvNumeric:
 				return DatumGetBool(DirectFunctionCall2(numeric_eq,
-														PointerGetDatum(aScalar->val.numeric),
-														PointerGetDatum(bScalar->val.numeric)));
+														PointerGetDatum(a->val.numeric),
+														PointerGetDatum(b->val.numeric)));
 			case jbvBool:
-				return aScalar->val.boolean == bScalar->val.boolean;
+				return a->val.boolean == b->val.boolean;
 
 			default:
 				elog(ERROR, "invalid jsonb scalar type");
@@ -1426,28 +1427,28 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
  * operators, where a lexical sort order is generally expected.
  */
 static int
-compareJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+compareJsonbScalarValue(JsonbValue *a, JsonbValue *b)
 {
-	if (aScalar->type == bScalar->type)
+	if (a->type == b->type)
 	{
-		switch (aScalar->type)
+		switch (a->type)
 		{
 			case jbvNull:
 				return 0;
 			case jbvString:
-				return varstr_cmp(aScalar->val.string.val,
-								  aScalar->val.string.len,
-								  bScalar->val.string.val,
-								  bScalar->val.string.len,
+				return varstr_cmp(a->val.string.val,
+								  a->val.string.len,
+								  b->val.string.val,
+								  b->val.string.len,
 								  DEFAULT_COLLATION_OID);
 			case jbvNumeric:
 				return DatumGetInt32(DirectFunctionCall2(numeric_cmp,
-														 PointerGetDatum(aScalar->val.numeric),
-														 PointerGetDatum(bScalar->val.numeric)));
+														 PointerGetDatum(a->val.numeric),
+														 PointerGetDatum(b->val.numeric)));
 			case jbvBool:
-				if (aScalar->val.boolean == bScalar->val.boolean)
+				if (a->val.boolean == b->val.boolean)
 					return 0;
-				else if (aScalar->val.boolean > bScalar->val.boolean)
+				else if (a->val.boolean > b->val.boolean)
 					return 1;
 				else
 					return -1;
@@ -1608,13 +1609,13 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
 }
 
 static void
-convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbArray(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
 {
 	int			base_offset;
 	int			jentry_offset;
 	int			i;
 	int			totallen;
-	uint32		header;
+	uint32		containerhead;
 	int			nElems = val->val.array.nElems;
 
 	/* Remember where in the buffer this array starts. */
@@ -1627,15 +1628,15 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
 	 * Construct the header Jentry and store it in the beginning of the
 	 * variable-length payload.
 	 */
-	header = nElems | JB_FARRAY;
+	containerhead = nElems | JB_FARRAY;
 	if (val->val.array.rawScalar)
 	{
 		Assert(nElems == 1);
 		Assert(level == 0);
-		header |= JB_FSCALAR;
+		containerhead |= JB_FSCALAR;
 	}
 
-	appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+	appendToBuffer(buffer, (char *) &containerhead, sizeof(uint32));
 
 	/* Reserve space for the JEntries of the elements. */
 	jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nElems);
@@ -1688,17 +1689,17 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
 						JENTRY_OFFLENMASK)));
 
 	/* Initialize the header of this node in the container's JEntry array */
-	*pheader = JENTRY_ISCONTAINER | totallen;
+	*header = JENTRY_ISCONTAINER | totallen;
 }
 
 static void
-convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbObject(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
 {
 	int			base_offset;
 	int			jentry_offset;
 	int			i;
 	int			totallen;
-	uint32		header;
+	uint32		containerheader;
 	int			nPairs = val->val.object.nPairs;
 
 	/* Remember where in the buffer this object starts. */
@@ -1711,8 +1712,8 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
 	 * Construct the header Jentry and store it in the beginning of the
 	 * variable-length payload.
 	 */
-	header = nPairs | JB_FOBJECT;
-	appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+	containerheader = nPairs | JB_FOBJECT;
+	appendToBuffer(buffer, (char *) &containerheader, sizeof(uint32));
 
 	/* Reserve space for the JEntries of the keys and values. */
 	jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nPairs * 2);
@@ -1804,11 +1805,11 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
 						JENTRY_OFFLENMASK)));
 
 	/* Initialize the header of this node in the container's JEntry array */
-	*pheader = JENTRY_ISCONTAINER | totallen;
+	*header = JENTRY_ISCONTAINER | totallen;
 }
 
 static void
-convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
+convertJsonbScalar(StringInfo buffer, JEntry *header, JsonbValue *scalarVal)
 {
 	int			numlen;
 	short		padlen;
@@ -1816,13 +1817,13 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
 	switch (scalarVal->type)
 	{
 		case jbvNull:
-			*jentry = JENTRY_ISNULL;
+			*header = JENTRY_ISNULL;
 			break;
 
 		case jbvString:
 			appendToBuffer(buffer, scalarVal->val.string.val, scalarVal->val.string.len);
 
-			*jentry = scalarVal->val.string.len;
+			*header = scalarVal->val.string.len;
 			break;
 
 		case jbvNumeric:
@@ -1831,11 +1832,11 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
 
 			appendToBuffer(buffer, (char *) scalarVal->val.numeric, numlen);
 
-			*jentry = JENTRY_ISNUMERIC | (padlen + numlen);
+			*header = JENTRY_ISNUMERIC | (padlen + numlen);
 			break;
 
 		case jbvBool:
-			*jentry = (scalarVal->val.boolean) ?
+			*header = (scalarVal->val.boolean) ?
 				JENTRY_ISBOOL_TRUE : JENTRY_ISBOOL_FALSE;
 			break;
 
@@ -1851,7 +1852,7 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
 				len = strlen(buf);
 				appendToBuffer(buffer, buf, len);
 
-				*jentry = len;
+				*header = len;
 			}
 			break;
 
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 9f4192e07..9abc0c062 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -225,7 +225,7 @@ static JsonPathExecResult appendBoolResult(JsonPathExecContext *cxt,
 static void getJsonPathItem(JsonPathExecContext *cxt, JsonPathItem *item,
 							JsonbValue *value);
 static void getJsonPathVariable(JsonPathExecContext *cxt,
-								JsonPathItem *variable, Jsonb *vars, JsonbValue *value);
+								JsonPathItem *variable, JsonbValue *value);
 static int	JsonbArraySize(JsonbValue *jb);
 static JsonPathBool executeComparison(JsonPathItem *cmp, JsonbValue *lv,
 									  JsonbValue *rv, void *p);
@@ -252,7 +252,7 @@ static int	JsonbType(JsonbValue *jb);
 static JsonbValue *getScalar(JsonbValue *scalar, enum jbvType type);
 static JsonbValue *wrapItemsInArray(const JsonValueList *items);
 static int	compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
-							bool useTz, bool *have_error);
+							bool useTz, bool *cast_error);
 
 /****************** User interface to JsonPath executor ********************/
 
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 920a63b00..85ee9ec42 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -499,7 +499,7 @@ static void zero_var(NumericVar *var);
 
 static const char *set_var_from_str(const char *str, const char *cp,
 									NumericVar *dest);
-static void set_var_from_num(Numeric value, NumericVar *dest);
+static void set_var_from_num(Numeric num, NumericVar *dest);
 static void init_var_from_num(Numeric num, NumericVar *dest);
 static void set_var_from_var(const NumericVar *value, NumericVar *dest);
 static char *get_str_from_var(const NumericVar *var);
@@ -510,7 +510,7 @@ static void numericvar_deserialize(StringInfo buf, NumericVar *var);
 
 static Numeric duplicate_numeric(Numeric num);
 static Numeric make_result(const NumericVar *var);
-static Numeric make_result_opt_error(const NumericVar *var, bool *error);
+static Numeric make_result_opt_error(const NumericVar *var, bool *have_error);
 
 static void apply_typmod(NumericVar *var, int32 typmod);
 static void apply_typmod_special(Numeric num, int32 typmod);
@@ -591,7 +591,7 @@ static void compute_bucket(Numeric operand, Numeric bound1, Numeric bound2,
 						   const NumericVar *count_var, bool reversed_bounds,
 						   NumericVar *result_var);
 
-static void accum_sum_add(NumericSumAccum *accum, const NumericVar *var1);
+static void accum_sum_add(NumericSumAccum *accum, const NumericVar *val);
 static void accum_sum_rescale(NumericSumAccum *accum, const NumericVar *val);
 static void accum_sum_carry(NumericSumAccum *accum);
 static void accum_sum_reset(NumericSumAccum *accum);
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index aa4c53e0a..b09cb4905 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -55,14 +55,14 @@ typedef struct RangeIOData
 static RangeIOData *get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid,
 									  IOFuncSelector func);
 static char range_parse_flags(const char *flags_str);
-static void range_parse(const char *input_str, char *flags, char **lbound_str,
+static void range_parse(const char *string, char *flags, char **lbound_str,
 						char **ubound_str);
 static const char *range_parse_bound(const char *string, const char *ptr,
 									 char **bound_str, bool *infinite);
 static char *range_deparse(char flags, const char *lbound_str,
 						   const char *ubound_str);
 static char *range_bound_escape(const char *value);
-static Size datum_compute_size(Size sz, Datum datum, bool typbyval,
+static Size datum_compute_size(Size data_length, Datum val, bool typbyval,
 							   char typalign, int16 typlen, char typstorage);
 static Pointer datum_write(Pointer ptr, Datum datum, bool typbyval,
 						   char typalign, int16 typlen, char typstorage);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 51b3fdc9a..1d503e7e0 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -196,7 +196,7 @@ static void ri_GenerateQual(StringInfo buf,
 							Oid opoid,
 							const char *rightop, Oid rightoptype);
 static void ri_GenerateQualCollation(StringInfo buf, Oid collation);
-static int	ri_NullCheck(TupleDesc tupdesc, TupleTableSlot *slot,
+static int	ri_NullCheck(TupleDesc tupDesc, TupleTableSlot *slot,
 						 const RI_ConstraintInfo *riinfo, bool rel_is_pk);
 static void ri_BuildQueryKey(RI_QueryKey *key,
 							 const RI_ConstraintInfo *riinfo,
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 021b760f4..9799647e1 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -2034,9 +2034,9 @@ time2t(const int hour, const int min, const int sec, const fsec_t fsec)
 }
 
 static Timestamp
-dt2local(Timestamp dt, int tz)
+dt2local(Timestamp dt, int timezone)
 {
-	dt -= (tz * USECS_PER_SEC);
+	dt -= (timezone * USECS_PER_SEC);
 	return dt;
 }
 
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index e7345e141..626656860 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -137,7 +137,7 @@ static RelMapFile pending_local_updates;
 
 /* non-export function prototypes */
 static void apply_map_update(RelMapFile *map, Oid relationId,
-							 RelFileNumber filenumber, bool add_okay);
+							 RelFileNumber fileNumber, bool add_okay);
 static void merge_map_updates(RelMapFile *map, const RelMapFile *updates,
 							  bool add_okay);
 static void load_relmap_file(bool shared, bool lock_held);
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 93493d415..25791e23e 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 e00a2ca41..88e0deb5e 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/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5f..6e75acda2 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -45,7 +45,8 @@ int			compute_query_id = COMPUTE_QUERY_ID_AUTO;
 /* True when compute_query_id is ON, or AUTO and a module requests them */
 bool		query_id_enabled = false;
 
-static uint64 compute_utility_query_id(const char *str, int query_location, int query_len);
+static uint64 compute_utility_query_id(const char *query_text,
+									   int query_location, int query_len);
 static void AppendJumble(JumbleState *jstate,
 						 const unsigned char *item, Size size);
 static void JumbleQueryInternal(JumbleState *jstate, Query *query);
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c974..f1f2ddac1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
  * with active refcount=1.  Otherwise, only increment the refcount.
  */
 void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
 {
-	PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+	PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
 }
 
 /*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
  * must not be deeper than the current top of the snapshot stack.
  */
 void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
 {
 	ActiveSnapshotElt *newactive;
 
-	Assert(snap != InvalidSnapshot);
+	Assert(snapshot != InvalidSnapshot);
 	Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
 
 	newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
 	 * Checking SecondarySnapshot is probably useless here, but it seems
 	 * better to be sure.
 	 */
-	if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
-		newactive->as_snap = CopySnapshot(snap);
+	if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+		!snapshot->copied)
+		newactive->as_snap = CopySnapshot(snapshot);
 	else
-		newactive->as_snap = snap;
+		newactive->as_snap = snapshot;
 
 	newactive->as_next = ActiveSnapshot;
 	newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
  * SerializedSnapshotData.
  */
 Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
 {
 	Size		size;
 
-	Assert(snap != InvalidSnapshot);
-	Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+	Assert(snapshot != InvalidSnapshot);
+	Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
 
 	/* We allocate any XID arrays needed in the same palloc block. */
 	size = add_size(sizeof(SerializedSnapshotData),
-					mul_size(snap->xcnt, sizeof(TransactionId)));
-	if (snap->subxcnt > 0 &&
-		(!snap->suboverflowed || snap->takenDuringRecovery))
+					mul_size(snapshot->xcnt, sizeof(TransactionId)));
+	if (snapshot->subxcnt > 0 &&
+		(!snapshot->suboverflowed || snapshot->takenDuringRecovery))
 		size = add_size(size,
-						mul_size(snap->subxcnt, sizeof(TransactionId)));
+						mul_size(snapshot->subxcnt, sizeof(TransactionId)));
 
 	return size;
 }
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index e00837eca..b46ee1098 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -275,7 +275,7 @@ static char *escape_quotes_bki(const char *src);
 static int	locale_date_order(const char *locale);
 static void check_locale_name(int category, const char *locale,
 							  char **canonname);
-static bool check_locale_encoding(const char *locale, int encoding);
+static bool check_locale_encoding(const char *locale, int user_enc);
 static void setlocales(void);
 static void usage(const char *progname);
 void		setup_pgdata(void);
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index f064cff4a..0afc79413 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -63,7 +63,7 @@ static DIR *get_destination_dir(char *dest_folder);
 static void close_destination_dir(DIR *dest_dir, char *dest_folder);
 static XLogRecPtr FindStreamingStart(uint32 *tli);
 static void StreamLog(void);
-static bool stop_streaming(XLogRecPtr segendpos, uint32 timeline,
+static bool stop_streaming(XLogRecPtr xlogpos, uint32 timeline,
 						   bool segment_finished);
 
 static void
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 8638f81f3..1537ef47e 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -44,7 +44,7 @@ extern bool RunIdentifySystem(PGconn *conn, char **sysid,
 
 extern void AppendPlainCommandOption(PQExpBuffer buf,
 									 bool use_new_option_syntax,
-									 char *option_value);
+									 char *option_name);
 extern void AppendStringCommandOption(PQExpBuffer buf,
 									  bool use_new_option_syntax,
 									  char *option_name, char *option_value);
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
index 54a853bd4..e6277c463 100644
--- a/src/bin/pg_rewind/file_ops.h
+++ b/src/bin/pg_rewind/file_ops.h
@@ -17,8 +17,8 @@ extern void write_target_range(char *buf, off_t begin, size_t size);
 extern void close_target_file(void);
 extern void remove_target_file(const char *path, bool missing_ok);
 extern void truncate_target_file(const char *path, off_t newsize);
-extern void create_target(file_entry_t *t);
-extern void remove_target(file_entry_t *t);
+extern void create_target(file_entry_t *entry);
+extern void remove_target(file_entry_t *entry);
 extern void sync_target_dir(void);
 
 extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index 8b4b50a33..80c276285 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -37,7 +37,7 @@ extern uint64 fetch_done;
 extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
 						   int tliIndex, XLogRecPtr endpoint,
 						   const char *restoreCommand);
-extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
+extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
 							   int tliIndex,
 							   XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
 							   XLogRecPtr *lastchkptredo,
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 53ea348e2..f18cf9712 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -23,7 +23,7 @@ static void free_db_and_rel_infos(DbInfoArr *db_arr);
 static void get_db_infos(ClusterInfo *cluster);
 static void get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo);
 static void free_rel_infos(RelInfoArr *rel_arr);
-static void print_db_infos(DbInfoArr *dbinfo);
+static void print_db_infos(DbInfoArr *db_arr);
 static void print_rel_infos(RelInfoArr *rel_arr);
 
 
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 63d02719a..2c0d285de 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -134,7 +134,7 @@ static void verify_backup_file(verifier_context *context,
 static void report_extra_backup_files(verifier_context *context);
 static void verify_backup_checksums(verifier_context *context);
 static void verify_file_checksum(verifier_context *context,
-								 manifest_file *m, char *pathname);
+								 manifest_file *m, char *fullpath);
 static void parse_required_wal(verifier_context *context,
 							   char *pg_waldump_path,
 							   char *wal_directory,
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index abbdc443a..40903bc16 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -158,10 +158,10 @@ extern char *expr_scanner_get_substring(PsqlScanState state,
 extern int	expr_scanner_get_lineno(PsqlScanState state, int offset);
 
 extern void syntax_error(const char *source, int lineno, const char *line,
-						 const char *cmd, const char *msg,
-						 const char *more, int col) pg_attribute_noreturn();
+						 const char *command, const char *msg,
+						 const char *more, int column) pg_attribute_noreturn();
 
-extern bool strtoint64(const char *str, bool errorOK, int64 *pi);
-extern bool strtodouble(const char *str, bool errorOK, double *pd);
+extern bool strtoint64(const char *str, bool errorOK, int64 *result);
+extern bool strtodouble(const char *str, bool errorOK, double *dv);
 
 #endif							/* PGBENCH_H */
diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h
index 7872c71f5..bd051e09c 100644
--- a/src/bin/psql/describe.h
+++ b/src/bin/psql/describe.h
@@ -127,16 +127,16 @@ bool		describeSubscriptions(const char *pattern, bool verbose);
 
 /* \dAc */
 extern bool listOperatorClasses(const char *access_method_pattern,
-								const char *opclass_pattern,
+								const char *type_pattern,
 								bool verbose);
 
 /* \dAf */
 extern bool listOperatorFamilies(const char *access_method_pattern,
-								 const char *opclass_pattern,
+								 const char *type_pattern,
 								 bool verbose);
 
 /* \dAo */
-extern bool listOpFamilyOperators(const char *accessMethod_pattern,
+extern bool listOpFamilyOperators(const char *access_method_pattern,
 								  const char *family_pattern, bool verbose);
 
 /* \dAp */
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 84a1be72f..9d91ad87c 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -18,7 +18,7 @@
 extern void splitTableColumnsSpec(const char *spec, int encoding,
 								  char **table, const char **columns);
 
-extern void appendQualifiedRelation(PQExpBuffer buf, const char *name,
+extern void appendQualifiedRelation(PQExpBuffer buf, const char *spec,
 									PGconn *conn, bool echo);
 
 extern bool yesno_prompt(const char *question);
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 917b19e0e..746e9b4f1 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
 static void release_conn_addrinfo(PGconn *conn);
 static void sendTerminateConn(PGconn *conn);
 static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
-static PQconninfoOption *parse_connection_string(const char *conninfo,
+static PQconninfoOption *parse_connection_string(const char *connstr,
 												 PQExpBuffer errorMessage, bool use_defaults);
 static int	uri_prefix_length(const char *connstr);
 static bool recognized_connection_string(const char *connstr);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f5..ca0b184af 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2808,7 +2808,7 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
  * PQgetline - gets a newline-terminated string from the backend.
  *
  * Chiefly here so that applications can use "COPY <rel> to stdout"
- * and read the output string.  Returns a null-terminated string in s.
+ * and read the output string.  Returns a null-terminated string in 'string'.
  *
  * XXX this routine is now deprecated, because it can't handle binary data.
  * If called during a COPY BINARY we return EOF.
@@ -2828,11 +2828,11 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
  *		1 in other cases (i.e., the buffer was filled before \n is reached)
  */
 int
-PQgetline(PGconn *conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *string, int maxlen)
 {
-	if (!s || maxlen <= 0)
+	if (!string || maxlen <= 0)
 		return EOF;
-	*s = '\0';
+	*string = '\0';
 	/* maxlen must be at least 3 to hold the \. terminator! */
 	if (maxlen < 3)
 		return EOF;
@@ -2840,7 +2840,7 @@ PQgetline(PGconn *conn, char *s, int maxlen)
 	if (!conn)
 		return EOF;
 
-	return pqGetline3(conn, s, maxlen);
+	return pqGetline3(conn, string, maxlen);
 }
 
 /*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
  * send failure.
  */
 int
-PQputline(PGconn *conn, const char *s)
+PQputline(PGconn *conn, const char *string)
 {
-	return PQputnbytes(conn, s, strlen(s));
+	return PQputnbytes(conn, string, strlen(string));
 }
 
 /*
diff --git a/src/interfaces/libpq/fe-secure-common.h b/src/interfaces/libpq/fe-secure-common.h
index d18db7138..415a93898 100644
--- a/src/interfaces/libpq/fe-secure-common.h
+++ b/src/interfaces/libpq/fe-secure-common.h
@@ -22,8 +22,8 @@ extern int	pq_verify_peer_name_matches_certificate_name(PGconn *conn,
 														 const char *namedata, size_t namelen,
 														 char **store_name);
 extern int	pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
-													   const unsigned char *addrdata,
-													   size_t addrlen,
+													   const unsigned char *ipdata,
+													   size_t iplen,
 													   char **store_name);
 extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);
 
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 7986445f1..f7a5db4c2 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -483,7 +483,7 @@ extern int	PQputCopyEnd(PGconn *conn, const char *errormsg);
 extern int	PQgetCopyData(PGconn *conn, char **buffer, int async);
 
 /* Deprecated routines for copy in/out */
-extern int	PQgetline(PGconn *conn, char *string, int length);
+extern int	PQgetline(PGconn *conn, char *string, int maxlen);
 extern int	PQputline(PGconn *conn, const char *string);
 extern int	PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
 extern int	PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
 
 extern void PQprint(FILE *fout, /* output stream */
 					const PGresult *res,
-					const PQprintOpt *ps);	/* option structure */
+					const PQprintOpt *po);	/* option structure */
 
 /*
  * really old printing routines
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7bd2a9fff..a64734294 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -374,7 +374,7 @@ static ParamListInfo setup_param_list(PLpgSQL_execstate *estate,
 									  PLpgSQL_expr *expr);
 static ParamExternData *plpgsql_param_fetch(ParamListInfo params,
 											int paramid, bool speculative,
-											ParamExternData *workspace);
+											ParamExternData *prm);
 static void plpgsql_param_compile(ParamListInfo params, Param *param,
 								  ExprState *state,
 								  Datum *resv, bool *resnull);
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
  * ScanKeywordLookup(), except we want case-sensitive matching.
  */
 int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
 {
 	size_t		len;
 	int			h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
 	 * Reject immediately if too long to be any keyword.  This saves useless
 	 * hashing work on long strings.
 	 */
-	len = strlen(str);
+	len = strlen(text);
 	if (len > ScanCKeywords.max_kw_len)
 		return -1;
 
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
 	 * Compute the hash function.  Since it's a perfect hash, we need only
 	 * match to the specific keyword it identifies.
 	 */
-	h = ScanCKeywords_hash_func(str, len);
+	h = ScanCKeywords_hash_func(text, len);
 
 	/* An out-of-range result implies no match */
 	if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
 
 	kw = GetScanKeyword(h, &ScanCKeywords);
 
-	if (strcmp(kw, str) == 0)
+	if (strcmp(kw, text) == 0)
 		return ScanCKeywordTokens[h];
 
 	return -1;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
 
 #include "preproc_extern.h"
 
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
 
 void
 output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..732556a0a 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -75,8 +75,8 @@ extern int	base_yylex(void);
 extern void base_yyerror(const char *);
 extern void *mm_alloc(size_t);
 extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
 extern void output_get_descr_header(char *);
 extern void output_get_descr(char *, char *);
 extern void output_set_descr_header(char *);
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 0ea6ead2d..10d5499ec 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -128,11 +128,11 @@ static void leapadd(zic_t, int, int);
 static void adjleap(void);
 static void associate(void);
 static void dolink(const char *, const char *, bool);
-static char **getfields(char *buf);
+static char **getfields(char *cp);
 static zic_t gethms(const char *string, const char *errstring);
 static zic_t getsave(char *, bool *);
 static void inexpires(char **, int);
-static void infile(const char *filename);
+static void infile(const char *name);
 static void inleap(char **fields, int nfields);
 static void inlink(char **fields, int nfields);
 static void inrule(char **fields, int nfields);
@@ -144,9 +144,9 @@ static bool itssymlink(char const *);
 static bool is_alpha(char a);
 static char lowerit(char);
 static void mkdirs(char const *, bool);
-static void newabbr(const char *abbr);
+static void newabbr(const char *string);
 static zic_t oadd(zic_t t1, zic_t t2);
-static void outzone(const struct zone *zp, ptrdiff_t ntzones);
+static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount);
 static zic_t rpytime(const struct rule *rp, zic_t wantedy);
 static void rulesub(struct rule *rp,
 					const char *loyearp, const char *hiyearp,
@@ -304,8 +304,8 @@ struct lookup
 	const int	l_value;
 };
 
-static struct lookup const *byword(const char *string,
-								   const struct lookup *lp);
+static struct lookup const *byword(const char *word,
+								   const struct lookup *table);
 
 static struct lookup const zi_line_codes[] = {
 	{"Rule", LC_RULE},
-- 
2.34.1

