summaryrefslogtreecommitdiff
path: root/src/backend/replication
diff options
context:
space:
mode:
authorPeter Eisentraut2023-02-06 08:05:20 +0000
committerPeter Eisentraut2023-02-06 08:41:01 +0000
commit54a177a948b0a773c25c6737d1cc3cc49222a526 (patch)
treea442be10d2b8515f6b1600f60838e379ee546fe8 /src/backend/replication
parent009f8d17146da72478fcb8f544b793c443fa254c (diff)
Remove useless casts to (void *) in hash_search() calls
Some of these appear to be leftovers from when hash_search() took a char * argument (changed in 5999e78fc45dcb91784b64b6e9ae43f4e4f68ca2). Since after this there is some more horizontal space available, do some light reformatting where suitable. Reviewed-by: Corey Huinker <corey.huinker@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com
Diffstat (limited to 'src/backend/replication')
-rw-r--r--src/backend/replication/logical/relation.c6
-rw-r--r--src/backend/replication/logical/reorderbuffer.c34
-rw-r--r--src/backend/replication/pgoutput/pgoutput.c2
3 files changed, 12 insertions, 30 deletions
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index ca88ae171c..9f139c64db 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -167,7 +167,7 @@ logicalrep_relmap_update(LogicalRepRelation *remoterel)
/*
* HASH_ENTER returns the existing entry if present or creates a new one.
*/
- entry = hash_search(LogicalRepRelMap, (void *) &remoterel->remoteid,
+ entry = hash_search(LogicalRepRelMap, &remoterel->remoteid,
HASH_ENTER, &found);
if (found)
@@ -326,7 +326,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
logicalrep_relmap_init();
/* Search for existing entry. */
- entry = hash_search(LogicalRepRelMap, (void *) &remoteid,
+ entry = hash_search(LogicalRepRelMap, &remoteid,
HASH_FIND, &found);
if (!found)
@@ -598,7 +598,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
/* Search for existing entry. */
part_entry = (LogicalRepPartMapEntry *) hash_search(LogicalRepPartMap,
- (void *) &partOid,
+ &partOid,
HASH_ENTER, &found);
entry = &part_entry->relmapentry;
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index efe057b4de..0468d12936 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -657,7 +657,7 @@ ReorderBufferTXNByXid(ReorderBuffer *rb, TransactionId xid, bool create,
/* search the lookup table */
ent = (ReorderBufferTXNByIdEnt *)
hash_search(rb->by_txn,
- (void *) &xid,
+ &xid,
create ? HASH_ENTER : HASH_FIND,
&found);
if (found)
@@ -1581,10 +1581,7 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
dclist_delete_from(&rb->catchange_txns, &txn->catchange_node);
/* now remove reference from buffer */
- hash_search(rb->by_txn,
- (void *) &txn->xid,
- HASH_REMOVE,
- &found);
+ hash_search(rb->by_txn, &txn->xid, HASH_REMOVE, &found);
Assert(found);
/* remove entries spilled to disk */
@@ -1762,10 +1759,7 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn)
&key.tid);
ent = (ReorderBufferTupleCidEnt *)
- hash_search(txn->tuplecid_hash,
- (void *) &key,
- HASH_ENTER,
- &found);
+ hash_search(txn->tuplecid_hash, &key, HASH_ENTER, &found);
if (!found)
{
ent->cmin = change->data.tuplecid.cmin;
@@ -4653,10 +4647,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
Assert(!isnull);
ent = (ReorderBufferToastEnt *)
- hash_search(txn->toast_hash,
- (void *) &chunk_id,
- HASH_ENTER,
- &found);
+ hash_search(txn->toast_hash, &chunk_id, HASH_ENTER, &found);
if (!found)
{
@@ -4811,7 +4802,7 @@ ReorderBufferToastReplace(ReorderBuffer *rb, ReorderBufferTXN *txn,
*/
ent = (ReorderBufferToastEnt *)
hash_search(txn->toast_hash,
- (void *) &toast_pointer.va_valueid,
+ &toast_pointer.va_valueid,
HASH_FIND,
NULL);
if (ent == NULL)
@@ -5053,10 +5044,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
ent = (ReorderBufferTupleCidEnt *)
- hash_search(tuplecid_data,
- (void *) &key,
- HASH_FIND,
- NULL);
+ hash_search(tuplecid_data, &key, HASH_FIND, NULL);
/* no existing mapping, no need to update */
if (!ent)
@@ -5067,10 +5055,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
&key.tid);
new_ent = (ReorderBufferTupleCidEnt *)
- hash_search(tuplecid_data,
- (void *) &key,
- HASH_ENTER,
- &found);
+ hash_search(tuplecid_data, &key, HASH_ENTER, &found);
if (found)
{
@@ -5249,10 +5234,7 @@ ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data,
restart:
ent = (ReorderBufferTupleCidEnt *)
- hash_search(tuplecid_data,
- (void *) &key,
- HASH_FIND,
- NULL);
+ hash_search(tuplecid_data, &key, HASH_FIND, NULL);
/*
* failed to find a mapping, check whether the table was rewritten and
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 1a80d67bb9..e4938d8888 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -2026,7 +2026,7 @@ get_rel_sync_entry(PGOutputData *data, Relation relation)
/* Find cached relation info, creating if not found */
entry = (RelationSyncEntry *) hash_search(RelationSyncCache,
- (void *) &relid,
+ &relid,
HASH_ENTER, &found);
Assert(entry != NULL);