Skip to content

Commit a6cab6a

Browse files
Harmonize function parameter names for Postgres 18.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in a few places. These inconsistencies were all introduced during Postgres 18 development. This commit was written with help from clang-tidy, by mechanically applying the same rules as similar clean-up commits (the earliest such commit was commit 035ce1f).
1 parent fdb69dd commit a6cab6a

File tree

27 files changed

+45
-51
lines changed

27 files changed

+45
-51
lines changed

contrib/pg_overexplain/pg_overexplain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void overexplain_alias(const char *qlabel, Alias *alias,
5454
ExplainState *es);
5555
static void overexplain_bitmapset(const char *qlabel, Bitmapset *bms,
5656
ExplainState *es);
57-
static void overexplain_intlist(const char *qlabel, List *intlist,
57+
static void overexplain_intlist(const char *qlabel, List *list,
5858
ExplainState *es);
5959

6060
static int es_extension_id;

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static void adjust_foreign_grouping_path_cost(PlannerInfo *root,
444444
double retrieved_rows,
445445
double width,
446446
double limit_tuples,
447-
int *disabled_nodes,
447+
int *p_disabled_nodes,
448448
Cost *p_startup_cost,
449449
Cost *p_run_cost);
450450
static bool ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel,

src/backend/access/gin/gininsert.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ static void _gin_begin_parallel(GinBuildState *buildstate, Relation heap, Relati
180180
bool isconcurrent, int request);
181181
static void _gin_end_parallel(GinLeader *ginleader, GinBuildState *state);
182182
static Size _gin_parallel_estimate_shared(Relation heap, Snapshot snapshot);
183-
static double _gin_parallel_heapscan(GinBuildState *buildstate);
184-
static double _gin_parallel_merge(GinBuildState *buildstate);
183+
static double _gin_parallel_heapscan(GinBuildState *state);
184+
static double _gin_parallel_merge(GinBuildState *state);
185185
static void _gin_leader_participate_as_worker(GinBuildState *buildstate,
186186
Relation heap, Relation index);
187-
static void _gin_parallel_scan_and_build(GinBuildState *buildstate,
187+
static void _gin_parallel_scan_and_build(GinBuildState *state,
188188
GinBuildShared *ginshared,
189189
Sharedsort *sharedsort,
190190
Relation heap, Relation index,

src/backend/commands/tablecmds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static bool ATExecAlterConstraintInternal(List **wqueue, ATAlterConstraint *cmdc
397397
bool recurse, LOCKMODE lockmode);
398398
static bool ATExecAlterConstrEnforceability(List **wqueue, ATAlterConstraint *cmdcon,
399399
Relation conrel, Relation tgrel,
400-
const Oid fkrelid, const Oid pkrelid,
400+
Oid fkrelid, Oid pkrelid,
401401
HeapTuple contuple, LOCKMODE lockmode,
402402
Oid ReferencedParentDelTrigger,
403403
Oid ReferencedParentUpdTrigger,
@@ -415,7 +415,7 @@ static void AlterConstrTriggerDeferrability(Oid conoid, Relation tgrel, Relation
415415
List **otherrelids);
416416
static void AlterConstrEnforceabilityRecurse(List **wqueue, ATAlterConstraint *cmdcon,
417417
Relation conrel, Relation tgrel,
418-
const Oid fkrelid, const Oid pkrelid,
418+
Oid fkrelid, Oid pkrelid,
419419
HeapTuple contuple, LOCKMODE lockmode,
420420
Oid ReferencedParentDelTrigger,
421421
Oid ReferencedParentUpdTrigger,
@@ -503,7 +503,7 @@ static ObjectAddress ATExecDropNotNull(Relation rel, const char *colName, bool r
503503
static void set_attnotnull(List **wqueue, Relation rel, AttrNumber attnum,
504504
bool is_valid, bool queue_validation);
505505
static ObjectAddress ATExecSetNotNull(List **wqueue, Relation rel,
506-
char *constrname, char *colName,
506+
char *conName, char *colName,
507507
bool recurse, bool recursing,
508508
LOCKMODE lockmode);
509509
static bool NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr);
@@ -733,7 +733,7 @@ static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
733733
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
734734
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
735735
Relation partitionTbl);
736-
static void verifyPartitionIndexNotNull(IndexInfo *iinfo, Relation partIdx);
736+
static void verifyPartitionIndexNotNull(IndexInfo *iinfo, Relation partition);
737737
static List *GetParentedForeignKeyRefs(Relation partition);
738738
static void ATDetachCheckNoForeignKeyRefs(Relation partition);
739739
static char GetAttributeCompression(Oid atttypid, const char *compression);

src/backend/executor/execPartition.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void InitPartitionPruneContext(PartitionPruneContext *context,
191191
PartitionKey partkey,
192192
PlanState *planstate,
193193
ExprContext *econtext);
194-
static void InitExecPartitionPruneContexts(PartitionPruneState *prunstate,
194+
static void InitExecPartitionPruneContexts(PartitionPruneState *prunestate,
195195
PlanState *parent_plan,
196196
Bitmapset *initially_valid_subplans,
197197
int n_total_subplans);

src/backend/nodes/queryjumblefuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ bool query_id_enabled = false;
5858
static JumbleState *InitJumble(void);
5959
static uint64 DoJumble(JumbleState *jstate, Node *node);
6060
static void AppendJumble(JumbleState *jstate,
61-
const unsigned char *item, Size size);
61+
const unsigned char *value, Size size);
6262
static void FlushPendingNulls(JumbleState *jstate);
6363
static void RecordConstLocation(JumbleState *jstate,
64-
int location, bool merged);
64+
int location, bool squashed);
6565
static void _jumbleNode(JumbleState *jstate, Node *node);
6666
static void _jumbleElements(JumbleState *jstate, List *elements);
6767
static void _jumbleA_Const(JumbleState *jstate, Node *node);

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static inline BufferDesc *BufferAlloc(SMgrRelation smgr,
527527
BlockNumber blockNum,
528528
BufferAccessStrategy strategy,
529529
bool *foundPtr, IOContext io_context);
530-
static bool AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks);
530+
static bool AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks_progress);
531531
static void CheckReadBuffersOperation(ReadBuffersOperation *operation, bool is_complete);
532532
static Buffer GetVictimBuffer(BufferAccessStrategy strategy, IOContext io_context);
533533
static void FlushBuffer(BufferDesc *buf, SMgrRelation reln,

src/backend/storage/smgr/md.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
154154
MdfdVec *seg);
155155

156156
static PgAioResult md_readv_complete(PgAioHandle *ioh, PgAioResult prior_result, uint8 cb_data);
157-
static void md_readv_report(PgAioResult result, const PgAioTargetData *target_data, int elevel);
157+
static void md_readv_report(PgAioResult result, const PgAioTargetData *td, int elevel);
158158

159159
const PgAioHandleCallbacks aio_md_readv_cb = {
160160
.complete_shared = md_readv_complete,

src/backend/utils/adt/acl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static AclMode convert_tablespace_priv_string(text *priv_type_text);
127127
static Oid convert_type_name(text *typename);
128128
static AclMode convert_type_priv_string(text *priv_type_text);
129129
static AclMode convert_parameter_priv_string(text *priv_text);
130-
static AclMode convert_largeobject_priv_string(text *priv_text);
130+
static AclMode convert_largeobject_priv_string(text *priv_type_text);
131131
static AclMode convert_role_priv_string(text *priv_type_text);
132132
static AclResult pg_role_aclcheck(Oid role_oid, Oid roleid, AclMode mode);
133133

src/backend/utils/adt/pg_locale_builtin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
extern pg_locale_t create_pg_locale_builtin(Oid collid,
2626
MemoryContext context);
2727
extern char *get_collation_actual_version_builtin(const char *collcollate);
28-
extern size_t strlower_builtin(char *dst, size_t dstsize, const char *src,
28+
extern size_t strlower_builtin(char *dest, size_t destsize, const char *src,
2929
ssize_t srclen, pg_locale_t locale);
30-
extern size_t strtitle_builtin(char *dst, size_t dstsize, const char *src,
30+
extern size_t strtitle_builtin(char *dest, size_t destsize, const char *src,
3131
ssize_t srclen, pg_locale_t locale);
32-
extern size_t strupper_builtin(char *dst, size_t dstsize, const char *src,
32+
extern size_t strupper_builtin(char *dest, size_t destsize, const char *src,
3333
ssize_t srclen, pg_locale_t locale);
34-
extern size_t strfold_builtin(char *dst, size_t dstsize, const char *src,
34+
extern size_t strfold_builtin(char *dest, size_t destsize, const char *src,
3535
ssize_t srclen, pg_locale_t locale);
3636

3737

src/backend/utils/adt/pg_locale_icu.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,22 @@
4848
#define TEXTBUFLEN 1024
4949

5050
extern pg_locale_t create_pg_locale_icu(Oid collid, MemoryContext context);
51-
extern size_t strlower_icu(char *dst, size_t dstsize, const char *src,
51+
extern size_t strlower_icu(char *dest, size_t destsize, const char *src,
5252
ssize_t srclen, pg_locale_t locale);
53-
extern size_t strtitle_icu(char *dst, size_t dstsize, const char *src,
53+
extern size_t strtitle_icu(char *dest, size_t destsize, const char *src,
5454
ssize_t srclen, pg_locale_t locale);
55-
extern size_t strupper_icu(char *dst, size_t dstsize, const char *src,
55+
extern size_t strupper_icu(char *dest, size_t destsize, const char *src,
5656
ssize_t srclen, pg_locale_t locale);
57-
extern size_t strfold_icu(char *dst, size_t dstsize, const char *src,
57+
extern size_t strfold_icu(char *dest, size_t destsize, const char *src,
5858
ssize_t srclen, pg_locale_t locale);
5959

6060
#ifdef USE_ICU
6161

6262
extern UCollator *pg_ucol_open(const char *loc_str);
6363

64-
static int strncoll_icu(const char *arg1, ssize_t len1,
65-
const char *arg2, ssize_t len2,
66-
pg_locale_t locale);
6764
static size_t strnxfrm_icu(char *dest, size_t destsize,
6865
const char *src, ssize_t srclen,
6966
pg_locale_t locale);
70-
static size_t strnxfrm_prefix_icu(char *dest, size_t destsize,
71-
const char *src, ssize_t srclen,
72-
pg_locale_t locale);
7367
extern char *get_collation_actual_version_icu(const char *collcollate);
7468

7569
typedef int32_t (*ICU_Convert_Func) (UChar *dest, int32_t destCapacity,

src/backend/utils/mmgr/mcxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void MemoryContextStatsInternal(MemoryContext context, int level,
184184
static void MemoryContextStatsPrint(MemoryContext context, void *passthru,
185185
const char *stats_string,
186186
bool print_to_stderr);
187-
static void PublishMemoryContext(MemoryStatsEntry *memcxt_infos,
187+
static void PublishMemoryContext(MemoryStatsEntry *memcxt_info,
188188
int curr_id, MemoryContext context,
189189
List *path,
190190
MemoryContextCounters stat,

src/bin/scripts/reindexdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void gen_reindex_command(PGconn *conn, ReindexType type,
6060
PQExpBufferData *sql);
6161
static void run_reindex_command(PGconn *conn, ReindexType type,
6262
const char *name, bool echo,
63-
PQExpBufferData *sq);
63+
PQExpBufferData *sql);
6464

6565
static void help(const char *progname);
6666

src/common/unicode_case.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static size_t convert_case(char *dst, size_t dstsize, const char *src, ssize_t s
4444
void *wbstate);
4545
static enum CaseMapResult casemap(pg_wchar u1, CaseKind casekind, bool full,
4646
const char *src, size_t srclen, size_t srcoff,
47-
pg_wchar *u2, const pg_wchar **special);
47+
pg_wchar *simple, const pg_wchar **special);
4848

4949
pg_wchar
5050
unicode_lowercase_simple(pg_wchar code)

src/include/commands/explain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
6464
ParamListInfo params);
6565

6666
extern void ExplainOnePlan(PlannedStmt *plannedstmt, CachedPlan *cplan,
67-
CachedPlanSource *plansource, int plan_index,
67+
CachedPlanSource *plansource, int query_index,
6868
IntoClause *into, struct ExplainState *es,
6969
const char *queryString,
7070
ParamListInfo params, QueryEnvironment *queryEnv,

src/include/libpq/oauth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ extern PGDLLIMPORT const pg_be_sasl_mech pg_be_oauth_mech;
9696
/*
9797
* Ensure a validator named in the HBA is permitted by the configuration.
9898
*/
99-
extern bool check_oauth_validator(HbaLine *hba, int elevel, char **err_msg);
99+
extern bool check_oauth_validator(HbaLine *hbaline, int elevel, char **err_msg);
100100

101101
#endif /* PG_OAUTH_H */

src/include/optimizer/cost.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extern void cost_resultscan(Path *path, PlannerInfo *root,
108108
RelOptInfo *baserel, ParamPathInfo *param_info);
109109
extern void cost_recursive_union(Path *runion, Path *nrterm, Path *rterm);
110110
extern void cost_sort(Path *path, PlannerInfo *root,
111-
List *pathkeys, int disabled_nodes,
111+
List *pathkeys, int input_disabled_nodes,
112112
Cost input_cost, double tuples, int width,
113113
Cost comparison_cost, int sort_mem,
114114
double limit_tuples);
@@ -132,7 +132,7 @@ extern void cost_agg(Path *path, PlannerInfo *root,
132132
AggStrategy aggstrategy, const AggClauseCosts *aggcosts,
133133
int numGroupCols, double numGroups,
134134
List *quals,
135-
int input_disabled_nodes,
135+
int disabled_nodes,
136136
Cost input_startup_cost, Cost input_total_cost,
137137
double input_tuples, double input_width);
138138
extern void cost_windowagg(Path *path, PlannerInfo *root,

src/include/optimizer/planmain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ extern bool innerrel_is_unique(PlannerInfo *root,
117117
extern bool innerrel_is_unique_ext(PlannerInfo *root, Relids joinrelids,
118118
Relids outerrelids, RelOptInfo *innerrel,
119119
JoinType jointype, List *restrictlist,
120-
bool force_cache, List **uclauses);
121-
extern List *remove_useless_self_joins(PlannerInfo *root, List *jointree);
120+
bool force_cache, List **extra_clauses);
121+
extern List *remove_useless_self_joins(PlannerInfo *root, List *joinlist);
122122

123123
/*
124124
* prototypes for plan/setrefs.c

src/include/port/pg_crc32c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extern pg_crc32c pg_comp_crc32c_sb8(pg_crc32c crc, const void *data, size_t len)
107107
extern PGDLLIMPORT pg_crc32c (*pg_comp_crc32c) (pg_crc32c crc, const void *data, size_t len);
108108
extern pg_crc32c pg_comp_crc32c_sse42(pg_crc32c crc, const void *data, size_t len);
109109
#ifdef USE_AVX512_CRC32C_WITH_RUNTIME_CHECK
110-
extern pg_crc32c pg_comp_crc32c_avx512(pg_crc32c crc, const void *data, size_t len);
110+
extern pg_crc32c pg_comp_crc32c_avx512(pg_crc32c crc, const void *data, size_t length);
111111
#endif
112112

113113
#elif defined(USE_ARMV8_CRC32C)

src/include/replication/slot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ extern void CheckPointReplicationSlots(bool is_shutdown);
307307
extern void CheckSlotRequirements(void);
308308
extern void CheckSlotPermissions(void);
309309
extern ReplicationSlotInvalidationCause
310-
GetSlotInvalidationCause(const char *invalidation_reason);
310+
GetSlotInvalidationCause(const char *cause_name);
311311
extern const char *GetSlotInvalidationCauseName(ReplicationSlotInvalidationCause cause);
312312

313313
extern bool SlotExistsInSyncStandbySlots(const char *slot_name);

src/include/storage/lwlock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ extern bool LWLockAcquireOrWait(LWLock *lock, LWLockMode mode);
129129
extern void LWLockRelease(LWLock *lock);
130130
extern void LWLockReleaseClearVar(LWLock *lock, pg_atomic_uint64 *valptr, uint64 val);
131131
extern void LWLockReleaseAll(void);
132-
extern void LWLockDisown(LWLock *l);
133-
extern void LWLockReleaseDisowned(LWLock *l, LWLockMode mode);
132+
extern void LWLockDisown(LWLock *lock);
133+
extern void LWLockReleaseDisowned(LWLock *lock, LWLockMode mode);
134134
extern bool LWLockHeldByMe(LWLock *lock);
135135
extern bool LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride);
136136
extern bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode);

src/include/storage/md.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extern void mdwriteback(SMgrRelation reln, ForkNumber forknum,
4949
BlockNumber blocknum, BlockNumber nblocks);
5050
extern BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum);
5151
extern void mdtruncate(SMgrRelation reln, ForkNumber forknum,
52-
BlockNumber old_blocks, BlockNumber nblocks);
52+
BlockNumber curnblk, BlockNumber nblocks);
5353
extern void mdimmedsync(SMgrRelation reln, ForkNumber forknum);
5454
extern void mdregistersync(SMgrRelation reln, ForkNumber forknum);
5555
extern int mdfd(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, uint32 *off);

src/include/utils/pg_locale.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,16 @@ extern void init_database_collation(void);
125125
extern pg_locale_t pg_newlocale_from_collation(Oid collid);
126126

127127
extern char *get_collation_actual_version(char collprovider, const char *collcollate);
128-
extern size_t pg_strlower(char *dest, size_t destsize,
128+
extern size_t pg_strlower(char *dst, size_t dstsize,
129129
const char *src, ssize_t srclen,
130130
pg_locale_t locale);
131-
extern size_t pg_strtitle(char *dest, size_t destsize,
131+
extern size_t pg_strtitle(char *dst, size_t dstsize,
132132
const char *src, ssize_t srclen,
133133
pg_locale_t locale);
134-
extern size_t pg_strupper(char *dest, size_t destsize,
134+
extern size_t pg_strupper(char *dst, size_t dstsize,
135135
const char *src, ssize_t srclen,
136136
pg_locale_t locale);
137-
extern size_t pg_strfold(char *dest, size_t destsize,
137+
extern size_t pg_strfold(char *dst, size_t dstsize,
138138
const char *src, ssize_t srclen,
139139
pg_locale_t locale);
140140
extern int pg_strcoll(const char *arg1, const char *arg2, pg_locale_t locale);

src/include/utils/tuplestore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extern void tuplestore_copy_read_pointer(Tuplestorestate *state,
6565

6666
extern void tuplestore_trim(Tuplestorestate *state);
6767

68-
extern void tuplestore_get_stats(Tuplestorestate *state, char **storage_type,
68+
extern void tuplestore_get_stats(Tuplestorestate *state, char **max_storage_type,
6969
int64 *max_space);
7070

7171
extern bool tuplestore_in_memory(Tuplestorestate *state);

src/test/modules/oauth_validator/fail_validator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PG_MODULE_MAGIC;
2222
static bool fail_token(const ValidatorModuleState *state,
2323
const char *token,
2424
const char *role,
25-
ValidatorModuleResult *result);
25+
ValidatorModuleResult *res);
2626

2727
/* Callback implementations (we only need the main one) */
2828
static const OAuthValidatorCallbacks validator_callbacks = {

src/test/modules/oauth_validator/magic_validator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PG_MODULE_MAGIC;
2323
static bool validate_token(const ValidatorModuleState *state,
2424
const char *token,
2525
const char *role,
26-
ValidatorModuleResult *result);
26+
ValidatorModuleResult *res);
2727

2828
/* Callback implementations (we only need the main one) */
2929
static const OAuthValidatorCallbacks validator_callbacks = {

src/test/modules/oauth_validator/validator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void validator_shutdown(ValidatorModuleState *state);
2626
static bool validate_token(const ValidatorModuleState *state,
2727
const char *token,
2828
const char *role,
29-
ValidatorModuleResult *result);
29+
ValidatorModuleResult *res);
3030

3131
/* Callback implementations (exercise all three) */
3232
static const OAuthValidatorCallbacks validator_callbacks = {

0 commit comments

Comments
 (0)