Skip to content

Commit a601366

Browse files
Harmonize more parameter names in bulk.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in optimizer, parser, utility, libpq, and "commands" code, as well as in remaining library code. Do the same for all code related to frontend programs (with the exception of pg_dump/pg_dumpall related code). Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Later commits will handle ecpg and pg_dump/pg_dumpall. Author: Peter Geoghegan <[email protected]> Reviewed-By: David Rowley <[email protected]> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
1 parent c3382a3 commit a601366

File tree

131 files changed

+297
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+297
-293
lines changed

src/backend/backup/basebackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef struct
7474
pg_checksum_type manifest_checksum_type;
7575
} basebackup_options;
7676

77-
static int64 sendTablespace(bbsink *sink, char *path, char *oid, bool sizeonly,
77+
static int64 sendTablespace(bbsink *sink, char *path, char *spcoid, bool sizeonly,
7878
struct backup_manifest_info *manifest);
7979
static int64 sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
8080
List *tablespaces, bool sendtblspclinks,

src/backend/bootstrap/bootstrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,19 +463,19 @@ boot_openrel(char *relname)
463463
* ----------------
464464
*/
465465
void
466-
closerel(char *name)
466+
closerel(char *relname)
467467
{
468-
if (name)
468+
if (relname)
469469
{
470470
if (boot_reldesc)
471471
{
472-
if (strcmp(RelationGetRelationName(boot_reldesc), name) != 0)
472+
if (strcmp(RelationGetRelationName(boot_reldesc), relname) != 0)
473473
elog(ERROR, "close of %s when %s was expected",
474-
name, RelationGetRelationName(boot_reldesc));
474+
relname, RelationGetRelationName(boot_reldesc));
475475
}
476476
else
477477
elog(ERROR, "close of %s before any relation was opened",
478-
name);
478+
relname);
479479
}
480480

481481
if (boot_reldesc == NULL)

src/backend/commands/event_trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
9494
static void error_duplicate_filter_variable(const char *defname);
9595
static Datum filter_list_to_array(List *filterlist);
9696
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
97-
Oid evtOwner, Oid funcoid, List *tags);
97+
Oid evtOwner, Oid funcoid, List *taglist);
9898
static void validate_ddl_tags(const char *filtervar, List *taglist);
9999
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
100100
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);

src/backend/commands/explain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
111111
static void show_hash_info(HashState *hashstate, ExplainState *es);
112112
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
113113
ExplainState *es);
114-
static void show_hashagg_info(AggState *hashstate, ExplainState *es);
114+
static void show_hashagg_info(AggState *aggstate, ExplainState *es);
115115
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
116116
ExplainState *es);
117117
static void show_instrumentation_count(const char *qlabel, int which,

src/backend/commands/indexcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static Oid ReindexTable(RangeVar *relation, ReindexParams *params,
9898
bool isTopLevel);
9999
static void ReindexMultipleTables(const char *objectName,
100100
ReindexObjectType objectKind, ReindexParams *params);
101-
static void reindex_error_callback(void *args);
101+
static void reindex_error_callback(void *arg);
102102
static void ReindexPartitions(Oid relid, ReindexParams *params,
103103
bool isTopLevel);
104104
static void ReindexMultipleInternal(List *relids,

src/backend/commands/lockcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "utils/syscache.h"
3030

3131
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
32-
static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
32+
static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
3333
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
3434
Oid oldrelid, void *arg);
3535
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,

src/backend/commands/opclasscmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
static void AlterOpFamilyAdd(AlterOpFamilyStmt *stmt,
5353
Oid amoid, Oid opfamilyoid,
5454
int maxOpNumber, int maxProcNumber,
55-
int opclassOptsProcNumber, List *items);
55+
int optsProcNumber, List *items);
5656
static void AlterOpFamilyDrop(AlterOpFamilyStmt *stmt,
5757
Oid amoid, Oid opfamilyoid,
5858
int maxOpNumber, int maxProcNumber,

src/backend/commands/schemacmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
285285
}
286286

287287
void
288-
AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
288+
AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
289289
{
290290
HeapTuple tup;
291291
Relation rel;
292292

293293
rel = table_open(NamespaceRelationId, RowExclusiveLock);
294294

295-
tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
295+
tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
296296
if (!HeapTupleIsValid(tup))
297-
elog(ERROR, "cache lookup failed for schema %u", oid);
297+
elog(ERROR, "cache lookup failed for schema %u", schemaoid);
298298

299299
AlterSchemaOwner_internal(tup, rel, newOwnerId);
300300

src/backend/commands/tablecmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
550550
AlterTableCmd *cmd, LOCKMODE lockmode);
551551
static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
552552
static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
553-
static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
553+
static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
554554
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
555555
LOCKMODE lockmode);
556556
static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
610610
List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
611611
static void CreateInheritance(Relation child_rel, Relation parent_rel);
612612
static void RemoveInheritance(Relation child_rel, Relation parent_rel,
613-
bool allow_detached);
613+
bool expect_detached);
614614
static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
615615
PartitionCmd *cmd,
616616
AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
627627
static void DetachPartitionFinalize(Relation rel, Relation partRel,
628628
bool concurrent, Oid defaultPartOid);
629629
static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
630-
static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
630+
static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
631631
RangeVar *name);
632632
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
633633
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,

src/backend/commands/trigger.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
8686
ItemPointer tid,
8787
LockTupleMode lockmode,
8888
TupleTableSlot *oldslot,
89-
TupleTableSlot **newSlot,
90-
TM_FailureData *tmfpd);
89+
TupleTableSlot **epqslot,
90+
TM_FailureData *tmfdp);
9191
static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
9292
Trigger *trigger, TriggerEvent event,
9393
Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
101101
ResultRelInfo *src_partinfo,
102102
ResultRelInfo *dst_partinfo,
103103
int event, bool row_trigger,
104-
TupleTableSlot *oldtup, TupleTableSlot *newtup,
104+
TupleTableSlot *oldslot, TupleTableSlot *newslot,
105105
List *recheckIndexes, Bitmapset *modifiedCols,
106106
TransitionCaptureState *transition_capture,
107107
bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
38713871
Tuplestorestate *tuplestore);
38723872
static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
38733873
static SetConstraintState SetConstraintStateCreate(int numalloc);
3874-
static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
3874+
static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
38753875
static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
38763876
Oid tgoid, bool tgisdeferred);
38773877
static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);

0 commit comments

Comments
 (0)