Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e85abd

Browse files
committed
Clean up compiler warnings from unused variables with asserts disabled
For those variables only used when asserts are enabled, use a newmacro PG_USED_FOR_ASSERTS_ONLY, which expands to__attribute__((unused)) when asserts are not enabled.
1 parent621eb15 commit0e85abd

File tree

15 files changed

+29
-19
lines changed

15 files changed

+29
-19
lines changed

‎src/backend/access/hash/hashovfl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf,
391391
uint32ovflbitno;
392392
int32bitmappage,
393393
bitmapbit;
394-
Bucketbucket;
394+
BucketbucketPG_USED_FOR_ASSERTS_ONLY;
395395

396396
/* Get information from the doomed page */
397397
_hash_checkpage(rel,ovflbuf,LH_OVERFLOW_PAGE);

‎src/backend/executor/execCurrent.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
151151
{
152152
ScanState*scanstate;
153153
boollisnull;
154-
Oidtuple_tableoid;
154+
Oidtuple_tableoidPG_USED_FOR_ASSERTS_ONLY;
155155
ItemPointertuple_tid;
156156

157157
/*

‎src/backend/executor/nodeMaterial.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ExecMaterial(MaterialState *node)
6666
* Allocate a second read pointer to serve as the mark. We know it
6767
* must have index 1, so needn't store that.
6868
*/
69-
intptrno;
69+
intptrnoPG_USED_FOR_ASSERTS_ONLY;
7070

7171
ptrno=tuplestore_alloc_read_pointer(tuplestorestate,
7272
node->eflags);

‎src/backend/executor/nodeSetOp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ setop_fill_hash_table(SetOpState *setopstate)
344344
SetOp*node= (SetOp*)setopstate->ps.plan;
345345
PlanState*outerPlan;
346346
intfirstFlag;
347-
boolin_first_rel;
347+
boolin_first_relPG_USED_FOR_ASSERTS_ONLY;
348348

349349
/*
350350
* get state info from node

‎src/backend/executor/nodeWorktablescan.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static TupleTableSlot *
3030
WorkTableScanNext(WorkTableScanState*node)
3131
{
3232
TupleTableSlot*slot;
33-
EState*estate;
3433
Tuplestorestate*tuplestorestate;
3534

3635
/*
@@ -48,8 +47,7 @@ WorkTableScanNext(WorkTableScanState *node)
4847
* worktable. Therefore, we don't need a private read pointer for the
4948
* tuplestore, nor do we need to tell tuplestore_gettupleslot to copy.
5049
*/
51-
estate=node->ss.ps.state;
52-
Assert(ScanDirectionIsForward(estate->es_direction));
50+
Assert(ScanDirectionIsForward(node->ss.ps.state->es_direction));
5351

5452
tuplestorestate=node->rustate->working_table;
5553

‎src/backend/libpq/be-fsstubs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ lo_import_internal(text *filename, Oid lobjOid)
378378
{
379379
Filefd;
380380
intnbytes,
381-
tmp;
381+
tmpPG_USED_FOR_ASSERTS_ONLY;
382382
charbuf[BUFSIZE];
383383
charfnamebuf[MAXPGPATH];
384384
LargeObjectDesc*lobj;

‎src/backend/libpq/pqcomm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ pq_putmessage(char msgtype, const char *s, size_t len)
13731373
void
13741374
pq_putmessage_noblock(charmsgtype,constchar*s,size_tlen)
13751375
{
1376-
intres;
1376+
intresPG_USED_FOR_ASSERTS_ONLY;
13771377
intrequired;
13781378

13791379
/*

‎src/backend/optimizer/path/costsize.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3583,7 +3583,7 @@ void
35833583
set_subquery_size_estimates(PlannerInfo*root,RelOptInfo*rel)
35843584
{
35853585
PlannerInfo*subroot=rel->subroot;
3586-
RangeTblEntry*rte;
3586+
RangeTblEntry*rtePG_USED_FOR_ASSERTS_ONLY;
35873587
ListCell*lc;
35883588

35893589
/* Should only be applied to base relations that are subqueries */

‎src/backend/parser/analyze.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt,
15881588
/* Process leaf SELECT */
15891589
Query*selectQuery;
15901590
charselectName[32];
1591-
RangeTblEntry*rte;
1591+
RangeTblEntry*rtePG_USED_FOR_ASSERTS_ONLY;
15921592
RangeTblRef*rtr;
15931593
ListCell*tl;
15941594

‎src/backend/storage/file/fd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ LruInsert(File file)
685685
/* seek to the right position */
686686
if (vfdP->seekPos!= (off_t)0)
687687
{
688-
off_treturnValue;
688+
off_treturnValuePG_USED_FOR_ASSERTS_ONLY;
689689

690690
returnValue=lseek(vfdP->fd,vfdP->seekPos,SEEK_SET);
691691
Assert(returnValue!= (off_t)-1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp