From db4d1781fefb8a6ea9fdfa985af631d361550887 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 29 Oct 2024 08:02:57 +0100 Subject: [PATCH] Remove useless casts to (void *) Some of these are because the code previously used different types. Many of them just seem to have been copied around for no real reason. --- contrib/amcheck/verify_nbtree.c | 2 +- contrib/bloom/blinsert.c | 2 +- contrib/bloom/blutils.c | 2 +- contrib/btree_gist/btree_bit.c | 2 +- contrib/btree_gist/btree_bool.c | 4 +- contrib/btree_gist/btree_bytea.c | 2 +- contrib/btree_gist/btree_cash.c | 6 +- contrib/btree_gist/btree_date.c | 6 +- contrib/btree_gist/btree_enum.c | 4 +- contrib/btree_gist/btree_float4.c | 6 +- contrib/btree_gist/btree_float8.c | 6 +- contrib/btree_gist/btree_inet.c | 4 +- contrib/btree_gist/btree_int2.c | 6 +- contrib/btree_gist/btree_int4.c | 6 +- contrib/btree_gist/btree_int8.c | 6 +- contrib/btree_gist/btree_interval.c | 6 +- contrib/btree_gist/btree_macaddr.c | 4 +- contrib/btree_gist/btree_macaddr8.c | 4 +- contrib/btree_gist/btree_numeric.c | 2 +- contrib/btree_gist/btree_oid.c | 6 +- contrib/btree_gist/btree_text.c | 4 +- contrib/btree_gist/btree_time.c | 8 +- contrib/btree_gist/btree_ts.c | 10 +-- contrib/btree_gist/btree_uuid.c | 4 +- contrib/file_fdw/file_fdw.c | 8 +- contrib/hstore/hstore_op.c | 2 +- contrib/intarray/_int_bool.c | 6 +- contrib/ltree/_ltree_gist.c | 2 +- contrib/ltree/_ltree_op.c | 18 ++--- contrib/pg_trgm/trgm_gist.c | 2 +- contrib/pgcrypto/openssl.c | 2 +- contrib/postgres_fdw/postgres_fdw.c | 10 +-- src/backend/access/brin/brin.c | 4 +- src/backend/access/brin/brin_minmax_multi.c | 8 +- src/backend/access/common/detoast.c | 2 +- src/backend/access/gin/ginbulk.c | 2 +- src/backend/access/gin/gininsert.c | 5 +- src/backend/access/gist/gist.c | 2 +- src/backend/access/gist/gistbuild.c | 4 +- src/backend/access/hash/hash.c | 2 +- src/backend/access/heap/vacuumlazy.c | 2 +- src/backend/access/nbtree/nbtree.c | 10 +-- src/backend/access/nbtree/nbtsort.c | 4 +- src/backend/access/spgist/spginsert.c | 2 +- src/backend/access/spgist/spgutils.c | 2 +- src/backend/access/transam/twophase.c | 5 +- src/backend/access/transam/xlogrecovery.c | 8 +- src/backend/catalog/dependency.c | 4 +- src/backend/catalog/heap.c | 2 +- src/backend/catalog/index.c | 2 +- src/backend/catalog/objectaccess.c | 16 ++-- src/backend/catalog/pg_proc.c | 2 +- src/backend/catalog/pg_publication.c | 2 +- src/backend/commands/copyfrom.c | 2 +- src/backend/commands/foreigncmds.c | 2 +- src/backend/commands/indexcmds.c | 2 +- src/backend/commands/lockcmds.c | 2 +- src/backend/commands/policy.c | 6 +- src/backend/commands/publicationcmds.c | 6 +- src/backend/commands/tablecmds.c | 10 +-- src/backend/commands/tablespace.c | 2 +- src/backend/commands/typecmds.c | 2 +- src/backend/commands/vacuum.c | 2 +- src/backend/commands/variable.c | 6 +- src/backend/executor/execExpr.c | 3 +- src/backend/executor/execExprInterp.c | 34 ++++----- src/backend/executor/execIndexing.c | 2 +- src/backend/executor/functions.c | 4 +- src/backend/executor/nodeAgg.c | 13 ++-- src/backend/executor/nodeSort.c | 2 +- src/backend/executor/nodeWindowAgg.c | 8 +- src/backend/libpq/hba.c | 2 +- src/backend/nodes/nodeFuncs.c | 4 +- src/backend/nodes/params.c | 2 +- src/backend/nodes/read.c | 2 +- src/backend/optimizer/geqo/geqo_main.c | 2 +- src/backend/optimizer/path/costsize.c | 3 +- src/backend/optimizer/path/indxpath.c | 2 +- src/backend/optimizer/plan/createplan.c | 4 +- src/backend/optimizer/plan/setrefs.c | 30 +++----- src/backend/optimizer/plan/subselect.c | 21 ++---- src/backend/optimizer/prep/prepagg.c | 3 +- src/backend/optimizer/prep/prepjointree.c | 28 +++---- src/backend/optimizer/util/appendinfo.c | 5 +- src/backend/optimizer/util/clauses.c | 29 ++++---- src/backend/optimizer/util/predtest.c | 10 +-- src/backend/optimizer/util/tlist.c | 6 +- src/backend/optimizer/util/var.c | 45 +++++------- src/backend/parser/analyze.c | 2 +- src/backend/parser/parse_agg.c | 12 +-- src/backend/parser/parse_collate.c | 16 ++-- src/backend/parser/parse_cte.c | 12 +-- src/backend/parser/parse_node.c | 2 +- src/backend/parser/parse_param.c | 10 +-- src/backend/parser/scan.l | 2 +- src/backend/partitioning/partprune.c | 3 +- src/backend/port/sysv_shmem.c | 6 +- src/backend/replication/logical/logical.c | 44 +++++------ src/backend/replication/logical/tablesync.c | 2 +- src/backend/replication/slot.c | 2 +- src/backend/replication/syncrep.c | 2 +- src/backend/rewrite/rewriteDefine.c | 4 +- src/backend/rewrite/rewriteHandler.c | 8 +- src/backend/rewrite/rewriteManip.c | 81 +++++++++------------ src/backend/storage/buffer/buf_table.c | 2 +- src/backend/storage/buffer/bufmgr.c | 4 +- src/backend/storage/buffer/localbuf.c | 2 +- src/backend/storage/ipc/shmem.c | 6 +- src/backend/tcop/postgres.c | 6 +- src/backend/tsearch/dict_thesaurus.c | 2 +- src/backend/tsearch/spell.c | 2 +- src/backend/tsearch/ts_locale.c | 2 +- src/backend/tsearch/ts_parse.c | 12 +-- src/backend/tsearch/wparser.c | 8 +- src/backend/utils/adt/acl.c | 2 +- src/backend/utils/adt/array_userfuncs.c | 8 +- src/backend/utils/adt/arrayfuncs.c | 14 ++-- src/backend/utils/adt/datetime.c | 2 +- src/backend/utils/adt/datum.c | 4 +- src/backend/utils/adt/domains.c | 6 +- src/backend/utils/adt/enum.c | 2 +- src/backend/utils/adt/expandedrecord.c | 8 +- src/backend/utils/adt/jsonb.c | 4 +- src/backend/utils/adt/jsonfuncs.c | 26 +++---- src/backend/utils/adt/jsonpath_exec.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/adt/lockfuncs.c | 2 +- src/backend/utils/adt/multirangetypes.c | 4 +- src/backend/utils/adt/orderedsetaggs.c | 2 +- src/backend/utils/adt/partitionfuncs.c | 4 +- src/backend/utils/adt/rangetypes.c | 4 +- src/backend/utils/adt/regexp.c | 4 +- src/backend/utils/adt/tsgistidx.c | 2 +- src/backend/utils/adt/tsrank.c | 6 +- src/backend/utils/adt/tsvector_op.c | 2 +- src/backend/utils/adt/xml.c | 14 ++-- src/backend/utils/cache/plancache.c | 6 +- src/backend/utils/cache/typcache.c | 2 +- src/backend/utils/error/elog.c | 2 +- src/backend/utils/hash/dynahash.c | 12 +-- src/backend/utils/mmgr/mcxt.c | 2 +- src/backend/utils/sort/tuplesortvariants.c | 12 +-- src/backend/utils/sort/tuplestore.c | 10 +-- src/bin/pg_dump/pg_backup_archiver.c | 4 +- src/bin/pg_dump/pg_backup_custom.c | 6 +- src/bin/pg_dump/pg_backup_directory.c | 6 +- src/bin/pg_dump/pg_backup_tar.c | 8 +- src/bin/psql/mainloop.c | 2 +- src/bin/psql/startup.c | 2 +- src/include/common/pg_prng.h | 2 +- src/interfaces/ecpg/ecpglib/connect.c | 2 +- src/interfaces/ecpg/ecpglib/descriptor.c | 4 +- src/interfaces/ecpg/ecpglib/memory.c | 2 +- src/pl/plpgsql/src/pl_comp.c | 4 +- src/pl/plpgsql/src/pl_exec.c | 10 +-- src/pl/plpgsql/src/pl_handler.c | 2 +- src/pl/plpython/plpy_exec.c | 4 +- src/test/isolation/isolationtester.c | 2 +- src/test/modules/test_regex/test_regex.c | 2 +- 159 files changed, 493 insertions(+), 551 deletions(-) diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c index 8b82797c10f..ffe4f721672 100644 --- a/contrib/amcheck/verify_nbtree.c +++ b/contrib/amcheck/verify_nbtree.c @@ -719,7 +719,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace, RelationGetRelationName(state->heaprel)); table_index_build_scan(state->heaprel, state->rel, indexinfo, true, false, - bt_tuple_present_callback, (void *) state, scan); + bt_tuple_present_callback, state, scan); ereport(DEBUG1, (errmsg_internal("finished verifying presence of " INT64_FORMAT " tuples from table \"%s\" with bitset %.2f%% set", diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c index dbb79a51edd..5da3df05281 100644 --- a/contrib/bloom/blinsert.c +++ b/contrib/bloom/blinsert.c @@ -139,7 +139,7 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo) /* Do the heap scan */ reltuples = table_index_build_scan(heap, index, indexInfo, true, true, - bloomBuildCallback, (void *) &buildstate, + bloomBuildCallback, &buildstate, NULL); /* Flush last page if needed (it will be, unless heap was empty) */ diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index af10199394a..ef77688a8d3 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -199,7 +199,7 @@ initBloomState(BloomState *state, Relation index) UnlockReleaseBuffer(buffer); - index->rd_amcache = (void *) opts; + index->rd_amcache = opts; } memcpy(&state->opts, index->rd_amcache, sizeof(state->opts)); diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c index 9d5e01a1977..f346b956fa9 100644 --- a/contrib/btree_gist/btree_bit.c +++ b/contrib/btree_gist/btree_bit.c @@ -136,7 +136,7 @@ Datum gbt_bit_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1)); + void *query = DatumGetByteaP(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ diff --git a/contrib/btree_gist/btree_bool.c b/contrib/btree_gist/btree_bool.c index bdc7834bb6a..adb724e16ac 100644 --- a/contrib/btree_gist/btree_bool.c +++ b/contrib/btree_gist/btree_bool.c @@ -120,7 +120,7 @@ gbt_bool_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -132,7 +132,7 @@ gbt_bool_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(boolKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(boolKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c index 394e40ed16b..5eacb8c59a0 100644 --- a/contrib/btree_gist/btree_bytea.c +++ b/contrib/btree_gist/btree_bytea.c @@ -104,7 +104,7 @@ Datum gbt_bytea_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1)); + void *query = DatumGetByteaP(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c index 546b948ea40..c18c34c8b83 100644 --- a/contrib/btree_gist/btree_cash.c +++ b/contrib/btree_gist/btree_cash.c @@ -150,7 +150,7 @@ gbt_cash_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -169,7 +169,7 @@ gbt_cash_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,7 +181,7 @@ gbt_cash_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(cashKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(cashKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index 5efb5ef96f5..7a4a9d7a853 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -167,7 +167,7 @@ gbt_date_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -186,7 +186,7 @@ gbt_date_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -198,7 +198,7 @@ gbt_date_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(dateKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(dateKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c index 26682122f8e..05d02e704a0 100644 --- a/contrib/btree_gist/btree_enum.c +++ b/contrib/btree_gist/btree_enum.c @@ -137,7 +137,7 @@ gbt_enum_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -149,7 +149,7 @@ gbt_enum_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(oidKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(oidKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c index 84ca5eee501..d138aa94bf2 100644 --- a/contrib/btree_gist/btree_float4.c +++ b/contrib/btree_gist/btree_float4.c @@ -145,7 +145,7 @@ gbt_float4_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -164,7 +164,7 @@ gbt_float4_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -176,7 +176,7 @@ gbt_float4_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(float4KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(float4KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c index 081a719b006..a74cd200529 100644 --- a/contrib/btree_gist/btree_float8.c +++ b/contrib/btree_gist/btree_float8.c @@ -152,7 +152,7 @@ gbt_float8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -171,7 +171,7 @@ gbt_float8_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -183,7 +183,7 @@ gbt_float8_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(float8KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(float8KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index c66ca99e0c3..4cffd349091 100644 --- a/contrib/btree_gist/btree_inet.c +++ b/contrib/btree_gist/btree_inet.c @@ -138,7 +138,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -150,7 +150,7 @@ gbt_inet_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(inetKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(inetKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c index fdbf156586c..1751a6c055d 100644 --- a/contrib/btree_gist/btree_int2.c +++ b/contrib/btree_gist/btree_int2.c @@ -150,7 +150,7 @@ gbt_int2_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -168,7 +168,7 @@ gbt_int2_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -180,7 +180,7 @@ gbt_int2_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(int16KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(int16KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c index 8915fb5d087..90d183be6e8 100644 --- a/contrib/btree_gist/btree_int4.c +++ b/contrib/btree_gist/btree_int4.c @@ -151,7 +151,7 @@ gbt_int4_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -169,7 +169,7 @@ gbt_int4_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,7 +181,7 @@ gbt_int4_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(int32KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(int32KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c index 7c63a5b6dc1..661cf8189fc 100644 --- a/contrib/btree_gist/btree_int8.c +++ b/contrib/btree_gist/btree_int8.c @@ -151,7 +151,7 @@ gbt_int8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -169,7 +169,7 @@ gbt_int8_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,7 +181,7 @@ gbt_int8_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(int64KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(int64KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index c2f6eede226..8f99a416965 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -224,7 +224,7 @@ gbt_intv_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -242,7 +242,7 @@ gbt_intv_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -254,7 +254,7 @@ gbt_intv_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(intvKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(intvKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c index 1367eaba735..558cfa2172f 100644 --- a/contrib/btree_gist/btree_macaddr.c +++ b/contrib/btree_gist/btree_macaddr.c @@ -141,7 +141,7 @@ gbt_macad_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -153,7 +153,7 @@ gbt_macad_union(PG_FUNCTION_ARGS) void *out = palloc0(sizeof(macKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(macKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_macaddr8.c b/contrib/btree_gist/btree_macaddr8.c index 9676e5a15bd..5d0c5509f51 100644 --- a/contrib/btree_gist/btree_macaddr8.c +++ b/contrib/btree_gist/btree_macaddr8.c @@ -141,7 +141,7 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -153,7 +153,7 @@ gbt_macad8_union(PG_FUNCTION_ARGS) void *out = palloc0(sizeof(mac8KEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(mac8KEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c index 35e466cdd94..d533648a295 100644 --- a/contrib/btree_gist/btree_numeric.c +++ b/contrib/btree_gist/btree_numeric.c @@ -108,7 +108,7 @@ Datum gbt_numeric_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) DatumGetNumeric(PG_GETARG_DATUM(1)); + void *query = DatumGetNumeric(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index 3cc7d4245d4..d1976f4f091 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -151,7 +151,7 @@ gbt_oid_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -169,7 +169,7 @@ gbt_oid_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,7 +181,7 @@ gbt_oid_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(oidKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(oidKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_text.c b/contrib/btree_gist/btree_text.c index 28d6b5c9c2b..8f80f54240f 100644 --- a/contrib/btree_gist/btree_text.c +++ b/contrib/btree_gist/btree_text.c @@ -193,7 +193,7 @@ Datum gbt_text_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) DatumGetTextP(PG_GETARG_DATUM(1)); + void *query = DatumGetTextP(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ @@ -221,7 +221,7 @@ Datum gbt_bpchar_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) DatumGetTextP(PG_GETARG_DATUM(1)); + void *query = DatumGetTextP(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index 3034bbb456b..2f7859340f6 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -216,7 +216,7 @@ gbt_time_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -233,7 +233,7 @@ gbt_time_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -258,7 +258,7 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -270,7 +270,7 @@ gbt_time_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(timeKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(timeKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index b3cf2d6f60d..9e0d979dda9 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -265,7 +265,7 @@ gbt_ts_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -282,7 +282,7 @@ gbt_ts_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -306,7 +306,7 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)]; qqq = tstz_to_ts_gmt(query); - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -325,7 +325,7 @@ gbt_tstz_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)]; qqq = tstz_to_ts_gmt(query); - PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), + PG_RETURN_FLOAT8(gbt_num_distance(&key, &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -337,7 +337,7 @@ gbt_ts_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(tsKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(tsKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index fe8c679cbed..f4c5c6e5892 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -148,7 +148,7 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + PG_RETURN_BOOL(gbt_num_consistent(&key, query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -160,7 +160,7 @@ gbt_uuid_union(PG_FUNCTION_ARGS) void *out = palloc(sizeof(uuidKEY)); *(int *) PG_GETARG_POINTER(1) = sizeof(uuidKEY); - PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo)); + PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo)); } /* diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 043204c3e7e..5726af6cc15 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -530,7 +530,7 @@ fileGetForeignRelSize(PlannerInfo *root, &fdw_private->filename, &fdw_private->is_program, &fdw_private->options); - baserel->fdw_private = (void *) fdw_private; + baserel->fdw_private = fdw_private; /* Estimate relation size */ estimate_size(root, baserel, fdw_private); @@ -712,7 +712,7 @@ fileBeginForeignScan(ForeignScanState *node, int eflags) festate->options = options; festate->cstate = cstate; - node->fdw_state = (void *) festate; + node->fdw_state = festate; } /* @@ -733,7 +733,7 @@ fileIterateForeignScan(ForeignScanState *node) /* Set up callback to identify error line number. */ errcallback.callback = CopyFromErrorCallback; - errcallback.arg = (void *) cstate; + errcallback.arg = cstate; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1220,7 +1220,7 @@ file_acquire_sample_rows(Relation onerel, int elevel, /* Set up callback to identify error line number. */ errcallback.callback = CopyFromErrorCallback; - errcallback.arg = (void *) cstate; + errcallback.arg = cstate; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c index 0d4ec16d1e5..5e57eceffc8 100644 --- a/contrib/hstore/hstore_op.c +++ b/contrib/hstore/hstore_op.c @@ -858,7 +858,7 @@ setup_firstcall(FuncCallContext *funcctx, HStore *hs, st = (HStore *) palloc(VARSIZE(hs)); memcpy(st, hs, VARSIZE(hs)); - funcctx->user_fctx = (void *) st; + funcctx->user_fctx = st; if (fcinfo) { diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 8cf02c0e5da..2b2c3f4029e 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -298,7 +298,7 @@ bool signconsistent(QUERYTYPE *query, BITVECP sign, int siglen, bool calcnot) { return execute(GETQUERY(query) + query->size - 1, - (void *) sign, (void *) (intptr_t) siglen, calcnot, + sign, (void *) (intptr_t) siglen, calcnot, checkcondition_bit); } @@ -312,7 +312,7 @@ execconsistent(QUERYTYPE *query, ArrayType *array, bool calcnot) chkval.arrb = ARRPTR(array); chkval.arre = chkval.arrb + ARRNELEMS(array); return execute(GETQUERY(query) + query->size - 1, - (void *) &chkval, NULL, calcnot, + &chkval, NULL, calcnot, checkcondition_arr); } @@ -354,7 +354,7 @@ gin_bool_consistent(QUERYTYPE *query, bool *check) } return execute(GETQUERY(query) + query->size - 1, - (void *) &gcv, NULL, true, + &gcv, NULL, true, checkcondition_gin); } diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index e89a39a5b5f..286ad24fbe8 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -506,7 +506,7 @@ Datum _ltree_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - void *query = (void *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1)); + void *query = PG_DETOAST_DATUM(PG_GETARG_DATUM(1)); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ diff --git a/contrib/ltree/_ltree_op.c b/contrib/ltree/_ltree_op.c index 2fdb5ea97bf..b4a8097328d 100644 --- a/contrib/ltree/_ltree_op.c +++ b/contrib/ltree/_ltree_op.c @@ -73,7 +73,7 @@ _ltree_isparent(PG_FUNCTION_ARGS) { ArrayType *la = PG_GETARG_ARRAYTYPE_P(0); ltree *query = PG_GETARG_LTREE_P(1); - bool res = array_iterator(la, ltree_isparent, (void *) query, NULL); + bool res = array_iterator(la, ltree_isparent, query, NULL); PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -94,7 +94,7 @@ _ltree_risparent(PG_FUNCTION_ARGS) { ArrayType *la = PG_GETARG_ARRAYTYPE_P(0); ltree *query = PG_GETARG_LTREE_P(1); - bool res = array_iterator(la, ltree_risparent, (void *) query, NULL); + bool res = array_iterator(la, ltree_risparent, query, NULL); PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -115,7 +115,7 @@ _ltq_regex(PG_FUNCTION_ARGS) { ArrayType *la = PG_GETARG_ARRAYTYPE_P(0); lquery *query = PG_GETARG_LQUERY_P(1); - bool res = array_iterator(la, ltq_regex, (void *) query, NULL); + bool res = array_iterator(la, ltq_regex, query, NULL); PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -151,7 +151,7 @@ _lt_q_regex(PG_FUNCTION_ARGS) while (num > 0) { - if (array_iterator(_tree, ltq_regex, (void *) query, NULL)) + if (array_iterator(_tree, ltq_regex, query, NULL)) { res = true; break; @@ -180,7 +180,7 @@ _ltxtq_exec(PG_FUNCTION_ARGS) { ArrayType *la = PG_GETARG_ARRAYTYPE_P(0); ltxtquery *query = PG_GETARG_LTXTQUERY_P(1); - bool res = array_iterator(la, ltxtq_exec, (void *) query, NULL); + bool res = array_iterator(la, ltxtq_exec, query, NULL); PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -205,7 +205,7 @@ _ltree_extract_isparent(PG_FUNCTION_ARGS) ltree *found, *item; - if (!array_iterator(la, ltree_isparent, (void *) query, &found)) + if (!array_iterator(la, ltree_isparent, query, &found)) { PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -228,7 +228,7 @@ _ltree_extract_risparent(PG_FUNCTION_ARGS) ltree *found, *item; - if (!array_iterator(la, ltree_risparent, (void *) query, &found)) + if (!array_iterator(la, ltree_risparent, query, &found)) { PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -251,7 +251,7 @@ _ltq_extract_regex(PG_FUNCTION_ARGS) ltree *found, *item; - if (!array_iterator(la, ltq_regex, (void *) query, &found)) + if (!array_iterator(la, ltq_regex, query, &found)) { PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); @@ -274,7 +274,7 @@ _ltxtq_extract_exec(PG_FUNCTION_ARGS) ltree *found, *item; - if (!array_iterator(la, ltxtq_exec, (void *) query, &found)) + if (!array_iterator(la, ltxtq_exec, query, &found)) { PG_FREE_IF_COPY(la, 0); PG_FREE_IF_COPY(query, 1); diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index 9ef2e38560a..7f482f958fd 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -299,7 +299,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS) if (cache) pfree(cache); - fcinfo->flinfo->fn_extra = (void *) newcache; + fcinfo->flinfo->fn_extra = newcache; cache = newcache; } diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index 26454bc3e29..448db331a0f 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -203,7 +203,7 @@ px_find_digest(const char *name, PX_MD **res) h->update = digest_update; h->finish = digest_finish; h->free = digest_free; - h->p.ptr = (void *) digest; + h->p.ptr = digest; *res = h; return 0; diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 53733d642d0..c0810fbd7c8 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -630,7 +630,7 @@ postgresGetForeignRelSize(PlannerInfo *root, * functions. */ fpinfo = (PgFdwRelationInfo *) palloc0(sizeof(PgFdwRelationInfo)); - baserel->fdw_private = (void *) fpinfo; + baserel->fdw_private = fpinfo; /* Base foreign tables need to be pushed down always. */ fpinfo->pushdown_safe = true; @@ -1132,7 +1132,7 @@ postgresGetForeignPaths(PlannerInfo *root, clauses = generate_implied_equalities_for_column(root, baserel, ec_member_matches_foreign, - (void *) &arg, + &arg, baserel->lateral_referencers); /* Done if there are no more expressions in the foreign rel */ @@ -1514,7 +1514,7 @@ postgresBeginForeignScan(ForeignScanState *node, int eflags) * We'll save private state in node->fdw_state. */ fsstate = (PgFdwScanState *) palloc0(sizeof(PgFdwScanState)); - node->fdw_state = (void *) fsstate; + node->fdw_state = fsstate; /* * Identify which user to do the remote access as. This should match what @@ -2664,7 +2664,7 @@ postgresBeginDirectModify(ForeignScanState *node, int eflags) * We'll save private state in node->fdw_state. */ dmstate = (PgFdwDirectModifyState *) palloc0(sizeof(PgFdwDirectModifyState)); - node->fdw_state = (void *) dmstate; + node->fdw_state = dmstate; /* * Identify which user to do the remote access as. This should match what @@ -7618,7 +7618,7 @@ make_tuple_from_result_row(PGresult *res, errpos.rel = rel; errpos.fsstate = fsstate; errcallback.callback = conversion_error_callback; - errcallback.arg = (void *) &errpos; + errcallback.arg = &errpos; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index c0b978119ac..3aedec882cd 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -1222,7 +1222,7 @@ brinbuild(Relation heap, Relation index, IndexInfo *indexInfo) * generate summary for the same range twice). */ reltuples = table_index_build_scan(heap, index, indexInfo, false, true, - brinbuildCallback, (void *) state, NULL); + brinbuildCallback, state, NULL); /* * process the final batch @@ -1808,7 +1808,7 @@ summarize_range(IndexInfo *indexInfo, BrinBuildState *state, Relation heapRel, state->bs_currRangeStart = heapBlk; table_index_build_range_scan(heapRel, state->bs_irel, indexInfo, false, true, false, heapBlk, scanNumBlks, - brinbuildCallback, (void *) state, NULL); + brinbuildCallback, state, NULL); /* * Now we update the values obtained by the scan with the placeholder diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c index e5d95de5d84..edb749f585b 100644 --- a/src/backend/access/brin/brin_minmax_multi.c +++ b/src/backend/access/brin/brin_minmax_multi.c @@ -413,7 +413,7 @@ AssertCheckRanges(Ranges *ranges, FmgrInfo *cmpFn, Oid colloid) Assert(bsearch_arg(&value, &ranges->values[2 * ranges->nranges], ranges->nsorted, sizeof(Datum), - compare_values, (void *) &cxt) == NULL); + compare_values, &cxt) == NULL); } } #endif @@ -550,7 +550,7 @@ range_deduplicate_values(Ranges *range) /* same as preceding value, so store it */ if (compare_values(&range->values[start + i - 1], &range->values[start + i], - (void *) &cxt) == 0) + &cxt) == 0) continue; range->values[start + n] = range->values[start + i]; @@ -1085,7 +1085,7 @@ range_contains_value(BrinDesc *bdesc, Oid colloid, if (bsearch_arg(&newval, &ranges->values[2 * ranges->nranges], ranges->nsorted, sizeof(Datum), - compare_values, (void *) &cxt) != NULL) + compare_values, &cxt) != NULL) return true; } else @@ -1206,7 +1206,7 @@ sort_expanded_ranges(FmgrInfo *cmp, Oid colloid, for (i = 1; i < neranges; i++) { /* if the current range is equal to the preceding one, do nothing */ - if (!compare_expanded_ranges(&eranges[i - 1], &eranges[i], (void *) &cxt)) + if (!compare_expanded_ranges(&eranges[i - 1], &eranges[i], &cxt)) continue; /* otherwise, copy it to n-th place (if not already there) */ diff --git a/src/backend/access/common/detoast.c b/src/backend/access/common/detoast.c index 3547cdba56e..d92e6833849 100644 --- a/src/backend/access/common/detoast.c +++ b/src/backend/access/common/detoast.c @@ -88,7 +88,7 @@ detoast_external_attr(struct varlena *attr) eoh = DatumGetEOHP(PointerGetDatum(attr)); resultsize = EOH_get_flat_size(eoh); result = (struct varlena *) palloc(resultsize); - EOH_flatten_into(eoh, (void *) result, resultsize); + EOH_flatten_into(eoh, result, resultsize); } else { diff --git a/src/backend/access/gin/ginbulk.c b/src/backend/access/gin/ginbulk.c index 7f89cd5e826..f08b66ab791 100644 --- a/src/backend/access/gin/ginbulk.c +++ b/src/backend/access/gin/ginbulk.c @@ -117,7 +117,7 @@ ginInitBA(BuildAccumulator *accum) ginCombineData, ginAllocEntryAccumulator, NULL, /* no freefunc needed */ - (void *) accum); + accum); } /* diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 71f38be90c3..31ee5650417 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -380,8 +380,7 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo) * prefers to receive tuples in TID order. */ reltuples = table_index_build_scan(heap, index, indexInfo, false, true, - ginBuildCallback, (void *) &buildstate, - NULL); + ginBuildCallback, &buildstate, NULL); /* dump remaining entries to the index */ oldCtx = MemoryContextSwitchTo(buildstate.tmpCtx); @@ -497,7 +496,7 @@ gininsert(Relation index, Datum *values, bool *isnull, oldCtx = MemoryContextSwitchTo(indexInfo->ii_Context); ginstate = (GinState *) palloc(sizeof(GinState)); initGinState(ginstate, index); - indexInfo->ii_AmCache = (void *) ginstate; + indexInfo->ii_AmCache = ginstate; MemoryContextSwitchTo(oldCtx); } diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 2d7a0687d4a..e9e030f9cd3 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -173,7 +173,7 @@ gistinsert(Relation r, Datum *values, bool *isnull, oldCxt = MemoryContextSwitchTo(indexInfo->ii_Context); giststate = initGISTstate(r); giststate->tempCxt = createTempGistContext(); - indexInfo->ii_AmCache = (void *) giststate; + indexInfo->ii_AmCache = giststate; MemoryContextSwitchTo(oldCxt); } diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index ba06df30faf..63d1914b37f 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -273,7 +273,7 @@ gistbuild(Relation heap, Relation index, IndexInfo *indexInfo) /* Scan the table, adding all tuples to the tuplesort */ reltuples = table_index_build_scan(heap, index, indexInfo, true, true, gistSortedBuildCallback, - (void *) &buildstate, NULL); + &buildstate, NULL); /* * Perform the sort and build index pages. @@ -312,7 +312,7 @@ gistbuild(Relation heap, Relation index, IndexInfo *indexInfo) /* Scan the table, inserting all the tuples to the index. */ reltuples = table_index_build_scan(heap, index, indexInfo, true, true, gistBuildCallback, - (void *) &buildstate, NULL); + &buildstate, NULL); /* * If buffering was used, flush out all the tuples that are still in diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 5ce36093943..42c73ea5eb9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -173,7 +173,7 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) /* do the heap scan */ reltuples = table_index_build_scan(heap, index, indexInfo, true, true, hashbuildCallback, - (void *) &buildstate, NULL); + &buildstate, NULL); pgstat_progress_update_param(PROGRESS_CREATEIDX_TUPLES_TOTAL, buildstate.indtuples); diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 793bd33cb4d..485644f12d1 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -2453,7 +2453,7 @@ lazy_vacuum_one_index(Relation indrel, IndexBulkDeleteResult *istat, InvalidBlockNumber, InvalidOffsetNumber); /* Do bulk deletion */ - istat = vac_bulkdel_one_index(&ivinfo, istat, (void *) vacrel->dead_items, + istat = vac_bulkdel_one_index(&ivinfo, istat, vacrel->dead_items, vacrel->dead_items_info); /* Revert to the previous phase information for error traceback */ diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 484ede8c2e1..e9dacc9e8f2 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -566,7 +566,7 @@ btparallelrescan(IndexScanDesc scan) Assert(parallel_scan); - btscan = (BTParallelScanDesc) OffsetToPointer((void *) parallel_scan, + btscan = (BTParallelScanDesc) OffsetToPointer(parallel_scan, parallel_scan->ps_offset); /* @@ -645,7 +645,7 @@ _bt_parallel_seize(IndexScanDesc scan, BlockNumber *next_scan_page, return false; } - btscan = (BTParallelScanDesc) OffsetToPointer((void *) parallel_scan, + btscan = (BTParallelScanDesc) OffsetToPointer(parallel_scan, parallel_scan->ps_offset); while (1) @@ -736,7 +736,7 @@ _bt_parallel_release(IndexScanDesc scan, BlockNumber next_scan_page, ParallelIndexScanDesc parallel_scan = scan->parallel_scan; BTParallelScanDesc btscan; - btscan = (BTParallelScanDesc) OffsetToPointer((void *) parallel_scan, + btscan = (BTParallelScanDesc) OffsetToPointer(parallel_scan, parallel_scan->ps_offset); SpinLockAcquire(&btscan->btps_mutex); @@ -773,7 +773,7 @@ _bt_parallel_done(IndexScanDesc scan) if (so->needPrimScan) return; - btscan = (BTParallelScanDesc) OffsetToPointer((void *) parallel_scan, + btscan = (BTParallelScanDesc) OffsetToPointer(parallel_scan, parallel_scan->ps_offset); /* @@ -811,7 +811,7 @@ _bt_parallel_primscan_schedule(IndexScanDesc scan, BlockNumber curr_page) Assert(so->numArrayKeys); - btscan = (BTParallelScanDesc) OffsetToPointer((void *) parallel_scan, + btscan = (BTParallelScanDesc) OffsetToPointer(parallel_scan, parallel_scan->ps_offset); SpinLockAcquire(&btscan->btps_mutex); diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index fb9a05f7af1..17a352d040c 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -475,7 +475,7 @@ _bt_spools_heapscan(Relation heap, Relation index, BTBuildState *buildstate, /* Fill spool using either serial or parallel heap scan */ if (!buildstate->btleader) reltuples = table_index_build_scan(heap, index, indexInfo, true, true, - _bt_build_callback, (void *) buildstate, + _bt_build_callback, buildstate, NULL); else reltuples = _bt_parallel_heapscan(buildstate, @@ -1930,7 +1930,7 @@ _bt_parallel_scan_and_sort(BTSpool *btspool, BTSpool *btspool2, ParallelTableScanFromBTShared(btshared)); reltuples = table_index_build_scan(btspool->heap, btspool->index, indexInfo, true, progress, _bt_build_callback, - (void *) &buildstate, scan); + &buildstate, scan); /* Execute this worker's part of the sort */ if (progress) diff --git a/src/backend/access/spgist/spginsert.c b/src/backend/access/spgist/spginsert.c index 1bec19c2b88..305ced4dea7 100644 --- a/src/backend/access/spgist/spginsert.c +++ b/src/backend/access/spgist/spginsert.c @@ -122,7 +122,7 @@ spgbuild(Relation heap, Relation index, IndexInfo *indexInfo) ALLOCSET_DEFAULT_SIZES); reltuples = table_index_build_scan(heap, index, indexInfo, true, true, - spgistBuildCallback, (void *) &buildstate, + spgistBuildCallback, &buildstate, NULL); MemoryContextDelete(buildstate.tmpCtx); diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c index 72b7661971f..e93d9869b27 100644 --- a/src/backend/access/spgist/spgutils.c +++ b/src/backend/access/spgist/spgutils.c @@ -279,7 +279,7 @@ spgGetCache(Relation index) UnlockReleaseBuffer(metabuffer); } - index->rd_amcache = (void *) cache; + index->rd_amcache = cache; } else { diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 23dd0c6ef6e..49be1df91c1 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -747,7 +747,7 @@ pg_prepared_xact(PG_FUNCTION_ARGS) * out as a result set. */ status = (Working_State *) palloc(sizeof(Working_State)); - funcctx->user_fctx = (void *) status; + funcctx->user_fctx = status; status->ngxacts = GetPreparedTransactionList(&status->array); status->currIdx = 0; @@ -1707,8 +1707,7 @@ ProcessRecords(char *bufptr, TransactionId xid, bufptr += MAXALIGN(sizeof(TwoPhaseRecordOnDisk)); if (callbacks[record->rmid] != NULL) - callbacks[record->rmid] (xid, record->info, - (void *) bufptr, record->len); + callbacks[record->rmid] (xid, record->info, bufptr, record->len); bufptr += MAXALIGN(record->len); } diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 31caa49d6c3..8fe51ec4875 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -1924,7 +1924,7 @@ ApplyWalRecord(XLogReaderState *xlogreader, XLogRecord *record, TimeLineID *repl /* Setup error traceback support for ereport() */ errcallback.callback = rm_redo_error_callback; - errcallback.arg = (void *) xlogreader; + errcallback.arg = xlogreader; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -4832,7 +4832,7 @@ check_recovery_target_lsn(char **newval, void **extra, GucSource source) myextra = (XLogRecPtr *) guc_malloc(ERROR, sizeof(XLogRecPtr)); *myextra = lsn; - *extra = (void *) myextra; + *extra = myextra; } return true; } @@ -4996,7 +4996,7 @@ check_recovery_target_timeline(char **newval, void **extra, GucSource source) myextra = (RecoveryTargetTimeLineGoal *) guc_malloc(ERROR, sizeof(RecoveryTargetTimeLineGoal)); *myextra = rttg; - *extra = (void *) myextra; + *extra = myextra; return true; } @@ -5032,7 +5032,7 @@ check_recovery_target_xid(char **newval, void **extra, GucSource source) myextra = (TransactionId *) guc_malloc(ERROR, sizeof(TransactionId)); *myextra = xid; - *extra = (void *) myextra; + *extra = myextra; } return true; } diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index 0489cbabcb8..2afc550540c 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -2240,7 +2240,7 @@ find_expr_references_walker(Node *node, context->rtables = lcons(query->rtable, context->rtables); result = query_tree_walker(query, find_expr_references_walker, - (void *) context, + context, QTW_IGNORE_JOINALIASES | QTW_EXAMINE_SORTGROUP); context->rtables = list_delete_first(context->rtables); @@ -2310,7 +2310,7 @@ find_expr_references_walker(Node *node, } return expression_tree_walker(node, find_expr_references_walker, - (void *) context); + context); } /* diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index c54a543c536..cd1c136022c 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -2731,7 +2731,7 @@ check_nested_generated_walker(Node *node, void *context) } else return expression_tree_walker(node, check_nested_generated_walker, - (void *) context); + context); } static void diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 74d0f3097eb..09ed631685e 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -3379,7 +3379,7 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) /* ambulkdelete updates progress metrics */ (void) index_bulk_delete(&ivinfo, NULL, - validate_index_callback, (void *) &state); + validate_index_callback, &state); /* Execute the sort */ { diff --git a/src/backend/catalog/objectaccess.c b/src/backend/catalog/objectaccess.c index 0e606ddd895..39b180ddf50 100644 --- a/src/backend/catalog/objectaccess.c +++ b/src/backend/catalog/objectaccess.c @@ -42,7 +42,7 @@ RunObjectPostCreateHook(Oid classId, Oid objectId, int subId, (*object_access_hook) (OAT_POST_CREATE, classId, objectId, subId, - (void *) &pc_arg); + &pc_arg); } /* @@ -64,7 +64,7 @@ RunObjectDropHook(Oid classId, Oid objectId, int subId, (*object_access_hook) (OAT_DROP, classId, objectId, subId, - (void *) &drop_arg); + &drop_arg); } /* @@ -103,7 +103,7 @@ RunObjectPostAlterHook(Oid classId, Oid objectId, int subId, (*object_access_hook) (OAT_POST_ALTER, classId, objectId, subId, - (void *) &pa_arg); + &pa_arg); } /* @@ -125,7 +125,7 @@ RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation) (*object_access_hook) (OAT_NAMESPACE_SEARCH, NamespaceRelationId, objectId, 0, - (void *) &ns_arg); + &ns_arg); return ns_arg.result; } @@ -168,7 +168,7 @@ RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId, (*object_access_hook_str) (OAT_POST_CREATE, classId, objectName, subId, - (void *) &pc_arg); + &pc_arg); } /* @@ -190,7 +190,7 @@ RunObjectDropHookStr(Oid classId, const char *objectName, int subId, (*object_access_hook_str) (OAT_DROP, classId, objectName, subId, - (void *) &drop_arg); + &drop_arg); } /* @@ -229,7 +229,7 @@ RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId, (*object_access_hook_str) (OAT_POST_ALTER, classId, objectName, subId, - (void *) &pa_arg); + &pa_arg); } /* @@ -251,7 +251,7 @@ RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation) (*object_access_hook_str) (OAT_NAMESPACE_SEARCH, NamespaceRelationId, objectName, 0, - (void *) &ns_arg); + &ns_arg); return ns_arg.result; } diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c index 528c17cd7f6..79a6db08c45 100644 --- a/src/backend/catalog/pg_proc.c +++ b/src/backend/catalog/pg_proc.c @@ -873,7 +873,7 @@ fmgr_sql_validator(PG_FUNCTION_ARGS) callback_arg.prosrc = prosrc; sqlerrcontext.callback = sql_function_parse_error_callback; - sqlerrcontext.arg = (void *) &callback_arg; + sqlerrcontext.arg = &callback_arg; sqlerrcontext.previous = error_context_stack; error_context_stack = &sqlerrcontext; diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c index 7e5e357fd9e..5dabb48d282 100644 --- a/src/backend/catalog/pg_publication.c +++ b/src/backend/catalog/pg_publication.c @@ -1139,7 +1139,7 @@ pg_get_publication_tables(PG_FUNCTION_ARGS) PG_NODE_TREEOID, -1, 0); funcctx->tuple_desc = BlessTupleDesc(tupdesc); - funcctx->user_fctx = (void *) table_infos; + funcctx->user_fctx = table_infos; MemoryContextSwitchTo(oldcontext); } diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c index 07cbd5d22b8..2126d0ad8de 100644 --- a/src/backend/commands/copyfrom.c +++ b/src/backend/commands/copyfrom.c @@ -959,7 +959,7 @@ CopyFrom(CopyFromState cstate) /* Set up callback to identify error line number */ errcallback.callback = CopyFromErrorCallback; - errcallback.arg = (void *) cstate; + errcallback.arg = cstate; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c index cf61bbac1fa..dd1489518c3 100644 --- a/src/backend/commands/foreigncmds.c +++ b/src/backend/commands/foreigncmds.c @@ -1532,7 +1532,7 @@ ImportForeignSchema(ImportForeignSchemaStmt *stmt) callback_arg.tablename = NULL; /* not known yet */ callback_arg.cmd = cmd; sqlerrcontext.callback = import_error_callback; - sqlerrcontext.arg = (void *) &callback_arg; + sqlerrcontext.arg = &callback_arg; sqlerrcontext.previous = error_context_stack; error_context_stack = &sqlerrcontext; diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 2f652463e3c..28b3b45b342 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -3337,7 +3337,7 @@ ReindexPartitions(const ReindexStmt *stmt, Oid relid, const ReindexParams *param errinfo.relnamespace = pstrdup(relnamespace); errinfo.relkind = relkind; errcallback.callback = reindex_error_callback; - errcallback.arg = (void *) &errinfo; + errcallback.arg = &errinfo; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index cd20ae76bad..76d0b06183d 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -54,7 +54,7 @@ LockTableCommand(LockStmt *lockstmt) reloid = RangeVarGetRelidExtended(rv, lockstmt->mode, lockstmt->nowait ? RVR_NOWAIT : 0, RangeVarCallbackForLockTable, - (void *) &lockstmt->mode); + &lockstmt->mode); if (get_rel_relkind(reloid) == RELKIND_VIEW) LockViewRecurse(reloid, lockstmt->mode, lockstmt->nowait, NIL); diff --git a/src/backend/commands/policy.c b/src/backend/commands/policy.c index 6ff3eba8249..7b7b3d72c55 100644 --- a/src/backend/commands/policy.c +++ b/src/backend/commands/policy.c @@ -627,7 +627,7 @@ CreatePolicy(CreatePolicyStmt *stmt) table_id = RangeVarGetRelidExtended(stmt->table, AccessExclusiveLock, 0, RangeVarCallbackForPolicy, - (void *) stmt); + stmt); /* Open target_table to build quals. No additional lock is necessary. */ target_table = relation_open(table_id, NoLock); @@ -803,7 +803,7 @@ AlterPolicy(AlterPolicyStmt *stmt) table_id = RangeVarGetRelidExtended(stmt->table, AccessExclusiveLock, 0, RangeVarCallbackForPolicy, - (void *) stmt); + stmt); target_table = relation_open(table_id, NoLock); @@ -1108,7 +1108,7 @@ rename_policy(RenameStmt *stmt) table_id = RangeVarGetRelidExtended(stmt->relation, AccessExclusiveLock, 0, RangeVarCallbackForPolicy, - (void *) stmt); + stmt); target_table = relation_open(table_id, NoLock); diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index d6ffef374ea..61b15bce600 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -245,7 +245,7 @@ contain_invalid_rfcolumn_walker(Node *node, rf_context *context) } return expression_tree_walker(node, contain_invalid_rfcolumn_walker, - (void *) context); + context); } /* @@ -559,7 +559,7 @@ check_simple_rowfilter_expr_walker(Node *node, ParseState *pstate) if (exprType(node) >= FirstNormalObjectId) errdetail_msg = _("User-defined types are not allowed."); else if (check_functions_in_node(node, contain_mutable_or_user_functions_checker, - (void *) pstate)) + pstate)) errdetail_msg = _("User-defined or built-in mutable functions are not allowed."); else if (exprCollation(node) >= FirstNormalObjectId || exprInputCollation(node) >= FirstNormalObjectId) @@ -578,7 +578,7 @@ check_simple_rowfilter_expr_walker(Node *node, ParseState *pstate) parser_errposition(pstate, exprLocation(node)))); return expression_tree_walker(node, check_simple_rowfilter_expr_walker, - (void *) pstate); + pstate); } /* diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index e14bc0c0548..d04b0b2cfee 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -1560,7 +1560,7 @@ RemoveRelations(DropStmt *drop) relOid = RangeVarGetRelidExtended(rel, lockmode, RVR_MISSING_OK, RangeVarCallbackForDropRelation, - (void *) &state); + &state); /* Not there? */ if (!OidIsValid(relOid)) @@ -4089,7 +4089,7 @@ RenameRelation(RenameStmt *stmt) relid = RangeVarGetRelidExtended(stmt->relation, lockmode, stmt->missing_ok ? RVR_MISSING_OK : 0, RangeVarCallbackForAlterRelation, - (void *) stmt); + stmt); if (!OidIsValid(relid)) { @@ -4337,7 +4337,7 @@ AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode) return RangeVarGetRelidExtended(stmt->relation, lockmode, stmt->missing_ok ? RVR_MISSING_OK : 0, RangeVarCallbackForAlterRelation, - (void *) stmt); + stmt); } /* @@ -17301,7 +17301,7 @@ AlterTableNamespace(AlterObjectSchemaStmt *stmt, Oid *oldschema) relid = RangeVarGetRelidExtended(stmt->relation, AccessExclusiveLock, stmt->missing_ok ? RVR_MISSING_OK : 0, RangeVarCallbackForAlterRelation, - (void *) stmt); + stmt); if (!OidIsValid(relid)) { @@ -19942,7 +19942,7 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name) partIdxId = RangeVarGetRelidExtended(name, AccessExclusiveLock, 0, RangeVarCallbackForAttachIndex, - (void *) &state); + &state); /* Not there? */ if (!OidIsValid(partIdxId)) ereport(ERROR, diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 00c1ed19fdf..8ebbd935b0c 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -1290,7 +1290,7 @@ check_temp_tablespaces(char **newval, void **extra, GucSource source) return false; myextra->numSpcs = numSpcs; memcpy(myextra->tblSpcs, tblSpcs, numSpcs * sizeof(Oid)); - *extra = (void *) myextra; + *extra = myextra; pfree(tblSpcs); } diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 2a6550de907..2b1da8b1d41 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -3558,7 +3558,7 @@ domainAddCheckConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, domVal->location = -1; /* will be set when/if used */ pstate->p_pre_columnref_hook = replace_domain_constraint_value; - pstate->p_ref_hook_state = (void *) domVal; + pstate->p_ref_hook_state = domVal; expr = transformExpr(pstate, constr->raw_expr, EXPR_KIND_DOMAIN_CHECK); diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 86f36b36954..9e173f6b2de 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -2517,7 +2517,7 @@ vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, { /* Do bulk deletion */ istat = index_bulk_delete(ivinfo, istat, vac_tid_reaped, - (void *) dead_items); + dead_items); ereport(ivinfo->message_level, (errmsg("scanned index \"%s\" to remove %lld row versions", diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 7df26942aff..29490b3868a 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -232,7 +232,7 @@ check_datestyle(char **newval, void **extra, GucSource source) return false; myextra[0] = newDateStyle; myextra[1] = newDateOrder; - *extra = (void *) myextra; + *extra = myextra; return true; } @@ -887,7 +887,7 @@ check_session_authorization(char **newval, void **extra, GucSource source) return false; myextra->roleid = roleid; myextra->is_superuser = is_superuser; - *extra = (void *) myextra; + *extra = myextra; return true; } @@ -996,7 +996,7 @@ check_role(char **newval, void **extra, GucSource source) return false; myextra->roleid = roleid; myextra->is_superuser = is_superuser; - *extra = (void *) myextra; + *extra = myextra; return true; } diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index 45954d979f6..4aaa073e38d 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -2908,8 +2908,7 @@ expr_setup_walker(Node *node, ExprSetupInfo *info) return false; if (IsA(node, GroupingFunc)) return false; - return expression_tree_walker(node, expr_setup_walker, - (void *) info); + return expression_tree_walker(node, expr_setup_walker, info); } /* diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index 6a7f18f6ded..d2b9989d081 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -281,44 +281,44 @@ ExecReadyInterpretedExpr(ExprState *state) if (step0 == EEOP_INNER_FETCHSOME && step1 == EEOP_INNER_VAR) { - state->evalfunc_private = (void *) ExecJustInnerVar; + state->evalfunc_private = ExecJustInnerVar; return; } else if (step0 == EEOP_OUTER_FETCHSOME && step1 == EEOP_OUTER_VAR) { - state->evalfunc_private = (void *) ExecJustOuterVar; + state->evalfunc_private = ExecJustOuterVar; return; } else if (step0 == EEOP_SCAN_FETCHSOME && step1 == EEOP_SCAN_VAR) { - state->evalfunc_private = (void *) ExecJustScanVar; + state->evalfunc_private = ExecJustScanVar; return; } else if (step0 == EEOP_INNER_FETCHSOME && step1 == EEOP_ASSIGN_INNER_VAR) { - state->evalfunc_private = (void *) ExecJustAssignInnerVar; + state->evalfunc_private = ExecJustAssignInnerVar; return; } else if (step0 == EEOP_OUTER_FETCHSOME && step1 == EEOP_ASSIGN_OUTER_VAR) { - state->evalfunc_private = (void *) ExecJustAssignOuterVar; + state->evalfunc_private = ExecJustAssignOuterVar; return; } else if (step0 == EEOP_SCAN_FETCHSOME && step1 == EEOP_ASSIGN_SCAN_VAR) { - state->evalfunc_private = (void *) ExecJustAssignScanVar; + state->evalfunc_private = ExecJustAssignScanVar; return; } else if (step0 == EEOP_CASE_TESTVAL && step1 == EEOP_FUNCEXPR_STRICT && state->steps[0].d.casetest.value) { - state->evalfunc_private = (void *) ExecJustApplyFuncToCase; + state->evalfunc_private = ExecJustApplyFuncToCase; return; } } @@ -328,37 +328,37 @@ ExecReadyInterpretedExpr(ExprState *state) if (step0 == EEOP_CONST) { - state->evalfunc_private = (void *) ExecJustConst; + state->evalfunc_private = ExecJustConst; return; } else if (step0 == EEOP_INNER_VAR) { - state->evalfunc_private = (void *) ExecJustInnerVarVirt; + state->evalfunc_private = ExecJustInnerVarVirt; return; } else if (step0 == EEOP_OUTER_VAR) { - state->evalfunc_private = (void *) ExecJustOuterVarVirt; + state->evalfunc_private = ExecJustOuterVarVirt; return; } else if (step0 == EEOP_SCAN_VAR) { - state->evalfunc_private = (void *) ExecJustScanVarVirt; + state->evalfunc_private = ExecJustScanVarVirt; return; } else if (step0 == EEOP_ASSIGN_INNER_VAR) { - state->evalfunc_private = (void *) ExecJustAssignInnerVarVirt; + state->evalfunc_private = ExecJustAssignInnerVarVirt; return; } else if (step0 == EEOP_ASSIGN_OUTER_VAR) { - state->evalfunc_private = (void *) ExecJustAssignOuterVarVirt; + state->evalfunc_private = ExecJustAssignOuterVarVirt; return; } else if (step0 == EEOP_ASSIGN_SCAN_VAR) { - state->evalfunc_private = (void *) ExecJustAssignScanVarVirt; + state->evalfunc_private = ExecJustAssignScanVarVirt; return; } } @@ -379,7 +379,7 @@ ExecReadyInterpretedExpr(ExprState *state) state->flags |= EEO_FLAG_DIRECT_THREADED; #endif /* EEO_USE_COMPUTED_GOTO */ - state->evalfunc_private = (void *) ExecInterpExpr; + state->evalfunc_private = ExecInterpExpr; } @@ -2214,7 +2214,7 @@ get_cached_rowtype(Oid type_id, int32 typmod, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("type %s is not composite", format_type_be(type_id)))); - rowcache->cacheptr = (void *) typentry; + rowcache->cacheptr = typentry; rowcache->tupdesc_id = typentry->tupDesc_identifier; if (changed) *changed = true; @@ -2239,7 +2239,7 @@ get_cached_rowtype(Oid type_id, int32 typmod, tupDesc = lookup_rowtype_tupdesc(type_id, typmod); /* Drop pin acquired by lookup_rowtype_tupdesc */ ReleaseTupleDesc(tupDesc); - rowcache->cacheptr = (void *) tupDesc; + rowcache->cacheptr = tupDesc; rowcache->tupdesc_id = 0; /* not a valid value for non-RECORD */ if (changed) *changed = true; diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c index f9a2fac79e4..f0a5f8879a9 100644 --- a/src/backend/executor/execIndexing.c +++ b/src/backend/executor/execIndexing.c @@ -1130,7 +1130,7 @@ index_expression_changed_walker(Node *node, Bitmapset *allUpdatedCols) } return expression_tree_walker(node, index_expression_changed_walker, - (void *) allUpdatedCols); + allUpdatedCols); } /* diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 692854e2b3e..4d30a2c2154 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -268,7 +268,7 @@ sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo) pstate->p_post_columnref_hook = sql_fn_post_column_ref; pstate->p_paramref_hook = sql_fn_param_ref; /* no need to use p_coerce_param_hook */ - pstate->p_ref_hook_state = (void *) pinfo; + pstate->p_ref_hook_state = pinfo; } /* @@ -614,7 +614,7 @@ init_sql_fcache(FunctionCallInfo fcinfo, Oid collation, bool lazyEvalOK) */ fcache = (SQLFunctionCachePtr) palloc0(sizeof(SQLFunctionCache)); fcache->fcontext = fcontext; - finfo->fn_extra = (void *) fcache; + finfo->fn_extra = fcache; /* * get the procedure tuple corresponding to the given function Oid diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 53ead77ece8..84d33fdebc6 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -1088,7 +1088,7 @@ finalize_aggregate(AggState *aggstate, InitFunctionCallInfoData(*fcinfo, &peragg->finalfn, numFinalArgs, pertrans->aggCollation, - (void *) aggstate, NULL); + (Node *) aggstate, NULL); /* Fill in the transition state value */ fcinfo->args[0].value = @@ -1440,12 +1440,11 @@ find_cols_walker(Node *node, FindColsContext *context) { Assert(!context->is_aggref); context->is_aggref = true; - expression_tree_walker(node, find_cols_walker, (void *) context); + expression_tree_walker(node, find_cols_walker, context); context->is_aggref = false; return false; } - return expression_tree_walker(node, find_cols_walker, - (void *) context); + return expression_tree_walker(node, find_cols_walker, context); } /* @@ -4101,7 +4100,7 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, &pertrans->transfn, numTransArgs, pertrans->aggCollation, - (void *) aggstate, NULL); + (Node *) aggstate, NULL); /* get info about the state value's datatype */ get_typlenbyval(aggtranstype, @@ -4121,7 +4120,7 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, &pertrans->serialfn, 1, InvalidOid, - (void *) aggstate, NULL); + (Node *) aggstate, NULL); } if (OidIsValid(aggdeserialfn)) @@ -4137,7 +4136,7 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, &pertrans->deserialfn, 2, InvalidOid, - (void *) aggstate, NULL); + (Node *) aggstate, NULL); } /* diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c index 3fc925d7b48..760f2d8e8f3 100644 --- a/src/backend/executor/nodeSort.c +++ b/src/backend/executor/nodeSort.c @@ -122,7 +122,7 @@ ExecSort(PlanState *pstate) tuplesortopts); if (node->bounded) tuplesort_set_bound(tuplesortstate, node->bound); - node->tuplesortstate = (void *) tuplesortstate; + node->tuplesortstate = tuplesortstate; /* * Scan the subplan and feed all the tuples to tuplesort using the diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 51a6708a392..e75e8576725 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -339,7 +339,7 @@ advance_windowaggregate(WindowAggState *winstate, InitFunctionCallInfoData(*fcinfo, &(peraggstate->transfn), numArguments + 1, perfuncstate->winCollation, - (void *) winstate, NULL); + (Node *) winstate, NULL); fcinfo->args[0].value = peraggstate->transValue; fcinfo->args[0].isnull = peraggstate->transValueIsNull; winstate->curaggcontext = peraggstate->aggcontext; @@ -510,7 +510,7 @@ advance_windowaggregate_base(WindowAggState *winstate, InitFunctionCallInfoData(*fcinfo, &(peraggstate->invtransfn), numArguments + 1, perfuncstate->winCollation, - (void *) winstate, NULL); + (Node *) winstate, NULL); fcinfo->args[0].value = peraggstate->transValue; fcinfo->args[0].isnull = peraggstate->transValueIsNull; winstate->curaggcontext = peraggstate->aggcontext; @@ -601,7 +601,7 @@ finalize_windowaggregate(WindowAggState *winstate, InitFunctionCallInfoData(fcinfodata.fcinfo, &(peraggstate->finalfn), numFinalArgs, perfuncstate->winCollation, - (void *) winstate, NULL); + (Node *) winstate, NULL); fcinfo->args[0].value = MakeExpandedObjectReadOnly(peraggstate->transValue, peraggstate->transValueIsNull, @@ -1047,7 +1047,7 @@ eval_windowfunction(WindowAggState *winstate, WindowStatePerFunc perfuncstate, InitFunctionCallInfoData(*fcinfo, &(perfuncstate->flinfo), perfuncstate->numArguments, perfuncstate->winCollation, - (void *) perfuncstate->winobj, NULL); + (Node *) perfuncstate->winobj, NULL); /* Just in case, make all the regular argument slots be null */ for (int argno = 0; argno < perfuncstate->numArguments; argno++) fcinfo->args[argno].isnull = true; diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 2fd96a71294..3104b871cf1 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -702,7 +702,7 @@ tokenize_auth_file(const char *filename, FILE *file, List **tok_lines, callback_arg.linenum = line_number; tokenerrcontext.callback = tokenize_error_callback; - tokenerrcontext.arg = (void *) &callback_arg; + tokenerrcontext.arg = &callback_arg; tokenerrcontext.previous = error_context_stack; error_context_stack = &tokenerrcontext; diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index f76072228c9..c85d63bbc63 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -2021,7 +2021,7 @@ check_functions_in_node(Node *node, check_function_callback checker, * ... do special actions for other node types * } * // for any node type not specially processed, do: - * return expression_tree_walker(node, my_walker, (void *) context); + * return expression_tree_walker(node, my_walker, context); * } * * The "context" argument points to a struct that holds whatever context @@ -2894,7 +2894,7 @@ range_table_entry_walker_impl(RangeTblEntry *rte, * ... do special transformations of other node types * } * // for any node type not specially processed, do: - * return expression_tree_mutator(node, my_mutator, (void *) context); + * return expression_tree_mutator(node, my_mutator, context); * } * * The "context" argument points to a struct that holds whatever context diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index cf54ffbe0d9..3acc7508e71 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -55,7 +55,7 @@ makeParamList(int numParams) retval->paramCompile = NULL; retval->paramCompileArg = NULL; retval->parserSetup = paramlist_parser_setup; - retval->parserSetupArg = (void *) retval; + retval->parserSetupArg = retval; retval->paramValuesStr = NULL; retval->numParams = numParams; diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c index 190099e5cf3..27d3aa806ec 100644 --- a/src/backend/nodes/read.c +++ b/src/backend/nodes/read.c @@ -507,5 +507,5 @@ nodeRead(const char *token, int tok_len) break; } - return (void *) result; + return result; } diff --git a/src/backend/optimizer/geqo/geqo_main.c b/src/backend/optimizer/geqo/geqo_main.c index 0c5540e2af4..aee2a83d7eb 100644 --- a/src/backend/optimizer/geqo/geqo_main.c +++ b/src/backend/optimizer/geqo/geqo_main.c @@ -99,7 +99,7 @@ geqo(PlannerInfo *root, int number_of_rels, List *initial_rels) #endif /* set up private information */ - root->join_search_private = (void *) &private; + root->join_search_private = &private; private.initial_rels = initial_rels; /* initialize private number generator */ diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 2bb6db1df77..c36687aa4df 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -5029,8 +5029,7 @@ cost_qual_eval_walker(Node *node, cost_qual_eval_context *context) } /* recurse into children */ - return expression_tree_walker(node, cost_qual_eval_walker, - (void *) context); + return expression_tree_walker(node, cost_qual_eval_walker, context); } /* diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index c0fcc7d78df..4e4f190c601 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -2030,7 +2030,7 @@ match_eclass_clauses_to_index(PlannerInfo *root, IndexOptInfo *index, clauses = generate_implied_equalities_for_column(root, index->rel, ec_member_matches_indexcol, - (void *) &arg, + &arg, index->rel->lateral_referencers); /* diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index f2ed0d81f61..178c572b021 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -5037,9 +5037,7 @@ replace_nestloop_params_mutator(Node *node, PlannerInfo *root) /* Replace the PlaceHolderVar with a nestloop Param */ return (Node *) replace_nestloop_param_placeholdervar(root, phv); } - return expression_tree_mutator(node, - replace_nestloop_params_mutator, - (void *) root); + return expression_tree_mutator(node, replace_nestloop_params_mutator, root); } /* diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 91c7c4fe2fe..6d23df108da 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -485,7 +485,7 @@ flatten_unplanned_rtes(PlannerGlobal *glob, RangeTblEntry *rte) /* Use query_tree_walker to find all RTEs in the parse tree */ (void) query_tree_walker(rte->subquery, flatten_rtes_walker, - (void *) &cxt, + &cxt, QTW_EXAMINE_RTES_BEFORE); } @@ -516,13 +516,12 @@ flatten_rtes_walker(Node *node, flatten_rtes_walker_context *cxt) cxt->query = (Query *) node; result = query_tree_walker((Query *) node, flatten_rtes_walker, - (void *) cxt, + cxt, QTW_EXAMINE_RTES_BEFORE); cxt->query = save_query; return result; } - return expression_tree_walker(node, flatten_rtes_walker, - (void *) cxt); + return expression_tree_walker(node, flatten_rtes_walker, cxt); } /* @@ -2243,8 +2242,7 @@ fix_scan_expr_mutator(Node *node, fix_scan_expr_context *context) context->num_exec), context); fix_expr_common(context->root, node); - return expression_tree_mutator(node, fix_scan_expr_mutator, - (void *) context); + return expression_tree_mutator(node, fix_scan_expr_mutator, context); } static bool @@ -2256,8 +2254,7 @@ fix_scan_expr_walker(Node *node, fix_scan_expr_context *context) Assert(!IsA(node, PlaceHolderVar)); Assert(!IsA(node, AlternativeSubPlan)); fix_expr_common(context->root, node); - return expression_tree_walker(node, fix_scan_expr_walker, - (void *) context); + return expression_tree_walker(node, fix_scan_expr_walker, context); } /* @@ -2612,8 +2609,7 @@ convert_combining_aggrefs(Node *node, void *context) return (Node *) parent_agg; } - return expression_tree_mutator(node, convert_combining_aggrefs, - (void *) context); + return expression_tree_mutator(node, convert_combining_aggrefs, context); } /* @@ -3165,9 +3161,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context) context->num_exec), context); fix_expr_common(context->root, node); - return expression_tree_mutator(node, - fix_join_expr_mutator, - (void *) context); + return expression_tree_mutator(node, fix_join_expr_mutator, context); } /* @@ -3292,9 +3286,7 @@ fix_upper_expr_mutator(Node *node, fix_upper_expr_context *context) context->num_exec), context); fix_expr_common(context->root, node); - return expression_tree_mutator(node, - fix_upper_expr_mutator, - (void *) context); + return expression_tree_mutator(node, fix_upper_expr_mutator, context); } /* @@ -3390,7 +3382,7 @@ fix_windowagg_condition_expr_mutator(Node *node, return expression_tree_mutator(node, fix_windowagg_condition_expr_mutator, - (void *) context); + context); } /* @@ -3656,10 +3648,10 @@ extract_query_dependencies_walker(Node *node, PlannerInfo *context) /* And recurse into the query's subexpressions */ return query_tree_walker(query, extract_query_dependencies_walker, - (void *) context, 0); + context, 0); } /* Extract function dependencies and check for regclass Consts */ fix_expr_common(context, node); return expression_tree_walker(node, extract_query_dependencies_walker, - (void *) context); + context); } diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index 09d5f0f571b..ed62e3a0fcf 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -697,9 +697,7 @@ convert_testexpr_mutator(Node *node, */ return node; } - return expression_tree_mutator(node, - convert_testexpr_mutator, - (void *) context); + return expression_tree_mutator(node, convert_testexpr_mutator, context); } /* @@ -1121,14 +1119,13 @@ contain_outer_selfref_walker(Node *node, Index *depth) (*depth)++; result = query_tree_walker(query, contain_outer_selfref_walker, - (void *) depth, QTW_EXAMINE_RTES_BEFORE); + depth, QTW_EXAMINE_RTES_BEFORE); (*depth)--; return result; } - return expression_tree_walker(node, contain_outer_selfref_walker, - (void *) depth); + return expression_tree_walker(node, contain_outer_selfref_walker, depth); } /* @@ -1927,9 +1924,7 @@ replace_correlation_vars_mutator(Node *node, PlannerInfo *root) return (Node *) replace_outer_merge_support(root, (MergeSupportFunc *) node); } - return expression_tree_mutator(node, - replace_correlation_vars_mutator, - (void *) root); + return expression_tree_mutator(node, replace_correlation_vars_mutator, root); } /* @@ -2077,7 +2072,7 @@ process_sublinks_mutator(Node *node, process_sublinks_context *context) return expression_tree_mutator(node, process_sublinks_mutator, - (void *) &locContext); + &locContext); } /* @@ -2985,8 +2980,7 @@ finalize_primnode(Node *node, finalize_primnode_context *context) return false; /* no more to do here */ } - return expression_tree_walker(node, finalize_primnode, - (void *) context); + return expression_tree_walker(node, finalize_primnode, context); } /* @@ -3008,8 +3002,7 @@ finalize_agg_primnode(Node *node, finalize_primnode_context *context) finalize_primnode((Node *) agg->aggfilter, context); return false; /* there can't be any Aggrefs below here */ } - return expression_tree_walker(node, finalize_agg_primnode, - (void *) context); + return expression_tree_walker(node, finalize_agg_primnode, context); } /* diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c index 4606df379a8..e935c9d0943 100644 --- a/src/backend/optimizer/prep/prepagg.c +++ b/src/backend/optimizer/prep/prepagg.c @@ -359,8 +359,7 @@ preprocess_aggrefs_walker(Node *node, PlannerInfo *root) return false; } Assert(!IsA(node, SubLink)); - return expression_tree_walker(node, preprocess_aggrefs_walker, - (void *) root); + return expression_tree_walker(node, preprocess_aggrefs_walker, root); } diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index 4d7f972caf1..104cdbf40cb 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -2450,7 +2450,7 @@ pullup_replace_vars(Node *expr, pullup_replace_vars_context *context) return replace_rte_variables(expr, context->varno, 0, pullup_replace_vars_callback, - (void *) context, + context, context->outer_hasSubLinks); } @@ -2707,7 +2707,7 @@ pullup_replace_vars_subquery(Query *query, return (Query *) replace_rte_variables((Node *) query, context->varno, 1, pullup_replace_vars_callback, - (void *) context, + context, NULL); } @@ -3775,7 +3775,7 @@ find_dependent_phvs_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, find_dependent_phvs_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } @@ -3784,8 +3784,7 @@ find_dependent_phvs_walker(Node *node, Assert(!IsA(node, PlaceHolderInfo)); Assert(!IsA(node, MinMaxAggInfo)); - return expression_tree_walker(node, find_dependent_phvs_walker, - (void *) context); + return expression_tree_walker(node, find_dependent_phvs_walker, context); } static bool @@ -3800,15 +3799,12 @@ find_dependent_phvs(PlannerInfo *root, int varno) context.relids = bms_make_singleton(varno); context.sublevels_up = 0; - if (query_tree_walker(root->parse, - find_dependent_phvs_walker, - (void *) &context, - 0)) + if (query_tree_walker(root->parse, find_dependent_phvs_walker, &context, 0)) return true; /* The append_rel_list could be populated already, so check it too */ if (expression_tree_walker((Node *) root->append_rel_list, find_dependent_phvs_walker, - (void *) &context)) + &context)) return true; return false; } @@ -3847,10 +3843,7 @@ find_dependent_phvs_in_jointree(PlannerInfo *root, Node *node, int varno) RangeTblEntry *rte = rt_fetch(relid, root->parse->rtable); if (rte->lateral && - range_table_entry_walker(rte, - find_dependent_phvs_walker, - (void *) &context, - 0)) + range_table_entry_walker(rte, find_dependent_phvs_walker, &context, 0)) return true; } @@ -3907,7 +3900,7 @@ substitute_phv_relids_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, substitute_phv_relids_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } @@ -3917,8 +3910,7 @@ substitute_phv_relids_walker(Node *node, Assert(!IsA(node, PlaceHolderInfo)); Assert(!IsA(node, MinMaxAggInfo)); - return expression_tree_walker(node, substitute_phv_relids_walker, - (void *) context); + return expression_tree_walker(node, substitute_phv_relids_walker, context); } static void @@ -3935,7 +3927,7 @@ substitute_phv_relids(Node *node, int varno, Relids subrelids) */ query_or_expression_tree_walker(node, substitute_phv_relids_walker, - (void *) &context, + &context, 0); } diff --git a/src/backend/optimizer/util/appendinfo.c b/src/backend/optimizer/util/appendinfo.c index 49897226371..45e8b74f944 100644 --- a/src/backend/optimizer/util/appendinfo.c +++ b/src/backend/optimizer/util/appendinfo.c @@ -425,7 +425,7 @@ adjust_appendrel_attrs_mutator(Node *node, phv = (PlaceHolderVar *) expression_tree_mutator(node, adjust_appendrel_attrs_mutator, - (void *) context); + context); /* now fix PlaceHolderVar's relid sets */ if (phv->phlevelsup == 0) { @@ -509,8 +509,7 @@ adjust_appendrel_attrs_mutator(Node *node, Assert(!IsA(node, RangeTblRef)); Assert(!IsA(node, JoinExpr)); - return expression_tree_mutator(node, adjust_appendrel_attrs_mutator, - (void *) context); + return expression_tree_mutator(node, adjust_appendrel_attrs_mutator, context); } /* diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 8e39795e245..bb7a9b77280 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -265,8 +265,7 @@ find_window_functions_walker(Node *node, WindowFuncLists *lists) return false; } Assert(!IsA(node, SubLink)); - return expression_tree_walker(node, find_window_functions_walker, - (void *) lists); + return expression_tree_walker(node, find_window_functions_walker, lists); } @@ -1217,7 +1216,7 @@ contain_context_dependent_node_walker(Node *node, int *flags) *flags |= CCDN_CASETESTEXPR_OK; res = expression_tree_walker(node, contain_context_dependent_node_walker, - (void *) flags); + flags); *flags = save_flags; return res; } @@ -1241,7 +1240,7 @@ contain_context_dependent_node_walker(Node *node, int *flags) return res; } return expression_tree_walker(node, contain_context_dependent_node_walker, - (void *) flags); + flags); } /***************************************************************************** @@ -2416,7 +2415,7 @@ estimate_expression_value(PlannerInfo *root, Node *node) */ #define ece_generic_processing(node) \ expression_tree_mutator((Node *) (node), eval_const_expressions_mutator, \ - (void *) context) + context) /* * Check whether all arguments of the given node were reduced to Consts. @@ -2552,7 +2551,7 @@ eval_const_expressions_mutator(Node *node, args = (List *) expression_tree_mutator((Node *) args, eval_const_expressions_mutator, - (void *) context); + context); /* ... and the filter expression, which isn't */ aggfilter = (Expr *) eval_const_expressions_mutator((Node *) expr->aggfilter, @@ -2697,7 +2696,7 @@ eval_const_expressions_mutator(Node *node, */ args = (List *) expression_tree_mutator((Node *) expr->args, eval_const_expressions_mutator, - (void *) context); + context); /* * We must do our own check for NULLs because DistinctExpr has @@ -4094,7 +4093,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod, args = expand_function_arguments(args, false, result_type, func_tuple); args = (List *) expression_tree_mutator((Node *) args, eval_const_expressions_mutator, - (void *) context); + context); /* Argument processing done, give it back to the caller */ *args_p = args; } @@ -4636,7 +4635,7 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid, callback_arg.prosrc = src; sqlerrcontext.callback = sql_inline_error_callback; - sqlerrcontext.arg = (void *) &callback_arg; + sqlerrcontext.arg = &callback_arg; sqlerrcontext.previous = error_context_stack; error_context_stack = &sqlerrcontext; @@ -4938,8 +4937,7 @@ substitute_actual_parameters_mutator(Node *node, /* We don't need to copy at this time (it'll get done later) */ return list_nth(context->args, param->paramid - 1); } - return expression_tree_mutator(node, substitute_actual_parameters_mutator, - (void *) context); + return expression_tree_mutator(node, substitute_actual_parameters_mutator, context); } /* @@ -5190,7 +5188,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte) callback_arg.prosrc = src; sqlerrcontext.callback = sql_inline_error_callback; - sqlerrcontext.arg = (void *) &callback_arg; + sqlerrcontext.arg = &callback_arg; sqlerrcontext.previous = error_context_stack; error_context_stack = &sqlerrcontext; @@ -5382,7 +5380,7 @@ substitute_actual_srf_parameters_mutator(Node *node, context->sublevels_up++; result = (Node *) query_tree_mutator((Query *) node, substitute_actual_srf_parameters_mutator, - (void *) context, + context, 0); context->sublevels_up--; return result; @@ -5407,7 +5405,7 @@ substitute_actual_srf_parameters_mutator(Node *node, } return expression_tree_mutator(node, substitute_actual_srf_parameters_mutator, - (void *) context); + context); } /* @@ -5436,6 +5434,5 @@ pull_paramids_walker(Node *node, Bitmapset **context) *context = bms_add_member(*context, param->paramid); return false; } - return expression_tree_walker(node, pull_paramids_walker, - (void *) context); + return expression_tree_walker(node, pull_paramids_walker, context); } diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 50ea8077367..0a132610140 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -908,7 +908,7 @@ static void list_startup_fn(Node *clause, PredIterInfo info) { info->state_list = (List *) clause; - info->state = (void *) list_head(info->state_list); + info->state = list_head(info->state_list); } static Node * @@ -920,7 +920,7 @@ list_next_fn(PredIterInfo info) if (l == NULL) return NULL; n = lfirst(l); - info->state = (void *) lnext(info->state_list, l); + info->state = lnext(info->state_list, l); return n; } @@ -938,7 +938,7 @@ static void boolexpr_startup_fn(Node *clause, PredIterInfo info) { info->state_list = ((BoolExpr *) clause)->args; - info->state = (void *) list_head(info->state_list); + info->state = list_head(info->state_list); } /* @@ -968,7 +968,7 @@ arrayconst_startup_fn(Node *clause, PredIterInfo info) /* Create working state struct */ state = (ArrayConstIterState *) palloc(sizeof(ArrayConstIterState)); - info->state = (void *) state; + info->state = state; /* Deconstruct the array literal */ arrayconst = (Const *) lsecond(saop->args); @@ -1047,7 +1047,7 @@ arrayexpr_startup_fn(Node *clause, PredIterInfo info) /* Create working state struct */ state = (ArrayExprIterState *) palloc(sizeof(ArrayExprIterState)); - info->state = (void *) state; + info->state = state; /* Set up a dummy OpExpr to return as the per-item node */ state->opexpr.xpr.type = T_OpExpr; diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 7ef7f34d8b5..482350285a0 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -1139,8 +1139,7 @@ split_pathtarget_walker(Node *node, split_pathtarget_context *context) context->current_depth = 0; context->current_sgref = 0; /* subexpressions are not sortgroup items */ - (void) expression_tree_walker(node, split_pathtarget_walker, - (void *) context); + (void) expression_tree_walker(node, split_pathtarget_walker, context); /* Depth is one more than any SRF below it */ srf_depth = context->current_depth + 1; @@ -1181,8 +1180,7 @@ split_pathtarget_walker(Node *node, split_pathtarget_context *context) * examine its inputs. */ context->current_sgref = 0; /* subexpressions are not sortgroup items */ - return expression_tree_walker(node, split_pathtarget_walker, - (void *) context); + return expression_tree_walker(node, split_pathtarget_walker, context); } /* diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c index f7534ad53d6..5f721eb8e13 100644 --- a/src/backend/optimizer/util/var.c +++ b/src/backend/optimizer/util/var.c @@ -124,7 +124,7 @@ pull_varnos(PlannerInfo *root, Node *node) */ query_or_expression_tree_walker(node, pull_varnos_walker, - (void *) &context, + &context, 0); return context.varnos; @@ -150,7 +150,7 @@ pull_varnos_of_level(PlannerInfo *root, Node *node, int levelsup) */ query_or_expression_tree_walker(node, pull_varnos_walker, - (void *) &context, + &context, 0); return context.varnos; @@ -269,12 +269,11 @@ pull_varnos_walker(Node *node, pull_varnos_context *context) context->sublevels_up++; result = query_tree_walker((Query *) node, pull_varnos_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, pull_varnos_walker, - (void *) context); + return expression_tree_walker(node, pull_varnos_walker, context); } @@ -324,8 +323,7 @@ pull_varattnos_walker(Node *node, pull_varattnos_context *context) /* Should not find an unplanned subquery */ Assert(!IsA(node, Query)); - return expression_tree_walker(node, pull_varattnos_walker, - (void *) context); + return expression_tree_walker(node, pull_varattnos_walker, context); } @@ -350,7 +348,7 @@ pull_vars_of_level(Node *node, int levelsup) */ query_or_expression_tree_walker(node, pull_vars_walker, - (void *) &context, + &context, 0); return context.vars; @@ -385,12 +383,11 @@ pull_vars_walker(Node *node, pull_vars_context *context) context->sublevels_up++; result = query_tree_walker((Query *) node, pull_vars_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, pull_vars_walker, - (void *) context); + return expression_tree_walker(node, pull_vars_walker, context); } @@ -449,7 +446,7 @@ contain_vars_of_level(Node *node, int levelsup) return query_or_expression_tree_walker(node, contain_vars_of_level_walker, - (void *) &sublevels_up, + &sublevels_up, 0); } @@ -484,14 +481,14 @@ contain_vars_of_level_walker(Node *node, int *sublevels_up) (*sublevels_up)++; result = query_tree_walker((Query *) node, contain_vars_of_level_walker, - (void *) sublevels_up, + sublevels_up, 0); (*sublevels_up)--; return result; } return expression_tree_walker(node, contain_vars_of_level_walker, - (void *) sublevels_up); + sublevels_up); } @@ -520,7 +517,7 @@ locate_var_of_level(Node *node, int levelsup) (void) query_or_expression_tree_walker(node, locate_var_of_level_walker, - (void *) &context, + &context, 0); return context.var_location; @@ -558,14 +555,14 @@ locate_var_of_level_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, locate_var_of_level_walker, - (void *) context, + context, 0); context->sublevels_up--; return result; } return expression_tree_walker(node, locate_var_of_level_walker, - (void *) context); + context); } @@ -707,8 +704,7 @@ pull_var_clause_walker(Node *node, pull_var_clause_context *context) else elog(ERROR, "PlaceHolderVar found where not expected"); } - return expression_tree_walker(node, pull_var_clause_walker, - (void *) context); + return expression_tree_walker(node, pull_var_clause_walker, context); } @@ -867,7 +863,7 @@ flatten_join_alias_vars_mutator(Node *node, phv = (PlaceHolderVar *) expression_tree_mutator(node, flatten_join_alias_vars_mutator, - (void *) context); + context); /* now fix PlaceHolderVar's relid sets */ if (phv->phlevelsup == context->sublevels_up) { @@ -889,7 +885,7 @@ flatten_join_alias_vars_mutator(Node *node, context->inserted_sublink = ((Query *) node)->hasSubLinks; newnode = query_tree_mutator((Query *) node, flatten_join_alias_vars_mutator, - (void *) context, + context, QTW_IGNORE_JOINALIASES); newnode->hasSubLinks |= context->inserted_sublink; context->inserted_sublink = save_inserted_sublink; @@ -904,8 +900,7 @@ flatten_join_alias_vars_mutator(Node *node, Assert(!IsA(node, PlaceHolderInfo)); Assert(!IsA(node, MinMaxAggInfo)); - return expression_tree_mutator(node, flatten_join_alias_vars_mutator, - (void *) context); + return expression_tree_mutator(node, flatten_join_alias_vars_mutator, context); } /* @@ -1044,7 +1039,7 @@ flatten_group_exprs_mutator(Node *node, context->inserted_sublink = ((Query *) node)->hasSubLinks; newnode = query_tree_mutator((Query *) node, flatten_group_exprs_mutator, - (void *) context, + context, QTW_IGNORE_GROUPEXPRS); newnode->hasSubLinks |= context->inserted_sublink; context->inserted_sublink = save_inserted_sublink; @@ -1053,7 +1048,7 @@ flatten_group_exprs_mutator(Node *node, } return expression_tree_mutator(node, flatten_group_exprs_mutator, - (void *) context); + context); } /* diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 506e0631615..3864a675d2a 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -1687,7 +1687,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt) Node *col = (Node *) lfirst(lc); col = coerce_to_common_type(pstate, col, coltype, "VALUES"); - lfirst(lc) = (void *) col; + lfirst(lc) = col; } coltypmod = select_common_typmod(pstate, colexprs[i], coltype); diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c index efa730c1676..04b4596a65a 100644 --- a/src/backend/parser/parse_agg.c +++ b/src/backend/parser/parse_agg.c @@ -799,7 +799,7 @@ check_agg_arguments_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, check_agg_arguments_walker, - (void *) context, + context, 0); context->sublevels_up--; return result; @@ -807,7 +807,7 @@ check_agg_arguments_walker(Node *node, return expression_tree_walker(node, check_agg_arguments_walker, - (void *) context); + context); } /* @@ -1517,13 +1517,13 @@ substitute_grouped_columns_mutator(Node *node, context->sublevels_up++; newnode = query_tree_mutator((Query *) node, substitute_grouped_columns_mutator, - (void *) context, + context, 0); context->sublevels_up--; return (Node *) newnode; } return expression_tree_mutator(node, substitute_grouped_columns_mutator, - (void *) context); + context); } /* @@ -1691,13 +1691,13 @@ finalize_grouping_exprs_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, finalize_grouping_exprs_walker, - (void *) context, + context, 0); context->sublevels_up--; return result; } return expression_tree_walker(node, finalize_grouping_exprs_walker, - (void *) context); + context); } /* diff --git a/src/backend/parser/parse_collate.c b/src/backend/parser/parse_collate.c index 44529bb49e6..2874731c352 100644 --- a/src/backend/parser/parse_collate.c +++ b/src/backend/parser/parse_collate.c @@ -108,7 +108,7 @@ assign_query_collations(ParseState *pstate, Query *query) */ (void) query_tree_walker(query, assign_query_collations_walker, - (void *) pstate, + pstate, QTW_IGNORE_RANGE_TABLE | QTW_IGNORE_CTE_SUBQUERIES); } @@ -295,7 +295,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); collation = expr->collOid; Assert(OidIsValid(collation)); @@ -317,7 +317,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) /* ... but first, recurse */ (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); if (OidIsValid(expr->resultcollid)) { @@ -403,7 +403,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) /* ... but first, recurse */ (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); if (OidIsValid(typcollation)) { @@ -444,7 +444,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) case T_TargetEntry: (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); /* * TargetEntry can have only one child, and should bubble that @@ -488,7 +488,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) case T_MergeAction: (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); /* * When we're invoked on a query's jointree, we don't need to do @@ -528,7 +528,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) case T_List: (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); /* * When processing a list, collation state just bubbles up from @@ -699,7 +699,7 @@ assign_collations_walker(Node *node, assign_collations_context *context) */ (void) expression_tree_walker(node, assign_collations_walker, - (void *) &loccontext); + &loccontext); break; } diff --git a/src/backend/parser/parse_cte.c b/src/backend/parser/parse_cte.c index de9ae9b4834..76a00810292 100644 --- a/src/backend/parser/parse_cte.c +++ b/src/backend/parser/parse_cte.c @@ -746,7 +746,7 @@ makeDependencyGraphWalker(Node *node, CteState *cstate) } (void) raw_expression_tree_walker(node, makeDependencyGraphWalker, - (void *) cstate); + cstate); cstate->innerwiths = list_delete_first(cstate->innerwiths); } else @@ -768,7 +768,7 @@ makeDependencyGraphWalker(Node *node, CteState *cstate) } (void) raw_expression_tree_walker(node, makeDependencyGraphWalker, - (void *) cstate); + cstate); cstate->innerwiths = list_delete_first(cstate->innerwiths); } /* We're done examining the SelectStmt */ @@ -787,7 +787,7 @@ makeDependencyGraphWalker(Node *node, CteState *cstate) } return raw_expression_tree_walker(node, makeDependencyGraphWalker, - (void *) cstate); + cstate); } /* @@ -1130,7 +1130,7 @@ checkWellFormedRecursionWalker(Node *node, CteState *cstate) } return raw_expression_tree_walker(node, checkWellFormedRecursionWalker, - (void *) cstate); + cstate); } /* @@ -1147,7 +1147,7 @@ checkWellFormedSelectStmt(SelectStmt *stmt, CteState *cstate) /* just recurse without changing state */ raw_expression_tree_walker((Node *) stmt, checkWellFormedRecursionWalker, - (void *) cstate); + cstate); } else { @@ -1157,7 +1157,7 @@ checkWellFormedSelectStmt(SelectStmt *stmt, CteState *cstate) case SETOP_UNION: raw_expression_tree_walker((Node *) stmt, checkWellFormedRecursionWalker, - (void *) cstate); + cstate); break; case SETOP_INTERSECT: if (stmt->all) diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index 9361b5252d8..bdaeb90d2e2 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -144,7 +144,7 @@ setup_parser_errposition_callback(ParseCallbackState *pcbstate, pcbstate->pstate = pstate; pcbstate->location = location; pcbstate->errcallback.callback = pcb_error_callback; - pcbstate->errcallback.arg = (void *) pcbstate; + pcbstate->errcallback.arg = pcbstate; pcbstate->errcallback.previous = error_context_stack; error_context_stack = &pcbstate->errcallback; } diff --git a/src/backend/parser/parse_param.c b/src/backend/parser/parse_param.c index b617591ef68..1ec6c920fbc 100644 --- a/src/backend/parser/parse_param.c +++ b/src/backend/parser/parse_param.c @@ -72,7 +72,7 @@ setup_parse_fixed_parameters(ParseState *pstate, parstate->paramTypes = paramTypes; parstate->numParams = numParams; - pstate->p_ref_hook_state = (void *) parstate; + pstate->p_ref_hook_state = parstate; pstate->p_paramref_hook = fixed_paramref_hook; /* no need to use p_coerce_param_hook */ } @@ -88,7 +88,7 @@ setup_parse_variable_parameters(ParseState *pstate, parstate->paramTypes = paramTypes; parstate->numParams = numParams; - pstate->p_ref_hook_state = (void *) parstate; + pstate->p_ref_hook_state = parstate; pstate->p_paramref_hook = variable_paramref_hook; pstate->p_coerce_param_hook = variable_coerce_param_hook; } @@ -274,7 +274,7 @@ check_variable_parameters(ParseState *pstate, Query *query) if (*parstate->numParams > 0) (void) query_tree_walker(query, check_parameter_resolution_walker, - (void *) pstate, 0); + pstate, 0); } /* @@ -318,10 +318,10 @@ check_parameter_resolution_walker(Node *node, ParseState *pstate) /* Recurse into RTE subquery or not-yet-planned sublink subquery */ return query_tree_walker((Query *) node, check_parameter_resolution_walker, - (void *) pstate, 0); + pstate, 0); } return expression_tree_walker(node, check_parameter_resolution_walker, - (void *) pstate); + pstate); } /* diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index 994ed9995ac..72404e72fff 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -1205,7 +1205,7 @@ setup_scanner_errposition_callback(ScannerCallbackState *scbstate, scbstate->yyscanner = yyscanner; scbstate->location = location; scbstate->errcallback.callback = scb_error_callback; - scbstate->errcallback.arg = (void *) scbstate; + scbstate->errcallback.arg = scbstate; scbstate->errcallback.previous = error_context_stack; error_context_stack = &scbstate->errcallback; } diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c index 9a1a7faac7a..4e12ae5d1e3 100644 --- a/src/backend/partitioning/partprune.c +++ b/src/backend/partitioning/partprune.c @@ -3365,8 +3365,7 @@ pull_exec_paramids_walker(Node *node, Bitmapset **context) *context = bms_add_member(*context, param->paramid); return false; } - return expression_tree_walker(node, pull_exec_paramids_walker, - (void *) context); + return expression_tree_walker(node, pull_exec_paramids_walker, context); } /* diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c index 362a37d3b3a..a5a4511f66d 100644 --- a/src/backend/port/sysv_shmem.c +++ b/src/backend/port/sysv_shmem.c @@ -286,7 +286,7 @@ static void IpcMemoryDetach(int status, Datum shmaddr) { /* Detach System V shared memory block. */ - if (shmdt((void *) DatumGetPointer(shmaddr)) < 0) + if (shmdt(DatumGetPointer(shmaddr)) < 0) elog(LOG, "shmdt(%p) failed: %m", DatumGetPointer(shmaddr)); } @@ -320,7 +320,7 @@ PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2) IpcMemoryState state; state = PGSharedMemoryAttach((IpcMemoryId) id2, NULL, &memAddress); - if (memAddress && shmdt((void *) memAddress) < 0) + if (memAddress && shmdt(memAddress) < 0) elog(LOG, "shmdt(%p) failed: %m", memAddress); switch (state) { @@ -835,7 +835,7 @@ PGSharedMemoryCreate(Size size, break; } - if (oldhdr && shmdt((void *) oldhdr) < 0) + if (oldhdr && shmdt(oldhdr) < 0) elog(LOG, "shmdt(%p) failed: %m", oldhdr); } diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 3fe1774a1e9..a48e1364b3a 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -800,7 +800,7 @@ startup_cb_wrapper(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool i state.callback_name = "startup"; state.report_location = InvalidXLogRecPtr; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -828,7 +828,7 @@ shutdown_cb_wrapper(LogicalDecodingContext *ctx) state.callback_name = "shutdown"; state.report_location = InvalidXLogRecPtr; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -862,7 +862,7 @@ begin_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn) state.callback_name = "begin"; state.report_location = txn->first_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -894,7 +894,7 @@ commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "commit"; state.report_location = txn->final_lsn; /* beginning of commit record */ errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -935,7 +935,7 @@ begin_prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn) state.callback_name = "begin_prepare"; state.report_location = txn->first_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -980,7 +980,7 @@ prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "prepare"; state.report_location = txn->final_lsn; /* beginning of prepare record */ errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1025,7 +1025,7 @@ commit_prepared_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "commit_prepared"; state.report_location = txn->final_lsn; /* beginning of commit record */ errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1071,7 +1071,7 @@ rollback_prepared_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "rollback_prepared"; state.report_location = txn->final_lsn; /* beginning of commit record */ errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1114,7 +1114,7 @@ change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "change"; state.report_location = change->lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1156,7 +1156,7 @@ truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "truncate"; state.report_location = change->lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1195,7 +1195,7 @@ filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, TransactionId xid, state.callback_name = "filter_prepare"; state.report_location = InvalidXLogRecPtr; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1226,7 +1226,7 @@ filter_by_origin_cb_wrapper(LogicalDecodingContext *ctx, RepOriginId origin_id) state.callback_name = "filter_by_origin"; state.report_location = InvalidXLogRecPtr; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1262,7 +1262,7 @@ message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "message"; state.report_location = message_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1298,7 +1298,7 @@ stream_start_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_start"; state.report_location = first_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1347,7 +1347,7 @@ stream_stop_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_stop"; state.report_location = last_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1396,7 +1396,7 @@ stream_abort_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_abort"; state.report_location = abort_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1441,7 +1441,7 @@ stream_prepare_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_prepare"; state.report_location = txn->final_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1482,7 +1482,7 @@ stream_commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_commit"; state.report_location = txn->final_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1523,7 +1523,7 @@ stream_change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_change"; state.report_location = change->lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1577,7 +1577,7 @@ stream_message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_message"; state.report_location = message_lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1618,7 +1618,7 @@ stream_truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "stream_truncate"; state.report_location = change->lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -1657,7 +1657,7 @@ update_progress_txn_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, state.callback_name = "update_progress_txn"; state.report_location = lsn; errcallback.callback = output_plugin_error_callback; - errcallback.arg = (void *) &state; + errcallback.arg = &state; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c index d4b5d210e3e..24d05032e72 100644 --- a/src/backend/replication/logical/tablesync.c +++ b/src/backend/replication/logical/tablesync.c @@ -760,7 +760,7 @@ copy_read_data(void *outbuf, int minread, int maxread) if (avail > maxread) avail = maxread; memcpy(outbuf, ©buf->data[copybuf->cursor], avail); - outbuf = (void *) ((char *) outbuf + avail); + outbuf = (char *) outbuf + avail; copybuf->cursor += avail; maxread -= avail; bytesread += avail; diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index 6828100cf1a..05b5c95025b 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -2546,7 +2546,7 @@ check_synchronized_standby_slots(char **newval, void **extra, GucSource source) ptr += strlen(slot_name) + 1; } - *extra = (void *) config; + *extra = config; pfree(rawname); list_free(elemlist); diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index fa5988c824e..f1abaa69ce6 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -1028,7 +1028,7 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source) return false; memcpy(pconf, syncrep_parse_result, syncrep_parse_result->config_size); - *extra = (void *) pconf; + *extra = pconf; /* * We need not explicitly clean up syncrep_parse_result. It, and any diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c index 6cc9a8d8bfe..1a9dfcf624d 100644 --- a/src/backend/rewrite/rewriteDefine.c +++ b/src/backend/rewrite/rewriteDefine.c @@ -644,7 +644,7 @@ setRuleCheckAsUser_walker(Node *node, Oid *context) return false; } return expression_tree_walker(node, setRuleCheckAsUser_walker, - (void *) context); + context); } static void @@ -679,7 +679,7 @@ setRuleCheckAsUser_Query(Query *qry, Oid userid) /* If there are sublinks, search for them and process their RTEs */ if (qry->hasSubLinks) - query_tree_walker(qry, setRuleCheckAsUser_walker, (void *) &userid, + query_tree_walker(qry, setRuleCheckAsUser_walker, &userid, QTW_IGNORE_RC_SUBQUERIES); } diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 6d59a2bb8dc..52c893e91e1 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -1971,7 +1971,7 @@ fireRIRonSubLink(Node *node, List *activeRIRs) * subselects of subselects for us. */ return expression_tree_walker(node, fireRIRonSubLink, - (void *) activeRIRs); + activeRIRs); } @@ -2152,7 +2152,7 @@ fireRIRrules(Query *parsetree, List *activeRIRs) * the rtable and cteList. */ if (parsetree->hasSubLinks) - query_tree_walker(parsetree, fireRIRonSubLink, (void *) activeRIRs, + query_tree_walker(parsetree, fireRIRonSubLink, activeRIRs, QTW_IGNORE_RC_SUBQUERIES); /* @@ -2224,10 +2224,10 @@ fireRIRrules(Query *parsetree, List *activeRIRs) * get_row_security_policies, fire any RIR rules for them. */ expression_tree_walker((Node *) securityQuals, - fireRIRonSubLink, (void *) activeRIRs); + fireRIRonSubLink, activeRIRs); expression_tree_walker((Node *) withCheckOptions, - fireRIRonSubLink, (void *) activeRIRs); + fireRIRonSubLink, activeRIRs); activeRIRs = list_delete_last(activeRIRs); } diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c index 8f90afb3269..f4e687c986c 100644 --- a/src/backend/rewrite/rewriteManip.c +++ b/src/backend/rewrite/rewriteManip.c @@ -94,7 +94,7 @@ contain_aggs_of_level(Node *node, int levelsup) */ return query_or_expression_tree_walker(node, contain_aggs_of_level_walker, - (void *) &context, + &context, 0); } @@ -124,12 +124,12 @@ contain_aggs_of_level_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, contain_aggs_of_level_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } return expression_tree_walker(node, contain_aggs_of_level_walker, - (void *) context); + context); } /* @@ -159,7 +159,7 @@ locate_agg_of_level(Node *node, int levelsup) */ (void) query_or_expression_tree_walker(node, locate_agg_of_level_walker, - (void *) &context, + &context, 0); return context.agg_location; @@ -198,12 +198,11 @@ locate_agg_of_level_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, locate_agg_of_level_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, locate_agg_of_level_walker, - (void *) context); + return expression_tree_walker(node, locate_agg_of_level_walker, context); } /* @@ -232,8 +231,7 @@ contain_windowfuncs_walker(Node *node, void *context) if (IsA(node, WindowFunc)) return true; /* abort the tree traversal and return true */ /* Mustn't recurse into subselects */ - return expression_tree_walker(node, contain_windowfuncs_walker, - (void *) context); + return expression_tree_walker(node, contain_windowfuncs_walker, context); } /* @@ -262,7 +260,7 @@ locate_windowfunc(Node *node) */ (void) query_or_expression_tree_walker(node, locate_windowfunc_walker, - (void *) &context, + &context, 0); return context.win_location; @@ -283,8 +281,7 @@ locate_windowfunc_walker(Node *node, locate_windowfunc_context *context) /* else fall through to examine argument */ } /* Mustn't recurse into subselects */ - return expression_tree_walker(node, locate_windowfunc_walker, - (void *) context); + return expression_tree_walker(node, locate_windowfunc_walker, context); } /* @@ -468,12 +465,11 @@ OffsetVarNodes_walker(Node *node, OffsetVarNodes_context *context) context->sublevels_up++; result = query_tree_walker((Query *) node, OffsetVarNodes_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, OffsetVarNodes_walker, - (void *) context); + return expression_tree_walker(node, OffsetVarNodes_walker, context); } void @@ -521,8 +517,7 @@ OffsetVarNodes(Node *node, int offset, int sublevels_up) rc->rti += offset; } } - query_tree_walker(qry, OffsetVarNodes_walker, - (void *) &context, 0); + query_tree_walker(qry, OffsetVarNodes_walker, &context, 0); } else OffsetVarNodes_walker(node, &context); @@ -662,12 +657,11 @@ ChangeVarNodes_walker(Node *node, ChangeVarNodes_context *context) context->sublevels_up++; result = query_tree_walker((Query *) node, ChangeVarNodes_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, ChangeVarNodes_walker, - (void *) context); + return expression_tree_walker(node, ChangeVarNodes_walker, context); } void @@ -718,8 +712,7 @@ ChangeVarNodes(Node *node, int rt_index, int new_index, int sublevels_up) rc->rti = new_index; } } - query_tree_walker(qry, ChangeVarNodes_walker, - (void *) &context, 0); + query_tree_walker(qry, ChangeVarNodes_walker, &context, 0); } else ChangeVarNodes_walker(node, &context); @@ -836,13 +829,12 @@ IncrementVarSublevelsUp_walker(Node *node, context->min_sublevels_up++; result = query_tree_walker((Query *) node, IncrementVarSublevelsUp_walker, - (void *) context, + context, QTW_EXAMINE_RTES_BEFORE); context->min_sublevels_up--; return result; } - return expression_tree_walker(node, IncrementVarSublevelsUp_walker, - (void *) context); + return expression_tree_walker(node, IncrementVarSublevelsUp_walker, context); } void @@ -860,7 +852,7 @@ IncrementVarSublevelsUp(Node *node, int delta_sublevels_up, */ query_or_expression_tree_walker(node, IncrementVarSublevelsUp_walker, - (void *) &context, + &context, QTW_EXAMINE_RTES_BEFORE); } @@ -879,7 +871,7 @@ IncrementVarSublevelsUp_rtable(List *rtable, int delta_sublevels_up, range_table_walker(rtable, IncrementVarSublevelsUp_walker, - (void *) &context, + &context, QTW_EXAMINE_RTES_BEFORE); } @@ -954,12 +946,11 @@ rangeTableEntry_used_walker(Node *node, context->sublevels_up++; result = query_tree_walker((Query *) node, rangeTableEntry_used_walker, - (void *) context, 0); + context, 0); context->sublevels_up--; return result; } - return expression_tree_walker(node, rangeTableEntry_used_walker, - (void *) context); + return expression_tree_walker(node, rangeTableEntry_used_walker, context); } bool @@ -976,7 +967,7 @@ rangeTableEntry_used(Node *node, int rt_index, int sublevels_up) */ return query_or_expression_tree_walker(node, rangeTableEntry_used_walker, - (void *) &context, + &context, 0); } @@ -1218,13 +1209,12 @@ add_nulling_relids_mutator(Node *node, context->sublevels_up++; newnode = query_tree_mutator((Query *) node, add_nulling_relids_mutator, - (void *) context, + context, 0); context->sublevels_up--; return (Node *) newnode; } - return expression_tree_mutator(node, add_nulling_relids_mutator, - (void *) context); + return expression_tree_mutator(node, add_nulling_relids_mutator, context); } /* @@ -1289,7 +1279,7 @@ remove_nulling_relids_mutator(Node *node, phv = (PlaceHolderVar *) expression_tree_mutator(node, remove_nulling_relids_mutator, - (void *) context); + context); /* ... and replace the copy's phnullingrels field */ phv->phnullingrels = bms_difference(phv->phnullingrels, context->removable_relids); @@ -1309,13 +1299,12 @@ remove_nulling_relids_mutator(Node *node, context->sublevels_up++; newnode = query_tree_mutator((Query *) node, remove_nulling_relids_mutator, - (void *) context, + context, 0); context->sublevels_up--; return (Node *) newnode; } - return expression_tree_mutator(node, remove_nulling_relids_mutator, - (void *) context); + return expression_tree_mutator(node, remove_nulling_relids_mutator, context); } @@ -1372,7 +1361,7 @@ replace_rte_variables(Node *node, int target_varno, int sublevels_up, */ result = query_or_expression_tree_mutator(node, replace_rte_variables_mutator, - (void *) &context, + &context, 0); if (context.inserted_sublink) @@ -1442,15 +1431,14 @@ replace_rte_variables_mutator(Node *node, context->inserted_sublink = ((Query *) node)->hasSubLinks; newnode = query_tree_mutator((Query *) node, replace_rte_variables_mutator, - (void *) context, + context, 0); newnode->hasSubLinks |= context->inserted_sublink; context->inserted_sublink = save_inserted_sublink; context->sublevels_up--; return (Node *) newnode; } - return expression_tree_mutator(node, replace_rte_variables_mutator, - (void *) context); + return expression_tree_mutator(node, replace_rte_variables_mutator, context); } @@ -1601,13 +1589,12 @@ map_variable_attnos_mutator(Node *node, context->sublevels_up++; newnode = query_tree_mutator((Query *) node, map_variable_attnos_mutator, - (void *) context, + context, 0); context->sublevels_up--; return (Node *) newnode; } - return expression_tree_mutator(node, map_variable_attnos_mutator, - (void *) context); + return expression_tree_mutator(node, map_variable_attnos_mutator, context); } Node * @@ -1632,7 +1619,7 @@ map_variable_attnos(Node *node, */ return query_or_expression_tree_mutator(node, map_variable_attnos_mutator, - (void *) &context, + &context, 0); } @@ -1786,6 +1773,6 @@ ReplaceVarsFromTargetList(Node *node, return replace_rte_variables(node, target_varno, sublevels_up, ReplaceVarsFromTargetList_callback, - (void *) &context, + &context, outer_hasSubLinks); } diff --git a/src/backend/storage/buffer/buf_table.c b/src/backend/storage/buffer/buf_table.c index 0fa54689303..141dd724802 100644 --- a/src/backend/storage/buffer/buf_table.c +++ b/src/backend/storage/buffer/buf_table.c @@ -77,7 +77,7 @@ InitBufTable(int size) uint32 BufTableHashCode(BufferTag *tagPtr) { - return get_hash_value(SharedBufHash, (void *) tagPtr); + return get_hash_value(SharedBufHash, tagPtr); } /* diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 0f02bf62fa3..cc9782b7132 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -3801,7 +3801,7 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln, IOObject io_object, /* Setup error traceback support for ereport() */ errcallback.callback = shared_buffer_write_error_callback; - errcallback.arg = (void *) buf; + errcallback.arg = buf; errcallback.previous = error_context_stack; error_context_stack = &errcallback; @@ -4514,7 +4514,7 @@ FlushRelationBuffers(Relation rel) /* Setup error traceback support for ereport() */ errcallback.callback = local_buffer_write_error_callback; - errcallback.arg = (void *) bufHdr; + errcallback.arg = bufHdr; errcallback.previous = error_context_stack; error_context_stack = &errcallback; diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 8da7dd6c98a..6fd1a6418d2 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -379,7 +379,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr, InitBufferTag(&tag, &bmr.smgr->smgr_rlocator.locator, fork, first_block + i); hresult = (LocalBufferLookupEnt *) - hash_search(LocalBufHash, (void *) &tag, HASH_ENTER, &found); + hash_search(LocalBufHash, &tag, HASH_ENTER, &found); if (found) { BufferDesc *existing_hdr; diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index 6d5f0839864..8564ada71ec 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -102,7 +102,7 @@ InitShmemAccess(void *seghdr) PGShmemHeader *shmhdr = (PGShmemHeader *) seghdr; ShmemSegHdr = shmhdr; - ShmemBase = (void *) shmhdr; + ShmemBase = shmhdr; ShmemEnd = (char *) ShmemBase + shmhdr->totalsize; } @@ -212,7 +212,7 @@ ShmemAllocRaw(Size size, Size *allocated_size) newFree = newStart + size; if (newFree <= ShmemSegHdr->totalsize) { - newSpace = (void *) ((char *) ShmemBase + newStart); + newSpace = (char *) ShmemBase + newStart; ShmemSegHdr->freeoffset = newFree; } else @@ -258,7 +258,7 @@ ShmemAllocUnlocked(Size size) size))); ShmemSegHdr->freeoffset = newFree; - newSpace = (void *) ((char *) ShmemBase + newStart); + newSpace = (char *) ShmemBase + newStart; Assert(newSpace == (void *) MAXALIGN(newSpace)); diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 8cc23a9cef8..955b4de102f 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1816,7 +1816,7 @@ exec_bind_message(StringInfo input_message) one_param_data.paramval = NULL; params_errcxt.previous = error_context_stack; params_errcxt.callback = bind_param_error_callback; - params_errcxt.arg = (void *) &one_param_data; + params_errcxt.arg = &one_param_data; error_context_stack = ¶ms_errcxt; params = makeParamList(numParams); @@ -2006,7 +2006,7 @@ exec_bind_message(StringInfo input_message) params_data.params = params; params_errcxt.previous = error_context_stack; params_errcxt.callback = ParamsErrorCallback; - params_errcxt.arg = (void *) ¶ms_data; + params_errcxt.arg = ¶ms_data; error_context_stack = ¶ms_errcxt; /* Get the result format codes */ @@ -2251,7 +2251,7 @@ exec_execute_message(const char *portal_name, long max_rows) params_data.params = portalParams; params_errcxt.previous = error_context_stack; params_errcxt.callback = ParamsErrorCallback; - params_errcxt.arg = (void *) ¶ms_data; + params_errcxt.arg = ¶ms_data; error_context_stack = ¶ms_errcxt; if (max_rows <= 0) diff --git a/src/backend/tsearch/dict_thesaurus.c b/src/backend/tsearch/dict_thesaurus.c index 259f2e9901d..6b159f9f569 100644 --- a/src/backend/tsearch/dict_thesaurus.c +++ b/src/backend/tsearch/dict_thesaurus.c @@ -859,7 +859,7 @@ thesaurus_lexize(PG_FUNCTION_ARGS) info = NULL; /* word isn't recognized */ } - dstate->private_state = (void *) info; + dstate->private_state = info; if (!info) { diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index 1aef9ca1ef2..aaedb0aa852 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -148,7 +148,7 @@ compact_palloc0(IspellDict *Conf, size_t size) Conf->avail = COMPACT_ALLOC_CHUNK; } - result = (void *) Conf->firstfree; + result = Conf->firstfree; Conf->firstfree += size; Conf->avail -= size; diff --git a/src/backend/tsearch/ts_locale.c b/src/backend/tsearch/ts_locale.c index bc44599de6a..f8367b41312 100644 --- a/src/backend/tsearch/ts_locale.c +++ b/src/backend/tsearch/ts_locale.c @@ -142,7 +142,7 @@ tsearch_readline_begin(tsearch_readline_state *stp, stp->curline = NULL; /* Setup error traceback support for ereport() */ stp->cb.callback = tsearch_readline_callback; - stp->cb.arg = (void *) stp; + stp->cb.arg = stp; stp->cb.previous = error_context_stack; error_context_stack = &stp->cb; return true; diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c index 517f200a9b4..02b01630647 100644 --- a/src/backend/tsearch/ts_parse.c +++ b/src/backend/tsearch/ts_parse.c @@ -366,9 +366,9 @@ parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen) cfg = lookup_ts_config_cache(cfgId); prsobj = lookup_ts_parser_cache(cfg->prsId); - prsdata = (void *) DatumGetPointer(FunctionCall2(&prsobj->prsstart, - PointerGetDatum(buf), - Int32GetDatum(buflen))); + prsdata = DatumGetPointer(FunctionCall2(&prsobj->prsstart, + PointerGetDatum(buf), + Int32GetDatum(buflen))); LexizeInit(&ldata, cfg); @@ -552,9 +552,9 @@ hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int bu cfg = lookup_ts_config_cache(cfgId); prsobj = lookup_ts_parser_cache(cfg->prsId); - prsdata = (void *) DatumGetPointer(FunctionCall2(&(prsobj->prsstart), - PointerGetDatum(buf), - Int32GetDatum(buflen))); + prsdata = DatumGetPointer(FunctionCall2(&(prsobj->prsstart), + PointerGetDatum(buf), + Int32GetDatum(buflen))); LexizeInit(&ldata, cfg); diff --git a/src/backend/tsearch/wparser.c b/src/backend/tsearch/wparser.c index bc9fb38426c..a0e4408b9a5 100644 --- a/src/backend/tsearch/wparser.c +++ b/src/backend/tsearch/wparser.c @@ -63,7 +63,7 @@ tt_setup_firstcall(FuncCallContext *funcctx, FunctionCallInfo fcinfo, /* lextype takes one dummy argument */ st->list = (LexDescr *) DatumGetPointer(OidFunctionCall1(prs->lextypeOid, (Datum) 0)); - funcctx->user_fctx = (void *) st; + funcctx->user_fctx = st; if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) elog(ERROR, "return type must be a row type"); @@ -178,9 +178,9 @@ prs_setup_firstcall(FuncCallContext *funcctx, FunctionCallInfo fcinfo, st->len = 16; st->list = (LexemeEntry *) palloc(sizeof(LexemeEntry) * st->len); - prsdata = (void *) DatumGetPointer(FunctionCall2(&prs->prsstart, - PointerGetDatum(VARDATA_ANY(txt)), - Int32GetDatum(VARSIZE_ANY_EXHDR(txt)))); + prsdata = DatumGetPointer(FunctionCall2(&prs->prsstart, + PointerGetDatum(VARDATA_ANY(txt)), + Int32GetDatum(VARSIZE_ANY_EXHDR(txt)))); while ((type = DatumGetInt32(FunctionCall3(&prs->prstoken, PointerGetDatum(prsdata), diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index 2a716cc6b7f..583d6e7f89d 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -1808,7 +1808,7 @@ aclexplode(PG_FUNCTION_ARGS) idx = (int *) palloc(sizeof(int[2])); idx[0] = 0; /* ACL array item index */ idx[1] = -1; /* privilege type counter */ - funcctx->user_fctx = (void *) idx; + funcctx->user_fctx = idx; MemoryContextSwitchTo(oldcontext); } diff --git a/src/backend/utils/adt/array_userfuncs.c b/src/backend/utils/adt/array_userfuncs.c index 6599be2ec5e..d36ae9b68d8 100644 --- a/src/backend/utils/adt/array_userfuncs.c +++ b/src/backend/utils/adt/array_userfuncs.c @@ -685,7 +685,7 @@ array_agg_serialize(PG_FUNCTION_ARGS) &typisvarlena); fmgr_info_cxt(typsend, &iodata->typsend, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) iodata; + fcinfo->flinfo->fn_extra = iodata; } for (i = 0; i < state->nelems; i++) @@ -776,7 +776,7 @@ array_agg_deserialize(PG_FUNCTION_ARGS) &iodata->typioparam); fmgr_info_cxt(typreceive, &iodata->typreceive, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) iodata; + fcinfo->flinfo->fn_extra = iodata; } for (int i = 0; i < nelems; i++) @@ -1642,7 +1642,7 @@ array_shuffle(PG_FUNCTION_ARGS) if (typentry == NULL || typentry->type_id != elmtyp) { typentry = lookup_type_cache(elmtyp, 0); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } result = array_shuffle_n(array, ARR_DIMS(array)[0], true, elmtyp, typentry); @@ -1678,7 +1678,7 @@ array_sample(PG_FUNCTION_ARGS) if (typentry == NULL || typentry->type_id != elmtyp) { typentry = lookup_type_cache(elmtyp, 0); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } result = array_shuffle_n(array, n, false, elmtyp, typentry); diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index a715e7e0b8e..593775c27f3 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -3863,7 +3863,7 @@ array_eq(PG_FUNCTION_ARGS) (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify an equality operator for type %s", format_type_be(element_type)))); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } typlen = typentry->typlen; typbyval = typentry->typbyval; @@ -4027,7 +4027,7 @@ array_cmp(FunctionCallInfo fcinfo) (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify a comparison function for type %s", format_type_be(element_type)))); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } typlen = typentry->typlen; typbyval = typentry->typbyval; @@ -4222,7 +4222,7 @@ hash_array(PG_FUNCTION_ARGS) typentry = record_typentry; } - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } typlen = typentry->typlen; @@ -4316,7 +4316,7 @@ hash_array_extended(PG_FUNCTION_ARGS) (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify an extended hash function for type %s", format_type_be(element_type)))); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } typlen = typentry->typlen; typbyval = typentry->typbyval; @@ -4418,7 +4418,7 @@ array_contain_compare(AnyArrayType *array1, AnyArrayType *array2, Oid collation, (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify an equality operator for type %s", format_type_be(element_type)))); - *fn_extra = (void *) typentry; + *fn_extra = typentry; } typlen = typentry->typlen; typbyval = typentry->typbyval; @@ -6437,7 +6437,7 @@ array_replace_internal(ArrayType *array, (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify an equality operator for type %s", format_type_be(element_type)))); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } typlen = typentry->typlen; typbyval = typentry->typbyval; @@ -6723,7 +6723,7 @@ width_bucket_array(PG_FUNCTION_ARGS) (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify a comparison function for type %s", format_type_be(element_type)))); - fcinfo->flinfo->fn_extra = (void *) typentry; + fcinfo->flinfo->fn_extra = typentry; } /* diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 600b59190e4..0b19cddf54b 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -5031,7 +5031,7 @@ pg_timezone_abbrevs(PG_FUNCTION_ARGS) /* allocate memory for user context */ pindex = (int *) palloc(sizeof(int)); *pindex = 0; - funcctx->user_fctx = (void *) pindex; + funcctx->user_fctx = pindex; if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) elog(ERROR, "return type must be a row type"); diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c index 45b854a0ae7..bd5b08e2137 100644 --- a/src/backend/utils/adt/datum.c +++ b/src/backend/utils/adt/datum.c @@ -149,7 +149,7 @@ datumCopy(Datum value, bool typByVal, int typLen) resultsize = EOH_get_flat_size(eoh); resultptr = (char *) palloc(resultsize); - EOH_flatten_into(eoh, (void *) resultptr, resultsize); + EOH_flatten_into(eoh, resultptr, resultsize); res = PointerGetDatum(resultptr); } else @@ -495,7 +495,7 @@ datumSerialize(Datum value, bool isnull, bool typByVal, int typLen, * so we can't store directly to *start_address. */ tmp = (char *) palloc(header); - EOH_flatten_into(eoh, (void *) tmp, header); + EOH_flatten_into(eoh, tmp, header); memcpy(*start_address, tmp, header); *start_address += header; diff --git a/src/backend/utils/adt/domains.c b/src/backend/utils/adt/domains.c index 21791105da8..901d887cd43 100644 --- a/src/backend/utils/adt/domains.c +++ b/src/backend/utils/adt/domains.c @@ -255,7 +255,7 @@ domain_in(PG_FUNCTION_ARGS) { my_extra = domain_state_setup(domainType, false, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) my_extra; + fcinfo->flinfo->fn_extra = my_extra; } /* @@ -314,7 +314,7 @@ domain_recv(PG_FUNCTION_ARGS) { my_extra = domain_state_setup(domainType, true, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) my_extra; + fcinfo->flinfo->fn_extra = my_extra; } /* @@ -388,7 +388,7 @@ domain_check_internal(Datum value, bool isnull, Oid domainType, { my_extra = domain_state_setup(domainType, true, mcxt); if (extra) - *extra = (void *) my_extra; + *extra = my_extra; } /* diff --git a/src/backend/utils/adt/enum.c b/src/backend/utils/adt/enum.c index 814c7fb4e3e..d4c2aa0e7e9 100644 --- a/src/backend/utils/adt/enum.c +++ b/src/backend/utils/adt/enum.c @@ -295,7 +295,7 @@ enum_cmp_internal(Oid arg1, Oid arg2, FunctionCallInfo fcinfo) ReleaseSysCache(enum_tup); /* Now locate and remember the typcache entry */ tcache = lookup_type_cache(typeoid, 0); - fcinfo->flinfo->fn_extra = (void *) tcache; + fcinfo->flinfo->fn_extra = tcache; } /* The remaining comparison logic is in typcache.c */ diff --git a/src/backend/utils/adt/expandedrecord.c b/src/backend/utils/adt/expandedrecord.c index 7e85ae3825e..d2842495b57 100644 --- a/src/backend/utils/adt/expandedrecord.c +++ b/src/backend/utils/adt/expandedrecord.c @@ -161,7 +161,7 @@ make_expanded_record_from_typeid(Oid type_id, int32 typmod, { /* Register callback to release the refcount */ erh->er_mcb.func = ER_mc_callback; - erh->er_mcb.arg = (void *) erh; + erh->er_mcb.arg = erh; MemoryContextRegisterResetCallback(erh->hdr.eoh_context, &erh->er_mcb); @@ -289,7 +289,7 @@ make_expanded_record_from_tupdesc(TupleDesc tupdesc, { /* Register callback to release the refcount */ erh->er_mcb.func = ER_mc_callback; - erh->er_mcb.arg = (void *) erh; + erh->er_mcb.arg = erh; MemoryContextRegisterResetCallback(erh->hdr.eoh_context, &erh->er_mcb); @@ -385,7 +385,7 @@ make_expanded_record_from_exprecord(ExpandedRecordHeader *olderh, { /* Register callback to release the refcount */ erh->er_mcb.func = ER_mc_callback; - erh->er_mcb.arg = (void *) erh; + erh->er_mcb.arg = erh; MemoryContextRegisterResetCallback(erh->hdr.eoh_context, &erh->er_mcb); @@ -844,7 +844,7 @@ expanded_record_fetch_tupdesc(ExpandedRecordHeader *erh) if (erh->er_mcb.arg == NULL) { erh->er_mcb.func = ER_mc_callback; - erh->er_mcb.arg = (void *) erh; + erh->er_mcb.arg = erh; MemoryContextRegisterResetCallback(erh->hdr.eoh_context, &erh->er_mcb); } diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index 928552d5514..d602df4eeb5 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -257,7 +257,7 @@ jsonb_from_cstring(char *json, int len, bool unique_keys, Node *escontext) state.unique_keys = unique_keys; state.escontext = escontext; - sem.semstate = (void *) &state; + sem.semstate = &state; sem.object_start = jsonb_in_object_start; sem.array_start = jsonb_in_array_start; @@ -758,7 +758,7 @@ datum_to_jsonb_internal(Datum val, bool is_null, JsonbInState *result, memset(&sem, 0, sizeof(sem)); - sem.semstate = (void *) result; + sem.semstate = result; sem.object_start = jsonb_in_object_start; sem.array_start = jsonb_in_array_start; diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index 62a17a26679..68c0a31656e 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -617,7 +617,7 @@ jsonb_object_keys(PG_FUNCTION_ARGS) } MemoryContextSwitchTo(oldcontext); - funcctx->user_fctx = (void *) state; + funcctx->user_fctx = state; } funcctx = SRF_PERCALL_SETUP(); @@ -752,7 +752,7 @@ json_object_keys(PG_FUNCTION_ARGS) state->sent_count = 0; state->result = palloc(256 * sizeof(char *)); - sem->semstate = (void *) state; + sem->semstate = state; sem->array_start = okeys_array_start; sem->scalar = okeys_scalar; sem->object_field_start = okeys_object_field_start; @@ -765,7 +765,7 @@ json_object_keys(PG_FUNCTION_ARGS) pfree(sem); MemoryContextSwitchTo(oldcontext); - funcctx->user_fctx = (void *) state; + funcctx->user_fctx = state; } funcctx = SRF_PERCALL_SETUP(); @@ -1123,7 +1123,7 @@ get_worker(text *json, if (npath > 0) state->pathok[0] = true; - sem->semstate = (void *) state; + sem->semstate = state; /* * Not all variants need all the semantic routines. Only set the ones that @@ -1863,7 +1863,7 @@ json_array_length(PG_FUNCTION_ARGS) #endif sem = palloc0(sizeof(JsonSemAction)); - sem->semstate = (void *) state; + sem->semstate = state; sem->object_start = alen_object_start; sem->scalar = alen_scalar; sem->array_element_start = alen_array_element_start; @@ -2071,7 +2071,7 @@ each_worker(FunctionCallInfo fcinfo, bool as_text) state->tuple_store = rsi->setResult; state->ret_tdesc = rsi->setDesc; - sem->semstate = (void *) state; + sem->semstate = state; sem->array_start = each_array_start; sem->scalar = each_scalar; sem->object_field_start = each_object_field_start; @@ -2323,7 +2323,7 @@ elements_worker(FunctionCallInfo fcinfo, const char *funcname, bool as_text) state->tuple_store = rsi->setResult; state->ret_tdesc = rsi->setDesc; - sem->semstate = (void *) state; + sem->semstate = state; sem->object_start = elements_object_start; sem->scalar = elements_scalar; sem->array_element_start = elements_array_element_start; @@ -2795,7 +2795,7 @@ populate_array_json(PopulateArrayContext *ctx, const char *json, int len) state.ctx = ctx; memset(&sem, 0, sizeof(sem)); - sem.semstate = (void *) &state; + sem.semstate = &state; sem.object_start = populate_array_object_start; sem.array_end = populate_array_array_end; sem.array_element_start = populate_array_element_start; @@ -3831,7 +3831,7 @@ get_json_object_as_hash(const char *json, int len, const char *funcname, state->lex = makeJsonLexContextCstringLen(NULL, json, len, GetDatabaseEncoding(), true); - sem->semstate = (void *) state; + sem->semstate = state; sem->array_start = hash_array_start; sem->scalar = hash_scalar; sem->object_field_start = hash_object_field_start; @@ -4144,7 +4144,7 @@ populate_recordset_worker(FunctionCallInfo fcinfo, const char *funcname, makeJsonLexContext(&lex, json, true); - sem->semstate = (void *) state; + sem->semstate = state; sem->array_start = populate_recordset_array_start; sem->array_element_start = populate_recordset_array_element_start; sem->scalar = populate_recordset_scalar; @@ -4504,7 +4504,7 @@ json_strip_nulls(PG_FUNCTION_ARGS) state->strval = makeStringInfo(); state->skip_next_null = false; - sem->semstate = (void *) state; + sem->semstate = state; sem->object_start = sn_object_start; sem->object_end = sn_object_end; sem->array_start = sn_array_start; @@ -5718,7 +5718,7 @@ iterate_json_values(text *json, uint32 flags, void *action_state, state->action_state = action_state; state->flags = flags; - sem->semstate = (void *) state; + sem->semstate = state; sem->scalar = iterate_values_scalar; sem->object_field_start = iterate_values_object_field_start; @@ -5839,7 +5839,7 @@ transform_json_string_values(text *json, void *action_state, state->action = transform_action; state->action_state = action_state; - sem->semstate = (void *) state; + sem->semstate = state; sem->object_start = transform_string_values_object_start; sem->object_end = transform_string_values_object_end; sem->array_start = transform_string_values_array_start; diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index ac214598037..de35c8ce476 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -3615,7 +3615,7 @@ JsonbType(JsonbValue *jb) if (jb->type == jbvBinary) { - JsonbContainer *jbc = (void *) jb->val.binary.data; + JsonbContainer *jbc = jb->val.binary.data; /* Scalars should be always extracted during jsonpath execution. */ Assert(!JsonContainerIsScalar(jbc)); diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index 7acda778375..8efad5ac106 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -564,7 +564,7 @@ parsejsonpath(const char *str, int len, struct Node *escontext) jsonpath_scanner_init(str, len); - if (jsonpath_yyparse((void *) &parseresult, escontext) != 0) + if (jsonpath_yyparse(&parseresult, escontext) != 0) jsonpath_yyerror(NULL, escontext, "invalid input"); /* shouldn't happen */ jsonpath_scanner_finish(); diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c index e790f856ab3..034a6f84716 100644 --- a/src/backend/utils/adt/lockfuncs.c +++ b/src/backend/utils/adt/lockfuncs.c @@ -153,7 +153,7 @@ pg_lock_status(PG_FUNCTION_ARGS) * out as a result set. */ mystatus = (PG_Lock_Status *) palloc(sizeof(PG_Lock_Status)); - funcctx->user_fctx = (void *) mystatus; + funcctx->user_fctx = mystatus; mystatus->lockData = GetLockStatusData(); mystatus->currIdx = 0; diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c index 558c6c18c34..35fd825babe 100644 --- a/src/backend/utils/adt/multirangetypes.c +++ b/src/backend/utils/adt/multirangetypes.c @@ -458,7 +458,7 @@ get_multirange_io_data(FunctionCallInfo fcinfo, Oid mltrngtypid, IOFuncSelector fmgr_info_cxt(typiofunc, &cache->typioproc, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) cache; + fcinfo->flinfo->fn_extra = cache; } return cache; @@ -555,7 +555,7 @@ multirange_get_typcache(FunctionCallInfo fcinfo, Oid mltrngtypid) typcache = lookup_type_cache(mltrngtypid, TYPECACHE_MULTIRANGE_INFO); if (typcache->rngtype == NULL) elog(ERROR, "type %u is not a multirange type", mltrngtypid); - fcinfo->flinfo->fn_extra = (void *) typcache; + fcinfo->flinfo->fn_extra = typcache; } return typcache; diff --git a/src/backend/utils/adt/orderedsetaggs.c b/src/backend/utils/adt/orderedsetaggs.c index 04b3f31827e..b8bdc667dbc 100644 --- a/src/backend/utils/adt/orderedsetaggs.c +++ b/src/backend/utils/adt/orderedsetaggs.c @@ -270,7 +270,7 @@ ordered_set_startup(FunctionCallInfo fcinfo, bool use_tuples) &qstate->typAlign); } - fcinfo->flinfo->fn_extra = (void *) qstate; + fcinfo->flinfo->fn_extra = qstate; MemoryContextSwitchTo(oldcontext); } diff --git a/src/backend/utils/adt/partitionfuncs.c b/src/backend/utils/adt/partitionfuncs.c index fe19007970d..6062f21db48 100644 --- a/src/backend/utils/adt/partitionfuncs.c +++ b/src/backend/utils/adt/partitionfuncs.c @@ -92,7 +92,7 @@ pg_partition_tree(PG_FUNCTION_ARGS) funcctx->tuple_desc = tupdesc; /* The only state we need is the partition list */ - funcctx->user_fctx = (void *) partitions; + funcctx->user_fctx = partitions; MemoryContextSwitchTo(oldcxt); } @@ -219,7 +219,7 @@ pg_partition_ancestors(PG_FUNCTION_ARGS) ancestors = lcons_oid(relid, ancestors); /* The only state we need is the ancestors list */ - funcctx->user_fctx = (void *) ancestors; + funcctx->user_fctx = ancestors; MemoryContextSwitchTo(oldcxt); } diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c index 2d94a6b8774..dc714345222 100644 --- a/src/backend/utils/adt/rangetypes.c +++ b/src/backend/utils/adt/rangetypes.c @@ -359,7 +359,7 @@ get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid, IOFuncSelector func) fmgr_info_cxt(typiofunc, &cache->typioproc, fcinfo->flinfo->fn_mcxt); - fcinfo->flinfo->fn_extra = (void *) cache; + fcinfo->flinfo->fn_extra = cache; } return cache; @@ -1710,7 +1710,7 @@ range_get_typcache(FunctionCallInfo fcinfo, Oid rngtypid) typcache = lookup_type_cache(rngtypid, TYPECACHE_RANGE_INFO); if (typcache->rngelemtype == NULL) elog(ERROR, "type %u is not a range type", rngtypid); - fcinfo->flinfo->fn_extra = (void *) typcache; + fcinfo->flinfo->fn_extra = typcache; } return typcache; diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index 0e2519bfd57..42aec95738d 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -1367,7 +1367,7 @@ regexp_matches(PG_FUNCTION_ARGS) matchctx->nulls = (bool *) palloc(sizeof(bool) * matchctx->npatterns); MemoryContextSwitchTo(oldcontext); - funcctx->user_fctx = (void *) matchctx; + funcctx->user_fctx = matchctx; } funcctx = SRF_PERCALL_SETUP(); @@ -1707,7 +1707,7 @@ regexp_split_to_table(PG_FUNCTION_ARGS) false, true, true); MemoryContextSwitchTo(oldcontext); - funcctx->user_fctx = (void *) splitctx; + funcctx->user_fctx = splitctx; } funcctx = SRF_PERCALL_SETUP(); diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index 1438ff35209..b6beb88db80 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -355,7 +355,7 @@ gtsvector_consistent(PG_FUNCTION_ARGS) chkval.arrb = GETARR(key); chkval.arre = chkval.arrb + ARRNELEM(key); PG_RETURN_BOOL(TS_execute(GETQUERY(query), - (void *) &chkval, + &chkval, TS_EXEC_PHRASE_NO_POS, checkcondition_arr)); } diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index d456a039510..586a9d6b8d3 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -185,7 +185,7 @@ SortAndUniqItems(TSQuery q, int *size) /* remove duplicates */ while (ptr - res < *size) { - if (compareQueryOperand((void *) ptr, (void *) prevptr, (void *) operand) != 0) + if (compareQueryOperand(ptr, prevptr, operand) != 0) { prevptr++; *prevptr = *ptr; @@ -671,7 +671,7 @@ Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, CoverExt *ext) { fillQueryRepresentationData(qr, ptr); - if (TS_execute(GETQUERY(qr->query), (void *) qr, + if (TS_execute(GETQUERY(qr->query), qr, TS_EXEC_EMPTY, checkcondition_QueryOperand)) { if (WEP_GETPOS(ptr->pos) > ext->q) @@ -701,7 +701,7 @@ Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, CoverExt *ext) */ fillQueryRepresentationData(qr, ptr); - if (TS_execute(GETQUERY(qr->query), (void *) qr, + if (TS_execute(GETQUERY(qr->query), qr, TS_EXEC_EMPTY, checkcondition_QueryOperand)) { if (WEP_GETPOS(ptr->pos) < ext->p) diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index 687adcbd69f..f75e25388ca 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -2452,7 +2452,7 @@ ts_setup_firstcall(FunctionCallInfo fcinfo, FuncCallContext *funcctx, MemoryContext oldcontext; StatEntry *node; - funcctx->user_fctx = (void *) stat; + funcctx->user_fctx = stat; oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 040a8962639..4ad5e04f48a 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -1226,7 +1226,7 @@ pg_xml_init(PgXmlStrictness strictness) errcxt->saved_errcxt = xmlGenericErrorContext; #endif - xmlSetStructuredErrorFunc((void *) errcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(errcxt, xml_errorHandler); /* * Verify that xmlSetStructuredErrorFunc set the context variable we @@ -1248,7 +1248,7 @@ pg_xml_init(PgXmlStrictness strictness) new_errcxt = xmlGenericErrorContext; #endif - if (new_errcxt != (void *) errcxt) + if (new_errcxt != errcxt) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not set up XML error handler"), @@ -1302,7 +1302,7 @@ pg_xml_done(PgXmlErrorContext *errcxt, bool isError) cur_errcxt = xmlGenericErrorContext; #endif - if (cur_errcxt != (void *) errcxt) + if (cur_errcxt != errcxt) elog(WARNING, "libxml error handling state is out of sync with xml.c"); /* Restore the saved handlers */ @@ -2197,7 +2197,7 @@ xml_errorHandler(void *data, PgXmlErrorPtr error) xmlGenericErrorFunc errFuncSaved = xmlGenericError; void *errCtxSaved = xmlGenericErrorContext; - xmlSetGenericErrorFunc((void *) errorBuf, + xmlSetGenericErrorFunc(errorBuf, (xmlGenericErrorFunc) appendStringInfo); /* Add context information to errorBuf */ @@ -4885,7 +4885,7 @@ XmlTableFetchRow(TableFuncScanState *state) xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableFetchRow"); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); if (xtCxt->xpathobj == NULL) { @@ -4939,7 +4939,7 @@ XmlTableGetValue(TableFuncScanState *state, int colnum, xtCxt->xpathobj->nodesetval != NULL); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); *isnull = false; @@ -5082,7 +5082,7 @@ XmlTableDestroyOpaque(TableFuncScanState *state) xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableDestroyOpaque"); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); if (xtCxt->xpathscomp != NULL) { diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 5af1a168ec2..c66a088f406 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -1907,8 +1907,7 @@ ScanQueryForLocks(Query *parsetree, bool acquire) */ if (parsetree->hasSubLinks) { - query_tree_walker(parsetree, ScanQueryWalker, - (void *) &acquire, + query_tree_walker(parsetree, ScanQueryWalker, &acquire, QTW_IGNORE_RC_SUBQUERIES); } } @@ -1934,8 +1933,7 @@ ScanQueryWalker(Node *node, bool *acquire) * Do NOT recurse into Query nodes, because ScanQueryForLocks already * processed subselects of subselects for us. */ - return expression_tree_walker(node, ScanQueryWalker, - (void *) acquire); + return expression_tree_walker(node, ScanQueryWalker, acquire); } /* diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 1972bd1944b..6590cbe5c67 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -1407,7 +1407,7 @@ InitDomainConstraintRef(Oid type_id, DomainConstraintRef *ref, ref->refctx = refctx; ref->dcc = NULL; ref->callback.func = dccref_deletion_callback; - ref->callback.arg = (void *) ref; + ref->callback.arg = ref; MemoryContextRegisterResetCallback(refctx, &ref->callback); /* Acquire refcount if there are constraints, and set up exported list */ if (ref->tcache->domainData) diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 8acca3e0a0b..c5b3b15c395 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -2285,7 +2285,7 @@ check_log_destination(char **newval, void **extra, GucSource source) myextra = (int *) guc_malloc(ERROR, sizeof(int)); *myextra = newlogdest; - *extra = (void *) myextra; + *extra = myextra; return true; } diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 5d9c62b652a..493eae4f4b0 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -1038,7 +1038,7 @@ hash_search_with_hash_value(HTAB *hashp, { case HASH_FIND: if (currBucket != NULL) - return (void *) ELEMENTKEY(currBucket); + return ELEMENTKEY(currBucket); return NULL; case HASH_REMOVE: @@ -1067,7 +1067,7 @@ hash_search_with_hash_value(HTAB *hashp, * element, because someone else is going to reuse it the next * time something is added to the table */ - return (void *) ELEMENTKEY(currBucket); + return ELEMENTKEY(currBucket); } return NULL; @@ -1075,7 +1075,7 @@ hash_search_with_hash_value(HTAB *hashp, case HASH_ENTER_NULL: /* Return existing element if found, else create one */ if (currBucket != NULL) - return (void *) ELEMENTKEY(currBucket); + return ELEMENTKEY(currBucket); /* disallow inserts if frozen */ if (hashp->frozen) @@ -1114,7 +1114,7 @@ hash_search_with_hash_value(HTAB *hashp, * caller's data structure. */ - return (void *) ELEMENTKEY(currBucket); + return ELEMENTKEY(currBucket); } elog(ERROR, "unrecognized hash action code: %d", (int) action); @@ -1453,7 +1453,7 @@ hash_seq_search(HASH_SEQ_STATUS *status) status->curEntry = curElem->link; if (status->curEntry == NULL) /* end of this bucket */ ++status->curBucket; - return (void *) ELEMENTKEY(curElem); + return ELEMENTKEY(curElem); } /* @@ -1507,7 +1507,7 @@ hash_seq_search(HASH_SEQ_STATUS *status) if (status->curEntry == NULL) /* end of this bucket */ ++curBucket; status->curBucket = curBucket; - return (void *) ELEMENTKEY(curElem); + return ELEMENTKEY(curElem); } void diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c index bde54326c66..70d33226cb9 100644 --- a/src/backend/utils/mmgr/mcxt.c +++ b/src/backend/utils/mmgr/mcxt.c @@ -886,7 +886,7 @@ MemoryContextStatsInternal(MemoryContext context, int level, /* Examine the context itself */ context->methods->stats(context, MemoryContextStatsPrint, - (void *) &level, + &level, totals, print_to_stderr); /* diff --git a/src/backend/utils/sort/tuplesortvariants.c b/src/backend/utils/sort/tuplesortvariants.c index 558309c9850..e07ba4ea4b1 100644 --- a/src/backend/utils/sort/tuplesortvariants.c +++ b/src/backend/utils/sort/tuplesortvariants.c @@ -664,7 +664,7 @@ tuplesort_puttupleslot(Tuplesortstate *state, TupleTableSlot *slot) /* copy the tuple into sort storage */ tuple = ExecCopySlotMinimalTuple(slot); - stup.tuple = (void *) tuple; + stup.tuple = tuple; /* set up first-column key value */ htup.t_len = tuple->t_len + MINIMAL_TUPLE_OFFSET; htup.t_data = (HeapTupleHeader) ((char *) tuple - MINIMAL_TUPLE_OFFSET); @@ -702,7 +702,7 @@ tuplesort_putheaptuple(Tuplesortstate *state, HeapTuple tup) /* copy the tuple into sort storage */ tup = heap_copytuple(tup); - stup.tuple = (void *) tup; + stup.tuple = tup; /* * set up first-column key value, and potentially abbreviate, if it's a @@ -1175,7 +1175,7 @@ readtup_heap(Tuplesortstate *state, SortTuple *stup, LogicalTapeReadExact(tape, tupbody, tupbodylen); if (base->sortopt & TUPLESORT_RANDOMACCESS) /* need trailing length word? */ LogicalTapeReadExact(tape, &tuplen, sizeof(tuplen)); - stup->tuple = (void *) tuple; + stup->tuple = tuple; /* set up first-column key value */ htup.t_len = tuple->t_len + MINIMAL_TUPLE_OFFSET; htup.t_data = (HeapTupleHeader) ((char *) tuple - MINIMAL_TUPLE_OFFSET); @@ -1372,7 +1372,7 @@ readtup_cluster(Tuplesortstate *state, SortTuple *stup, LogicalTapeReadExact(tape, tuple->t_data, tuple->t_len); if (base->sortopt & TUPLESORT_RANDOMACCESS) /* need trailing length word? */ LogicalTapeReadExact(tape, &tuplen, sizeof(tuplen)); - stup->tuple = (void *) tuple; + stup->tuple = tuple; /* set up first-column key value, if it's a simple column */ if (base->haveDatum1) stup->datum1 = heap_getattr(tuple, @@ -1681,7 +1681,7 @@ readtup_index(Tuplesortstate *state, SortTuple *stup, LogicalTapeReadExact(tape, tuple, tuplen); if (base->sortopt & TUPLESORT_RANDOMACCESS) /* need trailing length word? */ LogicalTapeReadExact(tape, &tuplen, sizeof(tuplen)); - stup->tuple = (void *) tuple; + stup->tuple = tuple; /* set up first-column key value */ stup->datum1 = index_getattr(tuple, 1, @@ -1757,7 +1757,7 @@ readtup_index_brin(Tuplesortstate *state, SortTuple *stup, LogicalTapeReadExact(tape, &tuple->tuple, tuplen); if (base->sortopt & TUPLESORT_RANDOMACCESS) /* need trailing length word? */ LogicalTapeReadExact(tape, &tuplen, sizeof(tuplen)); - stup->tuple = (void *) tuple; + stup->tuple = tuple; /* set up first-column key value, which is block number */ stup->datum1 = tuple->tuple.bt_blkno; diff --git a/src/backend/utils/sort/tuplestore.c b/src/backend/utils/sort/tuplestore.c index a720d702001..62c98de2086 100644 --- a/src/backend/utils/sort/tuplestore.c +++ b/src/backend/utils/sort/tuplestore.c @@ -751,7 +751,7 @@ tuplestore_puttupleslot(Tuplestorestate *state, tuple = ExecCopySlotMinimalTuple(slot); USEMEM(state, GetMemoryChunkSpace(tuple)); - tuplestore_puttuple_common(state, (void *) tuple); + tuplestore_puttuple_common(state, tuple); MemoryContextSwitchTo(oldcxt); } @@ -771,7 +771,7 @@ tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple) */ tuple = COPYTUP(state, tuple); - tuplestore_puttuple_common(state, (void *) tuple); + tuplestore_puttuple_common(state, tuple); MemoryContextSwitchTo(oldcxt); } @@ -790,7 +790,7 @@ tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, tuple = heap_form_minimal_tuple(tdesc, values, isnull); USEMEM(state, GetMemoryChunkSpace(tuple)); - tuplestore_puttuple_common(state, (void *) tuple); + tuplestore_puttuple_common(state, tuple); MemoryContextSwitchTo(oldcxt); } @@ -1592,7 +1592,7 @@ copytup_heap(Tuplestorestate *state, void *tup) tuple = minimal_tuple_from_heap_tuple((HeapTuple) tup); USEMEM(state, GetMemoryChunkSpace(tuple)); - return (void *) tuple; + return tuple; } static void @@ -1629,5 +1629,5 @@ readtup_heap(Tuplestorestate *state, unsigned int len) BufFileReadExact(state->myfile, tupbody, tupbodylen); if (state->backward) /* need trailing length word? */ BufFileReadExact(state->myfile, &tuplen, sizeof(tuplen)); - return (void *) tuple; + return tuple; } diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 8c20c263c4b..31eead9e76a 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -1462,7 +1462,7 @@ StartRestoreLO(ArchiveHandle *AH, Oid oid, bool drop) { /* First time through (in this process) so allocate the buffer */ AH->lo_buf_size = LOBBUFSIZE; - AH->lo_buf = (void *) pg_malloc(LOBBUFSIZE); + AH->lo_buf = pg_malloc(LOBBUFSIZE); } AH->lo_buf_used = 0; @@ -2178,7 +2178,7 @@ ReadStr(ArchiveHandle *AH) else { buf = (char *) pg_malloc(l + 1); - AH->ReadBufPtr(AH, (void *) buf, l); + AH->ReadBufPtr(AH, buf, l); buf[l] = '\0'; } diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index 55107b20058..d21c7e0eaef 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -138,7 +138,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH) /* Set up a private area. */ ctx = (lclContext *) pg_malloc0(sizeof(lclContext)); - AH->formatData = (void *) ctx; + AH->formatData = ctx; /* * Now open the file @@ -206,7 +206,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) else ctx->dataState = K_OFFSET_NO_DATA; - te->formatData = (void *) ctx; + te->formatData = ctx; } /* @@ -242,7 +242,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (ctx == NULL) { ctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); - te->formatData = (void *) ctx; + te->formatData = ctx; } ctx->dataState = ReadOffset(AH, &(ctx->dataPos)); diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index 7be8d5487d4..cb82f8734ed 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -140,7 +140,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) /* Set up our private context */ ctx = (lclContext *) pg_malloc0(sizeof(lclContext)); - AH->formatData = (void *) ctx; + AH->formatData = ctx; ctx->dataFH = NULL; ctx->LOsTocFH = NULL; @@ -246,7 +246,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) else tctx->filename = NULL; - te->formatData = (void *) tctx; + te->formatData = tctx; } /* @@ -285,7 +285,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (tctx == NULL) { tctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); - te->formatData = (void *) tctx; + te->formatData = tctx; } tctx->filename = ReadStr(AH); diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 41ee52b1d69..b5ba3b46dd9 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -152,7 +152,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH) * Set up some special context used in compressing data. */ ctx = pg_malloc0_object(lclContext); - AH->formatData = (void *) ctx; + AH->formatData = ctx; ctx->filePos = 0; ctx->isSpecialScript = 0; @@ -219,7 +219,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH) ctx->hasSeek = checkSeek(ctx->tarFH); - ctx->FH = (void *) tarOpen(AH, "toc.dat", 'r'); + ctx->FH = tarOpen(AH, "toc.dat", 'r'); ReadHead(AH); ReadToc(AH); tarClose(AH, ctx->FH); /* Nothing else in the file... */ @@ -247,7 +247,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) ctx->filename = NULL; ctx->TH = NULL; } - te->formatData = (void *) ctx; + te->formatData = ctx; } static void @@ -269,7 +269,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (ctx == NULL) { ctx = pg_malloc0_object(lclTocEntry); - te->formatData = (void *) ctx; + te->formatData = ctx; } ctx->filename = ReadStr(AH); diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index c24e38d988c..4cf5603353d 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -69,7 +69,7 @@ MainLoop(FILE *source) /* Create working state */ scan_state = psql_scan_create(&psqlscan_callbacks); cond_stack = conditional_stack_create(); - psql_scan_set_passthrough(scan_state, (void *) cond_stack); + psql_scan_set_passthrough(scan_state, cond_stack); query_buf = createPQExpBuffer(); previous_buf = createPQExpBuffer(); diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 036caaec2ff..db30ddc94da 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -399,7 +399,7 @@ main(int argc, char *argv[]) cell->val, strlen(cell->val), pset.encoding, standard_strings()); cond_stack = conditional_stack_create(); - psql_scan_set_passthrough(scan_state, (void *) cond_stack); + psql_scan_set_passthrough(scan_state, cond_stack); successResult = HandleSlashCmds(scan_state, cond_stack, diff --git a/src/include/common/pg_prng.h b/src/include/common/pg_prng.h index c114c6419d0..49fc6cfc50b 100644 --- a/src/include/common/pg_prng.h +++ b/src/include/common/pg_prng.h @@ -44,7 +44,7 @@ extern bool pg_prng_seed_check(pg_prng_state *state); * pg_strong_random.c and thence OpenSSL. */ #define pg_prng_strong_seed(state) \ - (pg_strong_random((void *) (state), sizeof(pg_prng_state)) ? \ + (pg_strong_random(state, sizeof(pg_prng_state)) ? \ pg_prng_seed_check(state) : false) extern uint64 pg_prng_uint64(pg_prng_state *state); diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index b24b310ce59..2bbb70333dc 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -667,7 +667,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p this->autocommit = autocommit; - PQsetNoticeReceiver(this->connection, &ECPGnoticeReceiver, (void *) this); + PQsetNoticeReceiver(this->connection, &ECPGnoticeReceiver, this); return true; } diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index ad279e245c4..1ec94e624b7 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -435,7 +435,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) /* allocate storage if needed */ if (arrsize == 0 && *(void **) var == NULL) { - void *mem = (void *) ecpg_auto_alloc(offset * ntuples, lineno); + void *mem = ecpg_auto_alloc(offset * ntuples, lineno); if (!mem) { @@ -540,7 +540,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) /* allocate storage if needed */ if (data_var.ind_arrsize == 0 && data_var.ind_value == NULL) { - void *mem = (void *) ecpg_auto_alloc(data_var.ind_offset * ntuples, lineno); + void *mem = ecpg_auto_alloc(data_var.ind_offset * ntuples, lineno); if (!mem) { diff --git a/src/interfaces/ecpg/ecpglib/memory.c b/src/interfaces/ecpg/ecpglib/memory.c index a83637ac758..6979be2c988 100644 --- a/src/interfaces/ecpg/ecpglib/memory.c +++ b/src/interfaces/ecpg/ecpglib/memory.c @@ -100,7 +100,7 @@ set_auto_allocs(struct auto_mem *am) char * ecpg_auto_alloc(long size, int lineno) { - void *ptr = (void *) ecpg_alloc(size, lineno); + void *ptr = ecpg_alloc(size, lineno); if (!ptr) return NULL; diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 5633e3c7905..6255a86d75b 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -229,7 +229,7 @@ plpgsql_compile(FunctionCallInfo fcinfo, bool forValidator) /* * Save pointer in FmgrInfo to avoid search on subsequent calls */ - fcinfo->flinfo->fn_extra = (void *) function; + fcinfo->flinfo->fn_extra = function; /* * Finally return the compiled function @@ -1079,7 +1079,7 @@ plpgsql_parser_setup(struct ParseState *pstate, PLpgSQL_expr *expr) pstate->p_post_columnref_hook = plpgsql_post_column_ref; pstate->p_paramref_hook = plpgsql_param_ref; /* no need to use p_coerce_param_hook */ - pstate->p_ref_hook_state = (void *) expr; + pstate->p_ref_hook_state = expr; } /* diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 86c5bd324a9..e31206e7f4c 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -863,7 +863,7 @@ coerce_function_result_tuple(PLpgSQL_execstate *estate, TupleDesc tupdesc) resultsize = EOH_get_flat_size(&erh->hdr); tuphdr = (HeapTupleHeader) SPI_palloc(resultsize); - EOH_flatten_into(&erh->hdr, (void *) tuphdr, resultsize); + EOH_flatten_into(&erh->hdr, tuphdr, resultsize); HeapTupleHeaderSetTypeId(tuphdr, tupdesc->tdtypeid); HeapTupleHeaderSetTypMod(tuphdr, tupdesc->tdtypmod); estate->retval = PointerGetDatum(tuphdr); @@ -4026,7 +4026,7 @@ plpgsql_estate_setup(PLpgSQL_execstate *estate, /* initialize our ParamListInfo with appropriate hook functions */ estate->paramLI = makeParamList(0); estate->paramLI->paramFetch = plpgsql_param_fetch; - estate->paramLI->paramFetchArg = (void *) estate; + estate->paramLI->paramFetchArg = estate; estate->paramLI->paramCompile = plpgsql_param_compile; estate->paramLI->paramCompileArg = NULL; /* not needed */ estate->paramLI->parserSetup = (ParserSetupHook) plpgsql_parser_setup; @@ -4185,7 +4185,7 @@ exec_prepare_plan(PLpgSQL_execstate *estate, */ memset(&options, 0, sizeof(options)); options.parserSetup = (ParserSetupHook) plpgsql_parser_setup; - options.parserSetupArg = (void *) expr; + options.parserSetupArg = expr; options.parseMode = expr->parseMode; options.cursorOptions = cursorOptions; plan = SPI_prepare_extended(expr->query, &options); @@ -6172,7 +6172,7 @@ exec_eval_simple_expr(PLpgSQL_execstate *estate, * possibly setting ecxt_param_list_info to NULL; we've already forced use * of a generic plan. */ - paramLI->parserSetupArg = (void *) expr; + paramLI->parserSetupArg = expr; econtext->ecxt_param_list_info = paramLI; /* @@ -6281,7 +6281,7 @@ setup_param_list(PLpgSQL_execstate *estate, PLpgSQL_expr *expr) * Callers must save and restore parserSetupArg if there is any chance * that they are interrupting an active use of parameters. */ - paramLI->parserSetupArg = (void *) expr; + paramLI->parserSetupArg = expr; /* * Also make sure this is set before parser hooks need it. There is diff --git a/src/pl/plpgsql/src/pl_handler.c b/src/pl/plpgsql/src/pl_handler.c index adfbbc8a7b7..b18a3d0b97b 100644 --- a/src/pl/plpgsql/src/pl_handler.c +++ b/src/pl/plpgsql/src/pl_handler.c @@ -118,7 +118,7 @@ plpgsql_extra_checks_check_hook(char **newvalue, void **extra, GucSource source) if (!myextra) return false; *myextra = extrachecks; - *extra = (void *) myextra; + *extra = myextra; return true; } diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c index 9d59473d6ad..0e84bb90829 100644 --- a/src/pl/plpython/plpy_exec.c +++ b/src/pl/plpython/plpy_exec.c @@ -80,10 +80,10 @@ PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc) sizeof(PLySRFState)); /* Immediately register cleanup callback */ srfstate->callback.func = plpython_srf_cleanup_callback; - srfstate->callback.arg = (void *) srfstate; + srfstate->callback.arg = srfstate; MemoryContextRegisterResetCallback(funcctx->multi_call_memory_ctx, &srfstate->callback); - funcctx->user_fctx = (void *) srfstate; + funcctx->user_fctx = srfstate; } /* Every call setup */ funcctx = SRF_PERCALL_SETUP(); diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c index 0b342b5c2bb..e01c0c9de93 100644 --- a/src/test/isolation/isolationtester.c +++ b/src/test/isolation/isolationtester.c @@ -178,7 +178,7 @@ main(int argc, char **argv) if (i != 0) PQsetNoticeProcessor(conns[i].conn, isotesterNoticeProcessor, - (void *) &conns[i]); + &conns[i]); else PQsetNoticeProcessor(conns[i].conn, blackholeNoticeProcessor, diff --git a/src/test/modules/test_regex/test_regex.c b/src/test/modules/test_regex/test_regex.c index cd503a2cd81..a780c678fbc 100644 --- a/src/test/modules/test_regex/test_regex.c +++ b/src/test/modules/test_regex/test_regex.c @@ -113,7 +113,7 @@ test_regex(PG_FUNCTION_ARGS) (matchctx->npatterns + 1)); MemoryContextSwitchTo(oldcontext); - funcctx->user_fctx = (void *) matchctx; + funcctx->user_fctx = matchctx; /* * Return the first result row, which is info equivalent to Tcl's base-commit: 4b7bba49e71266ec378e672a1aaa9f16823449c2 -- 2.47.0