Fix final warnings produced by -Wshadow=compatible-local
authorDavid Rowley <drowley@postgresql.org>
Fri, 7 Oct 2022 00:13:27 +0000 (13:13 +1300)
committerDavid Rowley <drowley@postgresql.org>
Fri, 7 Oct 2022 00:13:27 +0000 (13:13 +1300)
I thought I had these in d8df67bb1, but per report from Andres Freund, I
missed some.

Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/20221005214052.c4tkudawyp5wxt3c@awork3.anarazel.de

contrib/bloom/blinsert.c
contrib/file_fdw/file_fdw.c
contrib/hstore/hstore.h
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/postgres_fdw.c
src/interfaces/libpq/fe-secure-gssapi.c
src/pl/plpython/plpy_cursorobject.c
src/pl/plpython/plpy_exec.c
src/pl/plpython/plpy_spi.c
src/test/modules/test_integerset/test_integerset.c

index e64291e049a0ebf48a33f5737550d8298c4acd1e..dd26d6ac29ac7167dfdbae5f3904f030850527b9 100644 (file)
@@ -232,8 +232,6 @@ blinsert(Relation index, Datum *values, bool *isnull,
 
    if (metaData->nEnd > metaData->nStart)
    {
-       Page        page;
-
        blkno = metaData->notFullPage[metaData->nStart];
        Assert(blkno != InvalidBlockNumber);
 
index de0b9a109c2659d76afb4d8be7f6b2c343026807..67821cd25b3ffc474f36d7ff747ad8de3a2c13a1 100644 (file)
@@ -450,15 +450,15 @@ get_file_fdw_attribute_options(Oid relid)
    for (attnum = 1; attnum <= natts; attnum++)
    {
        Form_pg_attribute attr = TupleDescAttr(tupleDesc, attnum - 1);
-       List       *options;
+       List       *column_options;
        ListCell   *lc;
 
        /* Skip dropped attributes. */
        if (attr->attisdropped)
            continue;
 
-       options = GetForeignColumnOptions(relid, attnum);
-       foreach(lc, options)
+       column_options = GetForeignColumnOptions(relid, attnum);
+       foreach(lc, column_options)
        {
            DefElem    *def = (DefElem *) lfirst(lc);
 
@@ -480,7 +480,7 @@ get_file_fdw_attribute_options(Oid relid)
                    fncolumns = lappend(fncolumns, makeString(attname));
                }
            }
-           /* maybe in future handle other options here */
+           /* maybe in future handle other column options here */
        }
    }
 
index 4713e6ea7ab0a168d534ef71d89bcacd04277ba6..897af244a4230592d07d0e4184839b71625d5cd8 100644 (file)
@@ -128,15 +128,15 @@ typedef struct
 /* finalize a newly-constructed hstore */
 #define HS_FINALIZE(hsp_,count_,buf_,ptr_)                         \
    do {                                                            \
-       int buflen = (ptr_) - (buf_);                               \
+       int _buflen = (ptr_) - (buf_);                              \
        if ((count_))                                               \
            ARRPTR(hsp_)[0].entry |= HENTRY_ISFIRST;                \
        if ((count_) != HS_COUNT((hsp_)))                           \
        {                                                           \
            HS_SETCOUNT((hsp_),(count_));                           \
-           memmove(STRPTR(hsp_), (buf_), buflen);                  \
+           memmove(STRPTR(hsp_), (buf_), _buflen);                 \
        }                                                           \
-       SET_VARSIZE((hsp_), CALCDATASIZE((count_), buflen));        \
+       SET_VARSIZE((hsp_), CALCDATASIZE((count_), _buflen));       \
    } while (0)
 
 /* ensure the varlena size of an existing hstore is correct */
