1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Further -Wshadow=compatible-local warning fixes

These should have been included in 421892a19 as these shadowed variable
warnings can also be fixed by adjusting the scope of the shadowed variable
to put the declaration for it in an inner scope.

This is part of the same effort as f01592f91.

By my count, this takes the warning count from 114 down to 106.

Author: David Rowley and Justin Pryzby
Discussion: https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com
This commit is contained in:
David Rowley
2022-08-24 22:04:28 +12:00
parent 161355ee6d
commit f959bf9a5b
8 changed files with 15 additions and 12 deletions

View File

@@ -81,8 +81,7 @@ varstr_levenshtein(const char *source, int slen,
int *prev;
int *curr;
int *s_char_len = NULL;
int i,
j;
int j;
const char *y;
/*
@@ -217,7 +216,7 @@ varstr_levenshtein(const char *source, int slen,
* To transform the first i characters of s into the first 0 characters of
* t, we must perform i deletions.
*/
for (i = START_COLUMN; i < STOP_COLUMN; i++)
for (int i = START_COLUMN; i < STOP_COLUMN; i++)
prev[i] = i * del_c;
/* Loop through rows of the notional array */
@@ -226,6 +225,7 @@ varstr_levenshtein(const char *source, int slen,
int *temp;
const char *x = source;
int y_char_len = n != tlen + 1 ? pg_mblen(y) : 1;
int i;
#ifdef LEVENSHTEIN_LESS_EQUAL