diff --git a/contrib/earthdistance/earthdistance--1.1.sql b/contrib/earthdistance/earthdistance--1.1.sql
index 9136a54a7b..543338aff3 100644
--- a/contrib/earthdistance/earthdistance--1.1.sql
+++ b/contrib/earthdistance/earthdistance--1.1.sql
@@ -28,7 +28,7 @@ AS 'SELECT ''6378168''::float8';
 -- centered about the origin with the radius of the earth.
 
 CREATE DOMAIN earth AS cube
-  CONSTRAINT not_point check(cube_is_point(value))
+  CONSTRAINT is_point check(cube_is_point(value))
   CONSTRAINT not_3d check(cube_dim(value) <= 3)
   CONSTRAINT on_surface check(abs(cube_distance(value, '(0)'::cube) /
   earth() - 1) < '10e-7'::float8);
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 033aeb2556..06a205877d 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -2794,7 +2794,7 @@ estimate_path_cost_size(PlannerInfo *root,
 
 			/*
 			 * Back into an estimate of the number of retrieved rows.  Just in
-			 * case this is nuts, clamp to at most nrow.
+			 * case this is nuts, clamp to at most nrows.
 			 */
 			retrieved_rows = clamp_row_est(rows / fpinfo->local_conds_sel);
 			retrieved_rows = Min(retrieved_rows, nrows);
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index 64dfe06b26..a08922b079 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -124,7 +124,7 @@
 
 /* prototypes for internal routines */
 static Buffer vm_readbuf(Relation rel, BlockNumber blkno, bool extend);
-static void vm_extend(Relation rel, BlockNumber nvmblocks);
+static void vm_extend(Relation rel, BlockNumber vm_nblocks);
 
 
 /*
diff --git a/src/backend/access/transam/README b/src/backend/access/transam/README
index ad4083eb6b..b5a2cb2de8 100644
--- a/src/backend/access/transam/README
+++ b/src/backend/access/transam/README
@@ -530,7 +530,7 @@ void XLogResetInsertion(void)
     construction workspace.  This is only needed if you have already called
     XLogBeginInsert(), but decide to not insert the record after all.
 
-void XLogEnsureRecordSpace(int max_block_id, int nrdatas)
+void XLogEnsureRecordSpace(int max_block_id, int ndatas)
 
     Normally, the WAL record construction buffers have the following limits:
 
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 0e1015962d..20abbb3b55 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -134,7 +134,7 @@ LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright,
 /*
  * LookupOperWithArgs
  *		Like LookupOperName, but the argument types are specified by
- *		a ObjectWithArg node.
+ *		a ObjectWithArgs node.
  */
 Oid
 LookupOperWithArgs(ObjectWithArgs *oper, bool noError)
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index e8ffa0492f..5fa3d7323e 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -1381,7 +1381,7 @@ ReorderBufferCopySnap(ReorderBuffer *rb, Snapshot orig_snap,
 	snap->subxip[i++] = txn->xid;
 
 	/*
-	 * nsubxcnt isn't decreased when subtransactions abort, so count manually.
+	 * subxcnt isn't decreased when subtransactions abort, so count manually.
 	 * Since it's an upper boundary it is safe to use it for the allocation
 	 * above.
 	 */
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 1b7053cb1c..98bb6921a3 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -995,9 +995,9 @@ LockAcquireExtended(const LOCKTAG *locktag,
 		Assert(status == STATUS_FOUND);
 
 		/*
-		 * We can't acquire the lock immediately.  If caller specified no
-		 * blocking, remove useless table entries and return NOT_AVAIL without
-		 * waiting.
+		 * We can't acquire the lock immediately.  If caller specified
+		 * no blocking, remove useless table entries and return
+		 * LOCKACQUIRE_NOT_AVAIL without waiting.
 		 */
 		if (dontWait)
 		{
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index afb3e15721..cd83f5fe8f 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -443,7 +443,7 @@ extern void ginInsertCleanup(GinState *ginstate, bool full_clean,
 
 /* ginpostinglist.c */
 
-extern GinPostingList *ginCompressPostingList(const ItemPointer ptrs, int nptrs,
+extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
 											  int maxsize, int *nwritten);
 extern int	ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm);
 
diff --git a/src/include/access/xloginsert.h b/src/include/access/xloginsert.h
index df24089ea4..eeb0412b66 100644
--- a/src/include/access/xloginsert.h
+++ b/src/include/access/xloginsert.h
@@ -42,7 +42,7 @@
 extern void XLogBeginInsert(void);
 extern void XLogSetRecordFlags(uint8 flags);
 extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info);
-extern void XLogEnsureRecordSpace(int nbuffers, int ndatas);
+extern void XLogEnsureRecordSpace(int max_block_id, int ndatas);
 extern void XLogRegisterData(char *data, int len);
 extern void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags);
 extern void XLogRegisterBlock(uint8 block_id, RelFileNode *rnode,
diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
index c724430aec..02fc17d7c0 100644
--- a/src/include/commands/extension.h
+++ b/src/include/commands/extension.h
@@ -43,7 +43,7 @@ extern ObjectAddress InsertExtensionTuple(const char *extName, Oid extOwner,
 extern ObjectAddress ExecAlterExtensionStmt(ParseState *pstate, AlterExtensionStmt *stmt);
 
 extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
-													ObjectAddress *objAddress);
+													ObjectAddress *objAddr);
 
 extern Oid	get_extension_oid(const char *extname, bool missing_ok);
 extern char *get_extension_name(Oid ext_oid);
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index c27fb456d0..7a5a313c5f 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -146,7 +146,7 @@ static char lowerit(char);
 static void mkdirs(char const *, bool);
 static void newabbr(const char *abbr);
 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,