index 09f37fb77a8c2d81a565381c68d8f8b08376d12f..95247656504ffb80142ebf7d26a058de23919c40 100644 (file)
@@ -943,8 +943,6 @@ foreign_expr_walker(Node *node,
                 */
                if (agg->aggorder)
                {
-                   ListCell   *lc;
-
                    foreach(lc, agg->aggorder)
                    {
                        SortGroupClause *srt = (SortGroupClause *) lfirst(lc);
index dd858aba034431d4fa6eab5bf4b891df801084c8..8d013f5b1af3933346af56d79220442e11784163 100644 (file)
@@ -1341,8 +1341,6 @@ postgresGetForeignPlan(PlannerInfo *root,
         */
        if (outer_plan)
        {
-           ListCell   *lc;
-
            /*
             * Right now, we only consider grouping and aggregation beyond
             * joins. Queries involving aggregates or grouping do not require
@@ -6272,10 +6270,10 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
                 */
                foreach(l, aggvars)
                {
-                   Expr       *expr = (Expr *) lfirst(l);
+                   Expr       *aggref = (Expr *) lfirst(l);
 
-                   if (IsA(expr, Aggref))
-                       tlist = add_to_flat_tlist(tlist, list_make1(expr));
+                   if (IsA(aggref, Aggref))
+                       tlist = add_to_flat_tlist(tlist, list_make1(aggref));
                }
            }
        }
@@ -6289,8 +6287,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
     */
    if (havingQual)
    {
-       ListCell   *lc;
-
        foreach(lc, (List *) havingQual)
        {
            Expr       *expr = (Expr *) lfirst(lc);
@@ -6324,7 +6320,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
    if (fpinfo->local_conds)
    {
        List       *aggvars = NIL;
-       ListCell   *lc;
 
        foreach(lc, fpinfo->local_conds)
        {
index 6ea52ed866dd9f400e9d3cade3400b64b8a4d946..dee0982eba205a828a780c4fca23b735f81d7008 100644 (file)
@@ -135,11 +135,11 @@ pg_GSS_write(PGconn *conn, const void *ptr, size_t len)
         */
        if (PqGSSSendLength)
        {
-           ssize_t     ret;
+           ssize_t     retval;
            ssize_t     amount = PqGSSSendLength - PqGSSSendNext;
 
-           ret = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
-           if (ret <= 0)
+           retval = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
+           if (retval <= 0)
            {
                /*
                 * Report any previously-sent data; if there was none, reflect
@@ -149,16 +149,16 @@ pg_GSS_write(PGconn *conn, const void *ptr, size_t len)
                 */
                if (bytes_sent)
                    return bytes_sent;
-               return ret;
+               return retval;
            }
 
            /*
             * Check if this was a partial write, and if so, move forward that
             * far in our buffer and try again.
             */
-           if (ret != amount)
+           if (retval != amount)
            {
-               PqGSSSendNext += ret;
+               PqGSSSendNext += retval;
                continue;
            }
 
index 6b6e74334531b07189685482f735c74209246bab..57e8f8ec2170bba11b57f2d5b829fe57374e3d17 100644 (file)
@@ -215,18 +215,18 @@ PLy_cursor_plan(PyObject *ob, PyObject *args)
            PyObject   *elem;
 
            elem = PySequence_GetItem(args, j);
-           PG_TRY();
+           PG_TRY(2);
            {
                bool        isnull;
 
                plan->values[j] = PLy_output_convert(arg, elem, &isnull);
                nulls[j] = isnull ? 'n' : ' ';
            }
-           PG_FINALLY();
+           PG_FINALLY(2);
            {
                Py_DECREF(elem);
            }
-           PG_END_TRY();
+           PG_END_TRY(2);
        }
 
        portal = SPI_cursor_open(NULL, plan->plan, plan->values, nulls,
index 150b3a5977ff10377c39755ea0677e111274ddf8..923703535a7bb2c13a23e050895821ceaf2a773a 100644 (file)
@@ -375,8 +375,6 @@ PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc)
                rv = NULL;
            else if (pg_strcasecmp(srv, "MODIFY") == 0)
            {
-               TriggerData *tdata = (TriggerData *) fcinfo->context;
-
                if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event) ||
                    TRIGGER_FIRED_BY_UPDATE(tdata->tg_event))
                    rv = PLy_modify_tuple(proc, plargs, tdata, rv);
index 9a71a42c15f2944c534cd5017186e826c23c2dab..6b9f8d5b438465859b487c1341a570c27f3788f5 100644 (file)
@@ -236,18 +236,18 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
            PyObject   *elem;
 
            elem = PySequence_GetItem(list, j);
-           PG_TRY();
+           PG_TRY(2);
            {
                bool        isnull;
 
                plan->values[j] = PLy_output_convert(arg, elem, &isnull);
                nulls[j] = isnull ? 'n' : ' ';
            }
-           PG_FINALLY();
+           PG_FINALLY(2);
            {
                Py_DECREF(elem);
            }
-           PG_END_TRY();
+           PG_END_TRY(2);
        }
 
        rv = SPI_execute_plan(plan->plan, plan->values, nulls,
index 578d2e8aecbc09399f03ff68f03083f649c490de..813ca4ba6b1b1c9a3b82b6d74203e284d30b114f 100644 (file)
@@ -585,26 +585,26 @@ test_huge_distances(void)
     */
    for (int i = 0; i < num_values; i++)
    {
-       uint64      x = values[i];
+       uint64      y = values[i];
        bool        expected;
        bool        result;
 
-       if (x > 0)
+       if (y > 0)
        {
-           expected = (values[i - 1] == x - 1);
-           result = intset_is_member(intset, x - 1);
+           expected = (values[i - 1] == y - 1);
+           result = intset_is_member(intset, y - 1);
            if (result != expected)
-               elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x - 1);
+               elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y - 1);
        }
 
-       result = intset_is_member(intset, x);
+       result = intset_is_member(intset, y);
        if (result != true)
-           elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x);
+           elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y);
 
-       expected = (i != num_values - 1) ? (values[i + 1] == x + 1) : false;
-       result = intset_is_member(intset, x + 1);
+       expected = (i != num_values - 1) ? (values[i + 1] == y + 1) : false;
+       result = intset_is_member(intset, y + 1);
        if (result != expected)
-           elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x + 1);
+           elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y + 1);
    }
 
    /*