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

Commitf959bf9

Browse files
committed
Further -Wshadow=compatible-local warning fixes
These should have been included in421892a as these shadowed variablewarnings can also be fixed by adjusting the scope of the shadowed variableto put the declaration for it in an inner scope.This is part of the same effort asf01592f.By my count, this takes the warning count from 114 down to 106.Author: David Rowley and Justin PryzbyDiscussion:https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com
1 parent161355e commitf959bf9

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

‎src/backend/access/spgist/spgdoinsert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ moveLeafs(Relation index, SpGistState *state,
395395
size;
396396
Buffernbuf;
397397
Pagenpage;
398-
SpGistLeafTupleit;
399398
OffsetNumberr=InvalidOffsetNumber,
400399
startOffset=InvalidOffsetNumber;
401400
boolreplaceDead= false;
@@ -467,6 +466,8 @@ moveLeafs(Relation index, SpGistState *state,
467466
{
468467
for (i=0;i<nDelete;i++)
469468
{
469+
SpGistLeafTupleit;
470+
470471
it= (SpGistLeafTuple)PageGetItem(current->page,
471472
PageGetItemId(current->page,toDelete[i]));
472473
Assert(it->tupstate==SPGIST_LIVE);

‎src/backend/commands/trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString,
11491149
PartitionDescpartdesc=RelationGetPartitionDesc(rel, true);
11501150
List*idxs=NIL;
11511151
List*childTbls=NIL;
1152-
ListCell*l;
11531152
inti;
11541153
MemoryContextoldcxt,
11551154
perChildCxt;
@@ -1181,6 +1180,7 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString,
11811180
for (i=0;i<partdesc->nparts;i++)
11821181
{
11831182
OidindexOnChild=InvalidOid;
1183+
ListCell*l;
11841184
ListCell*l2;
11851185
CreateTrigStmt*childStmt;
11861186
RelationchildTbl;

‎src/backend/executor/nodeHash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,6 @@ static void
10801080
ExecParallelHashIncreaseNumBatches(HashJoinTablehashtable)
10811081
{
10821082
ParallelHashJoinState*pstate=hashtable->parallel_state;
1083-
inti;
10841083

10851084
Assert(BarrierPhase(&pstate->build_barrier)==PHJ_BUILD_HASHING_INNER);
10861085

@@ -1244,7 +1243,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
12441243
ExecParallelHashTableSetCurrentBatch(hashtable,0);
12451244

12461245
/* Are any of the new generation of batches exhausted? */
1247-
for (i=0;i<hashtable->nbatch;++i)
1246+
for (inti=0;i<hashtable->nbatch;++i)
12481247
{
12491248
ParallelHashJoinBatch*batch=hashtable->batches[i].shared;
12501249

‎src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,6 @@ preprocess_grouping_sets(PlannerInfo *root)
19811981
Query*parse=root->parse;
19821982
List*sets;
19831983
intmaxref=0;
1984-
ListCell*lc;
19851984
ListCell*lc_set;
19861985
grouping_sets_data*gd=palloc0(sizeof(grouping_sets_data));
19871986

@@ -2024,6 +2023,7 @@ preprocess_grouping_sets(PlannerInfo *root)
20242023
if (!bms_is_empty(gd->unsortable_refs))
20252024
{
20262025
List*sortable_sets=NIL;
2026+
ListCell*lc;
20272027

20282028
foreach(lc,parse->groupingSets)
20292029
{

‎src/backend/tsearch/ts_typanalyze.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ compute_tsvector_stats(VacAttrStats *stats,
161161
intvector_no,
162162
lexeme_no;
163163
LexemeHashKeyhash_key;
164-
TrackItem*item;
165164

166165
/*
167166
* We want statistics_target * 10 lexemes in the MCELEM array. This
@@ -240,6 +239,7 @@ compute_tsvector_stats(VacAttrStats *stats,
240239
curentryptr=ARRPTR(vector);
241240
for (j=0;j<vector->size;j++)
242241
{
242+
TrackItem*item;
243243
boolfound;
244244

245245
/*
@@ -296,6 +296,7 @@ compute_tsvector_stats(VacAttrStats *stats,
296296
intnonnull_cnt=samplerows-null_cnt;
297297
inti;
298298
TrackItem**sort_table;
299+
TrackItem*item;
299300
inttrack_len;
300301
intcutoff_freq;
301302
intminfreq,

‎src/backend/utils/adt/levenshtein.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ varstr_levenshtein(const char *source, int slen,
8181
int*prev;
8282
int*curr;
8383
int*s_char_len=NULL;
84-
inti,
85-
j;
84+
intj;
8685
constchar*y;
8786

8887
/*
@@ -217,7 +216,7 @@ varstr_levenshtein(const char *source, int slen,
217216
* To transform the first i characters of s into the first 0 characters of
218217
* t, we must perform i deletions.
219218
*/
220-
for (i=START_COLUMN;i<STOP_COLUMN;i++)
219+
for (inti=START_COLUMN;i<STOP_COLUMN;i++)
221220
prev[i]=i*del_c;
222221

223222
/* Loop through rows of the notional array */
@@ -226,6 +225,7 @@ varstr_levenshtein(const char *source, int slen,
226225
int*temp;
227226
constchar*x=source;
228227
inty_char_len=n!=tlen+1 ?pg_mblen(y) :1;
228+
inti;
229229

230230
#ifdefLEVENSHTEIN_LESS_EQUAL
231231

‎src/backend/utils/adt/rangetypes_gist.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,7 @@ range_gist_double_sorting_split(TypeCacheEntry *typcache,
13221322
ConsiderSplitContextcontext;
13231323
OffsetNumberi,
13241324
maxoff;
1325-
RangeType*range,
1326-
*left_range=NULL,
1325+
RangeType*left_range=NULL,
13271326
*right_range=NULL;
13281327
intcommon_entries_count;
13291328
NonEmptyRange*by_lower,
@@ -1518,6 +1517,7 @@ range_gist_double_sorting_split(TypeCacheEntry *typcache,
15181517
*/
15191518
for (i=FirstOffsetNumber;i <=maxoff;i=OffsetNumberNext(i))
15201519
{
1520+
RangeType*range;
15211521
RangeBoundlower,
15221522
upper;
15231523
boolempty;
@@ -1593,6 +1593,7 @@ range_gist_double_sorting_split(TypeCacheEntry *typcache,
15931593
*/
15941594
for (i=0;i<common_entries_count;i++)
15951595
{
1596+
RangeType*range;
15961597
intidx=common_entries[i].index;
15971598

15981599
range=DatumGetRangeTypeP(entryvec->vector[idx].key);

‎src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok)
16151615
ArrayType*arr;
16161616
char*enabled;
16171617
Datumdatum;
1618-
boolisnull;
16191618
boolndistinct_enabled;
16201619
booldependencies_enabled;
16211620
boolmcv_enabled;
@@ -1668,6 +1667,8 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok)
16681667

16691668
if (!columns_only)
16701669
{
1670+
boolisnull;
1671+
16711672
nsp=get_namespace_name_or_temp(statextrec->stxnamespace);
16721673
appendStringInfo(&buf,"CREATE STATISTICS %s",
16731674
quote_qualified_identifier(nsp,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp