From 994d76707a254da6d03e389fa46141371a99e4e1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 13 Feb 2022 19:11:21 -0500 Subject: [PATCH] Fix misuse of "const" qualifier. "const foo *" is quite different from "foo * const". This code was evidently trying to avoid casting away const from the arguments, but entirely failed to do so. Per study of some buildfarm warnings from anole (which unfortunately are mostly ignorable, since it seems not to understand "restrict" very well). I'm surprised though that nothing else has complained. --- src/backend/partitioning/partbounds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 8838763715d..6b35111ebb6 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -3793,8 +3793,8 @@ partition_hash_bsearch(PartitionBoundInfo boundinfo, static int32 qsort_partition_hbound_cmp(const void *a, const void *b) { - PartitionHashBound *const h1 = (PartitionHashBound *const) a; - PartitionHashBound *const h2 = (PartitionHashBound *const) b; + const PartitionHashBound *h1 = (const PartitionHashBound *) a; + const PartitionHashBound *h2 = (const PartitionHashBound *) b; return partition_hbound_cmp(h1->modulus, h1->remainder, h2->modulus, h2->remainder); @@ -3808,8 +3808,8 @@ qsort_partition_hbound_cmp(const void *a, const void *b) static int32 qsort_partition_list_value_cmp(const void *a, const void *b, void *arg) { - Datum val1 = ((PartitionListValue *const) a)->value, - val2 = ((PartitionListValue *const) b)->value; + Datum val1 = ((const PartitionListValue *) a)->value, + val2 = ((const PartitionListValue *) b)->value; PartitionKey key = (PartitionKey) arg; return DatumGetInt32(FunctionCall2Coll(&key->partsupfunc[0], -- 2.30.2