Remove no longer needed casts from Pointer
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Dec 2025 19:44:52 +0000 (20:44 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Dec 2025 19:44:52 +0000 (20:44 +0100)
These casts used to be required when Pointer was char *, but now it's
void * (commit 1b2bb5077e9), so they are not needed anymore.

Author: Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%40eisentraut.org

contrib/amcheck/verify_gin.c
contrib/pg_trgm/trgm_gin.c
src/backend/access/gin/ginentrypage.c
src/backend/utils/adt/jsonb_gin.c

index 5c3eb4d0fd4f45de1e32e42fe2c7cdb9a11e5f94..efc562275689f52029cc6a1eea30347fedafd8e2 100644 (file)
@@ -107,7 +107,7 @@ ginReadTupleWithoutState(IndexTuple itup, int *nitems)
    {
        if (nipd > 0)
        {
-           ipd = ginPostingListDecode((GinPostingList *) ptr, &ndecoded);
+           ipd = ginPostingListDecode(ptr, &ndecoded);
            if (nipd != ndecoded)
                elog(ERROR, "number of items mismatch in GIN entry tuple, %d in tuple header, %d decoded",
                     nipd, ndecoded);
index 29a52eac7afa45f1656af0ce8c22cf6a1493a9f7..2e49f31c9d6a114ed04124eb2793757a0be84d53 100644 (file)
@@ -247,8 +247,7 @@ gin_trgm_consistent(PG_FUNCTION_ARGS)
                res = true;
            }
            else
-               res = trigramsMatchGraph((TrgmPackedGraph *) extra_data[0],
-                                        check);
+               res = trigramsMatchGraph(extra_data[0], check);
            break;
        default:
            elog(ERROR, "unrecognized strategy number: %d", strategy);
@@ -342,8 +341,7 @@ gin_trgm_triconsistent(PG_FUNCTION_ARGS)
                boolcheck = (bool *) palloc(sizeof(bool) * nkeys);
                for (i = 0; i < nkeys; i++)
                    boolcheck[i] = (check[i] != GIN_FALSE);
-               if (!trigramsMatchGraph((TrgmPackedGraph *) extra_data[0],
-                                       boolcheck))
+               if (!trigramsMatchGraph(extra_data[0], boolcheck))
                    res = GIN_FALSE;
                pfree(boolcheck);
            }
index c05923677004a16e23e0d57ec38360af60bd5ea3..94f49d72a9859b9fdd42cfb2941b617fde419f1e 100644 (file)
@@ -171,7 +171,7 @@ ginReadTuple(GinState *ginstate, OffsetNumber attnum, IndexTuple itup,
    {
        if (nipd > 0)
        {
-           ipd = ginPostingListDecode((GinPostingList *) ptr, &ndecoded);
+           ipd = ginPostingListDecode(ptr, &ndecoded);
            if (nipd != ndecoded)
                elog(ERROR, "number of items mismatch in GIN entry tuple, %d in tuple header, %d decoded",
                     nipd, ndecoded);
index 9b56248cf0bee6189a6a760f953136a6667eb8a9..a6d3332bb42e9b68dcb754239f993166a2e6d41a 100644 (file)
@@ -999,8 +999,7 @@ gin_consistent_jsonb(PG_FUNCTION_ARGS)
        if (nkeys > 0)
        {
            Assert(extra_data && extra_data[0]);
-           res = execute_jsp_gin_node((JsonPathGinNode *) extra_data[0], check,
-                                      false) != GIN_FALSE;
+           res = execute_jsp_gin_node(extra_data[0], check, false) != GIN_FALSE;
        }
    }
    else
@@ -1060,8 +1059,7 @@ gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
        if (nkeys > 0)
        {
            Assert(extra_data && extra_data[0]);
-           res = execute_jsp_gin_node((JsonPathGinNode *) extra_data[0], check,
-                                      true);
+           res = execute_jsp_gin_node(extra_data[0], check, true);
 
            /* Should always recheck the result */
            if (res == GIN_TRUE)
@@ -1258,8 +1256,7 @@ gin_consistent_jsonb_path(PG_FUNCTION_ARGS)
        if (nkeys > 0)
        {
            Assert(extra_data && extra_data[0]);
-           res = execute_jsp_gin_node((JsonPathGinNode *) extra_data[0], check,
-                                      false) != GIN_FALSE;
+           res = execute_jsp_gin_node(extra_data[0], check, false) != GIN_FALSE;
        }
    }
    else
@@ -1302,8 +1299,7 @@ gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS)
        if (nkeys > 0)
        {
            Assert(extra_data && extra_data[0]);
-           res = execute_jsp_gin_node((JsonPathGinNode *) extra_data[0], check,
-                                      true);
+           res = execute_jsp_gin_node(extra_data[0], check, true);
 
            /* Should always recheck the result */
            if (res == GIN_TRUE)