Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bfcf1b3

Browse files
Harmonize parameter names in storage and AM code.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in storage, catalog, access method, executor, and logical replication code, as well as in miscellaneous utility/library code. Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Later commits will do the same for other parts of the codebase. 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 c47885b commit bfcf1b3

Some content is hidden

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

80 files changed

+228
-218
lines changed

src/backend/access/brin/brin_minmax_multi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ typedef struct SerializedRanges
223223

224224
static SerializedRanges *brin_range_serialize(Ranges *range);
225225

226-
static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
226+
static Ranges *brin_range_deserialize(int maxvalues,
227+
SerializedRanges *serialized);
227228

228229

229230
/*

src/backend/access/common/reloptions.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,11 @@ add_reloption(relopt_gen *newoption)
733733
* 'relopt_struct_size'.
734734
*/
735735
void
736-
init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
736+
init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
737737
{
738-
opts->options = NIL;
739-
opts->validators = NIL;
740-
opts->relopt_struct_size = relopt_struct_size;
738+
relopts->options = NIL;
739+
relopts->validators = NIL;
740+
relopts->relopt_struct_size = relopt_struct_size;
741741
}
742742

743743
/*
@@ -746,9 +746,9 @@ init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
746746
* build_local_reloptions().
747747
*/
748748
void
749-
register_reloptions_validator(local_relopts *opts, relopts_validator validator)
749+
register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
750750
{
751-
opts->validators = lappend(opts->validators, validator);
751+
relopts->validators = lappend(relopts->validators, validator);
752752
}
753753

754754
/*

src/backend/access/gin/ginpostinglist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize,
281281
* The number of items is returned in *ndecoded.
282282
*/
283283
ItemPointer
284-
ginPostingListDecode(GinPostingList *plist, int *ndecoded)
284+
ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
285285
{
286286
return ginPostingListDecodeAllSegments(plist,
287287
SizeOfGinPostingList(plist),
288-
ndecoded);
288+
ndecoded_out);
289289
}
290290

291291
/*

src/backend/access/gist/gistbuild.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate,
162162
BlockNumber parentblk, OffsetNumber downlinkoffnum);
163163
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
164164
BlockNumber childblkno, int level,
165-
BlockNumber *parentblk,
165+
BlockNumber *parentblkno,
166166
OffsetNumber *downlinkoffnum);
167167
static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
168168
static void gistEmptyAllBuffers(GISTBuildState *buildstate);
@@ -171,7 +171,8 @@ static int gistGetMaxLevel(Relation index);
171171
static void gistInitParentMap(GISTBuildState *buildstate);
172172
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
173173
BlockNumber parent);
174-
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
174+
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate,
175+
Buffer parentbuf);
175176
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);
176177

177178

src/backend/access/gist/gistbuildbuffers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
3131
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
3232
GISTNodeBuffer *nodeBuffer);
3333
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
34-
IndexTuple item);
34+
IndexTuple itup);
3535
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
36-
IndexTuple *item);
36+
IndexTuple *itup);
3737
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
3838
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
3939

src/backend/access/gist/gistvacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno,
4949
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
5050
GistVacState *vstate);
5151
static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
52-
Buffer buffer, OffsetNumber downlink,
52+
Buffer parentBuffer, OffsetNumber downlink,
5353
Buffer leafBuffer);
5454

5555
/*

src/backend/access/transam/generic_xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct GenericXLogState
6969
};
7070

7171
static void writeFragment(PageData *pageData, OffsetNumber offset,
72-
OffsetNumber len, const char *data);
72+
OffsetNumber length, const char *data);
7373
static void computeRegionDelta(PageData *pageData,
7474
const char *curpage, const char *targetpage,
7575
int targetStart, int targetEnd,

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void AtSubStart_Memory(void);
354354
static void AtSubStart_ResourceOwner(void);
355355

356356
static void ShowTransactionState(const char *str);
357-
static void ShowTransactionStateRec(const char *str, TransactionState state);
357+
static void ShowTransactionStateRec(const char *str, TransactionState s);
358358
static const char *BlockStateAsString(TBlockState blockState);
359359
static const char *TransStateAsString(TransState state);
360360

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ static void XLogReportParameters(void);
648648
static int LocalSetXLogInsertAllowed(void);
649649
static void CreateEndOfRecoveryRecord(void);
650650
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
651-
XLogRecPtr missingContrecPtr,
651+
XLogRecPtr pagePtr,
652652
TimeLineID newTLI);
653653
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
654654
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);

src/backend/access/transam/xloginsert.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ XLogSaveBufferForHint(Buffer buffer, bool buffer_std)
10941094
* the unused space to be left out from the WAL record, making it smaller.
10951095
*/
10961096
XLogRecPtr
1097-
log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
1097+
log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno,
10981098
Page page, bool page_std)
10991099
{
11001100
int flags;
@@ -1105,7 +1105,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
11051105
flags |= REGBUF_STANDARD;
11061106

11071107
XLogBeginInsert();
1108-
XLogRegisterBlock(0, rlocator, forkNum, blkno, page, flags);
1108+
XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags);
11091109
recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
11101110

11111111
/*
@@ -1126,7 +1126,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
11261126
* because we can write multiple pages in a single WAL record.
11271127
*/
11281128
void
1129-
log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
1129+
log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
11301130
BlockNumber *blknos, Page *pages, bool page_std)
11311131
{
11321132
int flags;
@@ -1156,7 +1156,7 @@ log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
11561156
nbatch = 0;
11571157
while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages)
11581158
{
1159-
XLogRegisterBlock(nbatch, rlocator, forkNum, blknos[i], pages[i], flags);
1159+
XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags);
11601160
i++;
11611161
nbatch++;
11621162
}
@@ -1192,15 +1192,15 @@ log_newpage_buffer(Buffer buffer, bool page_std)
11921192
{
11931193
Page page = BufferGetPage(buffer);
11941194
RelFileLocator rlocator;
1195-
ForkNumber forkNum;
1195+
ForkNumber forknum;
11961196
BlockNumber blkno;
11971197

11981198
/* Shared buffers should be modified in a critical section. */
11991199
Assert(CritSectionCount > 0);
12001200

1201-
BufferGetTag(buffer, &rlocator, &forkNum, &blkno);
1201+
BufferGetTag(buffer, &rlocator, &forknum, &blkno);
12021202

1203-
return log_newpage(&rlocator, forkNum, blkno, page, page_std);
1203+
return log_newpage(&rlocator, forknum, blkno, page, page_std);
12041204
}
12051205

12061206
/*
@@ -1221,7 +1221,7 @@ log_newpage_buffer(Buffer buffer, bool page_std)
12211221
* cause a deadlock through some other means.
12221222
*/
12231223
void
1224-
log_newpage_range(Relation rel, ForkNumber forkNum,
1224+
log_newpage_range(Relation rel, ForkNumber forknum,
12251225
BlockNumber startblk, BlockNumber endblk,
12261226
bool page_std)
12271227
{
@@ -1253,7 +1253,7 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
12531253
nbufs = 0;
12541254
while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk)
12551255
{
1256-
Buffer buf = ReadBufferExtended(rel, forkNum, blkno,
1256+
Buffer buf = ReadBufferExtended(rel, forknum, blkno,
12571257
RBM_NORMAL, NULL);
12581258

12591259
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);

0 commit comments

Comments
 (0)