Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 54a177a

Browse files
committedFeb 6, 2023
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 5999e78). 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
1 parent 009f8d1 commit 54a177a

File tree

28 files changed

+108
-146
lines changed

28 files changed

+108
-146
lines changed
 

‎contrib/postgres_fdw/shippable.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ InvalidateShippableCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
7777
while ((entry = (ShippableCacheEntry *) hash_seq_search(&status)) != NULL)
7878
{
7979
if (hash_search(ShippableCacheHash,
80-
(void *) &entry->key,
80+
&entry->key,
8181
HASH_REMOVE,
8282
NULL) == NULL)
8383
elog(ERROR, "hash table corrupted");
@@ -183,10 +183,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
183183

184184
/* See if we already cached the result. */
185185
entry = (ShippableCacheEntry *)
186-
hash_search(ShippableCacheHash,
187-
(void *) &key,
188-
HASH_FIND,
189-
NULL);
186+
hash_search(ShippableCacheHash, &key, HASH_FIND, NULL);
190187

191188
if (!entry)
192189
{
@@ -199,10 +196,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
199196
* cache invalidation.
200197
*/
201198
entry = (ShippableCacheEntry *)
202-
hash_search(ShippableCacheHash,
203-
(void *) &key,
204-
HASH_ENTER,
205-
NULL);
199+
hash_search(ShippableCacheHash, &key, HASH_ENTER, NULL);
206200

207201
entry->shippable = shippable;
208202
}

‎src/backend/access/gist/gistbuild.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, BlockNumber pa
15871587
bool found;
15881588

15891589
entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
1590-
(const void *) &child,
1590+
&child,
15911591
HASH_ENTER,
15921592
&found);
15931593
entry->parentblkno = parent;
@@ -1625,7 +1625,7 @@ gistGetParent(GISTBuildState *buildstate, BlockNumber child)
16251625

16261626
/* Find node buffer in hash table */
16271627
entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
1628-
(const void *) &child,
1628+
&child,
16291629
HASH_FIND,
16301630
&found);
16311631
if (!found)

‎src/backend/access/gist/gistbuildbuffers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
122122

123123
/* Find node buffer in hash table */
124124
nodeBuffer = (GISTNodeBuffer *) hash_search(gfbb->nodeBuffersTab,
125-
(const void *) &nodeBlocknum,
125+
&nodeBlocknum,
126126
HASH_ENTER,
127127
&found);
128128
if (!found)

‎src/backend/access/transam/xlogutils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ log_invalid_page(RelFileLocator locator, ForkNumber forkno, BlockNumber blkno,
151151
key.forkno = forkno;
152152
key.blkno = blkno;
153153
hentry = (xl_invalid_page *)
154-
hash_search(invalid_page_tab, (void *) &key, HASH_ENTER, &found);
154+
hash_search(invalid_page_tab, &key, HASH_ENTER, &found);
155155

156156
if (!found)
157157
{
@@ -193,7 +193,7 @@ forget_invalid_pages(RelFileLocator locator, ForkNumber forkno,
193193
}
194194

195195
if (hash_search(invalid_page_tab,
196-
(void *) &hentry->key,
196+
&hentry->key,
197197
HASH_REMOVE, NULL) == NULL)
198198
elog(ERROR, "hash table corrupted");
199199
}
@@ -226,7 +226,7 @@ forget_invalid_pages_db(Oid dbid)
226226
}
227227

228228
if (hash_search(invalid_page_tab,
229-
(void *) &hentry->key,
229+
&hentry->key,
230230
HASH_REMOVE, NULL) == NULL)
231231
elog(ERROR, "hash table corrupted");
232232
}

‎src/backend/catalog/storage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ SerializePendingSyncs(Size maxSize, char *startAddress)
603603
/* remove deleted rnodes */
604604
for (delete = pendingDeletes; delete != NULL; delete = delete->next)
605605
if (delete->atCommit)
606-
(void) hash_search(tmphash, (void *) &delete->rlocator,
606+
(void) hash_search(tmphash, &delete->rlocator,
607607
HASH_REMOVE, NULL);
608608

609609
hash_seq_init(&scan, tmphash);
@@ -748,7 +748,7 @@ smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
748748
/* Skip syncing nodes that smgrDoPendingDeletes() will delete. */
749749
for (pending = pendingDeletes; pending != NULL; pending = pending->next)
750750
if (pending->atCommit)
751-
(void) hash_search(pendingSyncHash, (void *) &pending->rlocator,
751+
(void) hash_search(pendingSyncHash, &pending->rlocator,
752752
HASH_REMOVE, NULL);
753753

754754
hash_seq_init(&scan, pendingSyncHash);

‎src/backend/optimizer/util/predtest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ lookup_proof_cache(Oid pred_op, Oid clause_op, bool refute_it)
20402040
key.pred_op = pred_op;
20412041
key.clause_op = clause_op;
20422042
cache_entry = (OprProofCacheEntry *) hash_search(OprProofCacheHash,
2043-
(void *) &key,
2043+
&key,
20442044
HASH_ENTER, &cfound);
20452045
if (!cfound)
20462046
{

‎src/backend/parser/parse_oper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ find_oper_cache_entry(OprCacheKey *key)
10171017

10181018
/* Look for an existing entry */
10191019
oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
1020-
(void *) key,
1020+
key,
10211021
HASH_FIND, NULL);
10221022
if (oprentry == NULL)
10231023
return InvalidOid;
@@ -1038,7 +1038,7 @@ make_oper_cache_entry(OprCacheKey *key, Oid opr_oid)
10381038
Assert(OprCacheHash != NULL);
10391039

10401040
oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
1041-
(void *) key,
1041+
key,
10421042
HASH_ENTER, NULL);
10431043
oprentry->opr_oid = opr_oid;
10441044
}
@@ -1060,7 +1060,7 @@ InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
10601060
while ((hentry = (OprCacheEntry *) hash_seq_search(&status)) != NULL)
10611061
{
10621062
if (hash_search(OprCacheHash,
1063-
(void *) &hentry->key,
1063+
&hentry->key,
10641064
HASH_REMOVE, NULL) == NULL)
10651065
elog(ERROR, "hash table corrupted");
10661066
}

‎src/backend/replication/logical/relation.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ logicalrep_relmap_update(LogicalRepRelation *remoterel)
167167
/*
168168
* HASH_ENTER returns the existing entry if present or creates a new one.
169169
*/
170-
entry = hash_search(LogicalRepRelMap, (void *) &remoterel->remoteid,
170+
entry = hash_search(LogicalRepRelMap, &remoterel->remoteid,
171171
HASH_ENTER, &found);
172172

173173
if (found)
@@ -326,7 +326,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
326326
logicalrep_relmap_init();
327327

328328
/* Search for existing entry. */
329-
entry = hash_search(LogicalRepRelMap, (void *) &remoteid,
329+
entry = hash_search(LogicalRepRelMap, &remoteid,
330330
HASH_FIND, &found);
331331

332332
if (!found)
@@ -598,7 +598,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
598598

599599
/* Search for existing entry. */
600600
part_entry = (LogicalRepPartMapEntry *) hash_search(LogicalRepPartMap,
601-
(void *) &partOid,
601+
&partOid,
602602
HASH_ENTER, &found);
603603

604604
entry = &part_entry->relmapentry;

‎src/backend/replication/logical/reorderbuffer.c

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ ReorderBufferTXNByXid(ReorderBuffer *rb, TransactionId xid, bool create,
657657
/* search the lookup table */
658658
ent = (ReorderBufferTXNByIdEnt *)
659659
hash_search(rb->by_txn,
660-
(void *) &xid,
660+
&xid,
661661
create ? HASH_ENTER : HASH_FIND,
662662
&found);
663663
if (found)
@@ -1581,10 +1581,7 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
15811581
dclist_delete_from(&rb->catchange_txns, &txn->catchange_node);
15821582

15831583
/* now remove reference from buffer */
1584-
hash_search(rb->by_txn,
1585-
(void *) &txn->xid,
1586-
HASH_REMOVE,
1587-
&found);
1584+
hash_search(rb->by_txn, &txn->xid, HASH_REMOVE, &found);
15881585
Assert(found);
15891586

15901587
/* remove entries spilled to disk */
@@ -1762,10 +1759,7 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn)
17621759
&key.tid);
17631760

17641761
ent = (ReorderBufferTupleCidEnt *)
1765-
hash_search(txn->tuplecid_hash,
1766-
(void *) &key,
1767-
HASH_ENTER,
1768-
&found);
1762+
hash_search(txn->tuplecid_hash, &key, HASH_ENTER, &found);
17691763
if (!found)
17701764
{
17711765
ent->cmin = change->data.tuplecid.cmin;
@@ -4653,10 +4647,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
46534647
Assert(!isnull);
46544648

46554649
ent = (ReorderBufferToastEnt *)
4656-
hash_search(txn->toast_hash,
4657-
(void *) &chunk_id,
4658-
HASH_ENTER,
4659-
&found);
4650+
hash_search(txn->toast_hash, &chunk_id, HASH_ENTER, &found);
46604651

46614652
if (!found)
46624653
{
@@ -4811,7 +4802,7 @@ ReorderBufferToastReplace(ReorderBuffer *rb, ReorderBufferTXN *txn,
48114802
*/
48124803
ent = (ReorderBufferToastEnt *)
48134804
hash_search(txn->toast_hash,
4814-
(void *) &toast_pointer.va_valueid,
4805+
&toast_pointer.va_valueid,
48154806
HASH_FIND,
48164807
NULL);
48174808
if (ent == NULL)
@@ -5053,10 +5044,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
50535044

50545045

50555046
ent = (ReorderBufferTupleCidEnt *)
5056-
hash_search(tuplecid_data,
5057-
(void *) &key,
5058-
HASH_FIND,
5059-
NULL);
5047+
hash_search(tuplecid_data, &key, HASH_FIND, NULL);
50605048

50615049
/* no existing mapping, no need to update */
50625050
if (!ent)
@@ -5067,10 +5055,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
50675055
&key.tid);
50685056

50695057
new_ent = (ReorderBufferTupleCidEnt *)
5070-
hash_search(tuplecid_data,
5071-
(void *) &key,
5072-
HASH_ENTER,
5073-
&found);
5058+
hash_search(tuplecid_data, &key, HASH_ENTER, &found);
50745059

50755060
if (found)
50765061
{
@@ -5249,10 +5234,7 @@ ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data,
52495234

52505235
restart:
52515236
ent = (ReorderBufferTupleCidEnt *)
5252-
hash_search(tuplecid_data,
5253-
(void *) &key,
5254-
HASH_FIND,
5255-
NULL);
5237+
hash_search(tuplecid_data, &key, HASH_FIND, NULL);
52565238

52575239
/*
52585240
* failed to find a mapping, check whether the table was rewritten and

‎src/backend/replication/pgoutput/pgoutput.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ get_rel_sync_entry(PGOutputData *data, Relation relation)
20262026

20272027
/* Find cached relation info, creating if not found */
20282028
entry = (RelationSyncEntry *) hash_search(RelationSyncCache,
2029-
(void *) &relid,
2029+
&relid,
20302030
HASH_ENTER, &found);
20312031
Assert(entry != NULL);
20322032

‎src/backend/storage/buffer/buf_table.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ BufTableLookup(BufferTag *tagPtr, uint32 hashcode)
9494

9595
result = (BufferLookupEnt *)
9696
hash_search_with_hash_value(SharedBufHash,
97-
(void *) tagPtr,
97+
tagPtr,
9898
hashcode,
9999
HASH_FIND,
100100
NULL);
@@ -126,7 +126,7 @@ BufTableInsert(BufferTag *tagPtr, uint32 hashcode, int buf_id)
126126

127127
result = (BufferLookupEnt *)
128128
hash_search_with_hash_value(SharedBufHash,
129-
(void *) tagPtr,
129+
tagPtr,
130130
hashcode,
131131
HASH_ENTER,
132132
&found);
@@ -152,7 +152,7 @@ BufTableDelete(BufferTag *tagPtr, uint32 hashcode)
152152

153153
result = (BufferLookupEnt *)
154154
hash_search_with_hash_value(SharedBufHash,
155-
(void *) tagPtr,
155+
tagPtr,
156156
hashcode,
157157
HASH_REMOVE,
158158
NULL);

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ ReservePrivateRefCountEntry(void)
262262

263263
/* enter victim array entry into hashtable */
264264
hashent = hash_search(PrivateRefCountHash,
265-
(void *) &(ReservedRefCountEntry->buffer),
265+
&(ReservedRefCountEntry->buffer),
266266
HASH_ENTER,
267267
&found);
268268
Assert(!found);
@@ -336,10 +336,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
336336
if (PrivateRefCountOverflowed == 0)
337337
return NULL;
338338

339-
res = hash_search(PrivateRefCountHash,
340-
(void *) &buffer,
341-
HASH_FIND,
342-
NULL);
339+
res = hash_search(PrivateRefCountHash, &buffer, HASH_FIND, NULL);
343340

344341
if (res == NULL)
345342
return NULL;
@@ -368,10 +365,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
368365
free->refcount = res->refcount;
369366

370367
/* delete from hashtable */
371-
hash_search(PrivateRefCountHash,
372-
(void *) &buffer,
373-
HASH_REMOVE,
374-
&found);
368+
hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
375369
Assert(found);
376370
Assert(PrivateRefCountOverflowed > 0);
377371
PrivateRefCountOverflowed--;
@@ -430,10 +424,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
430424
bool found;
431425
Buffer buffer = ref->buffer;
432426

433-
hash_search(PrivateRefCountHash,
434-
(void *) &buffer,
435-
HASH_REMOVE,
436-
&found);
427+
hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
437428
Assert(found);
438429
Assert(PrivateRefCountOverflowed > 0);
439430
PrivateRefCountOverflowed--;

‎src/backend/storage/buffer/localbuf.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ PrefetchLocalBuffer(SMgrRelation smgr, ForkNumber forkNum,
7676

7777
/* See if the desired buffer already exists */
7878
hresult = (LocalBufferLookupEnt *)
79-
hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL);
79+
hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
8080

8181
if (hresult)
8282
{
@@ -125,7 +125,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
125125

126126
/* See if the desired buffer already exists */
127127
hresult = (LocalBufferLookupEnt *)
128-
hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL);
128+
hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
129129

130130
if (hresult)
131131
{
@@ -248,8 +248,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
248248
if (buf_state & BM_TAG_VALID)
249249
{
250250
hresult = (LocalBufferLookupEnt *)
251-
hash_search(LocalBufHash, (void *) &bufHdr->tag,
252-
HASH_REMOVE, NULL);
251+
hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
253252
if (!hresult) /* shouldn't happen */
254253
elog(ERROR, "local buffer hash table corrupted");
255254
/* mark buffer invalid just in case hash insert fails */
@@ -259,7 +258,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
259258
}
260259

261260
hresult = (LocalBufferLookupEnt *)
262-
hash_search(LocalBufHash, (void *) &newTag, HASH_ENTER, &found);
261+
hash_search(LocalBufHash, &newTag, HASH_ENTER, &found);
263262
if (found) /* shouldn't happen */
264263
elog(ERROR, "local buffer hash table corrupted");
265264
hresult->id = b;
@@ -351,8 +350,7 @@ DropRelationLocalBuffers(RelFileLocator rlocator, ForkNumber forkNum,
351350

352351
/* Remove entry from hashtable */
353352
hresult = (LocalBufferLookupEnt *)
354-
hash_search(LocalBufHash, (void *) &bufHdr->tag,
355-
HASH_REMOVE, NULL);
353+
hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
356354
if (!hresult) /* shouldn't happen */
357355
elog(ERROR, "local buffer hash table corrupted");
358356
/* Mark buffer invalid */
@@ -396,8 +394,7 @@ DropRelationAllLocalBuffers(RelFileLocator rlocator)
396394
LocalRefCount[i]);
397395
/* Remove entry from hashtable */
398396
hresult = (LocalBufferLookupEnt *)
399-
hash_search(LocalBufHash, (void *) &bufHdr->tag,
400-
HASH_REMOVE, NULL);
397+
hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
401398
if (!hresult) /* shouldn't happen */
402399
elog(ERROR, "local buffer hash table corrupted");
403400
/* Mark buffer invalid */

‎src/backend/storage/lmgr/lock.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ LockHeldByMe(const LOCKTAG *locktag, LOCKMODE lockmode)
608608
localtag.mode = lockmode;
609609

610610
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
611-
(void *) &localtag,
611+
&localtag,
612612
HASH_FIND, NULL);
613613

614614
return (locallock && locallock->nLocks > 0);
@@ -663,7 +663,7 @@ LockHasWaiters(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
663663
localtag.mode = lockmode;
664664

665665
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
666-
(void *) &localtag,
666+
&localtag,
667667
HASH_FIND, NULL);
668668

669669
/*
@@ -825,7 +825,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
825825
localtag.mode = lockmode;
826826

827827
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
828-
(void *) &localtag,
828+
&localtag,
829829
HASH_ENTER, &found);
830830

831831
/*
@@ -1061,7 +1061,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
10611061
dlist_delete(&proclock->lockLink);
10621062
dlist_delete(&proclock->procLink);
10631063
if (!hash_search_with_hash_value(LockMethodProcLockHash,
1064-
(void *) &(proclock->tag),
1064+
&(proclock->tag),
10651065
proclock_hashcode,
10661066
HASH_REMOVE,
10671067
NULL))
@@ -1180,7 +1180,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
11801180
* Find or create a lock with this tag.
11811181
*/
11821182
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
1183-
(const void *) locktag,
1183+
locktag,
11841184
hashcode,
11851185
HASH_ENTER_NULL,
11861186
&found);
@@ -1222,7 +1222,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
12221222
* Find or create a proclock entry with this tag
12231223
*/
12241224
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
1225-
(void *) &proclocktag,
1225+
&proclocktag,
12261226
proclock_hashcode,
12271227
HASH_ENTER_NULL,
12281228
&found);
@@ -1239,7 +1239,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
12391239
*/
12401240
Assert(dlist_is_empty(&(lock->procLocks)));
12411241
if (!hash_search_with_hash_value(LockMethodLockHash,
1242-
(void *) &(lock->tag),
1242+
&(lock->tag),
12431243
hashcode,
12441244
HASH_REMOVE,
12451245
NULL))
@@ -1391,7 +1391,7 @@ RemoveLocalLock(LOCALLOCK *locallock)
13911391
}
13921392

13931393
if (!hash_search(LockMethodLocalHash,
1394-
(void *) &(locallock->tag),
1394+
&(locallock->tag),
13951395
HASH_REMOVE, NULL))
13961396
elog(WARNING, "locallock table corrupted");
13971397

@@ -1644,7 +1644,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
16441644
dlist_delete(&proclock->procLink);
16451645
proclock_hashcode = ProcLockHashCode(&proclock->tag, hashcode);
16461646
if (!hash_search_with_hash_value(LockMethodProcLockHash,
1647-
(void *) &(proclock->tag),
1647+
&(proclock->tag),
16481648
proclock_hashcode,
16491649
HASH_REMOVE,
16501650
NULL))
@@ -1660,7 +1660,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
16601660
LOCK_PRINT("CleanUpLock: deleting", lock, 0);
16611661
Assert(dlist_is_empty(&lock->procLocks));
16621662
if (!hash_search_with_hash_value(LockMethodLockHash,
1663-
(void *) &(lock->tag),
1663+
&(lock->tag),
16641664
hashcode,
16651665
HASH_REMOVE,
16661666
NULL))
@@ -1998,7 +1998,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
19981998
localtag.mode = lockmode;
19991999

20002000
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
2001-
(void *) &localtag,
2001+
&localtag,
20022002
HASH_FIND, NULL);
20032003

20042004
/*
@@ -2112,7 +2112,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
21122112

21132113
Assert(EligibleForRelationFastPath(locktag, lockmode));
21142114
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
2115-
(const void *) locktag,
2115+
locktag,
21162116
locallock->hashcode,
21172117
HASH_FIND,
21182118
NULL);
@@ -2123,7 +2123,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
21232123
proclocktag.myLock = lock;
21242124
proclocktag.myProc = MyProc;
21252125
locallock->proclock = (PROCLOCK *) hash_search(LockMethodProcLockHash,
2126-
(void *) &proclocktag,
2126+
&proclocktag,
21272127
HASH_FIND,
21282128
NULL);
21292129
if (!locallock->proclock)
@@ -2851,7 +2851,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
28512851
LWLockAcquire(partitionLock, LW_SHARED);
28522852

28532853
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
2854-
(void *) locktag,
2854+
locktag,
28552855
locallock->hashcode,
28562856
HASH_FIND,
28572857
NULL);
@@ -2864,7 +2864,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
28642864
proclock_hashcode = ProcLockHashCode(&proclocktag, locallock->hashcode);
28652865
proclock = (PROCLOCK *)
28662866
hash_search_with_hash_value(LockMethodProcLockHash,
2867-
(void *) &proclocktag,
2867+
&proclocktag,
28682868
proclock_hashcode,
28692869
HASH_FIND,
28702870
NULL);
@@ -3028,7 +3028,7 @@ GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp)
30283028
LWLockAcquire(partitionLock, LW_SHARED);
30293029

30303030
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
3031-
(const void *) locktag,
3031+
locktag,
30323032
hashcode,
30333033
HASH_FIND,
30343034
NULL);
@@ -3125,7 +3125,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
31253125
* Re-find the lock object (it had better be there).
31263126
*/
31273127
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
3128-
(void *) locktag,
3128+
locktag,
31293129
hashcode,
31303130
HASH_FIND,
31313131
NULL);
@@ -3141,7 +3141,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
31413141
proclock_hashcode = ProcLockHashCode(&proclocktag, hashcode);
31423142

31433143
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
3144-
(void *) &proclocktag,
3144+
&proclocktag,
31453145
proclock_hashcode,
31463146
HASH_FIND,
31473147
NULL);
@@ -3255,7 +3255,7 @@ CheckForSessionAndXactLocks(void)
32553255

32563256
/* Otherwise, find or make an entry in lockhtab */
32573257
hentry = (PerLockTagEntry *) hash_search(lockhtab,
3258-
(void *) &locallock->tag.lock,
3258+
&locallock->tag.lock,
32593259
HASH_ENTER, &found);
32603260
if (!found) /* initialize, if newly created */
32613261
hentry->sessLock = hentry->xactLock = false;
@@ -3555,8 +3555,8 @@ PostPrepare_Locks(TransactionId xid)
35553555
* given lock with my own proc.
35563556
*/
35573557
if (!hash_update_hash_key(LockMethodProcLockHash,
3558-
(void *) proclock,
3559-
(void *) &proclocktag))
3558+
proclock,
3559+
&proclocktag))
35603560
elog(PANIC, "duplicate entry found while reassigning a prepared transaction's locks");
35613561

35623562
/* Re-link into the new proc's proclock list */
@@ -4202,7 +4202,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
42024202
* Find or create a lock with this tag.
42034203
*/
42044204
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
4205-
(void *) locktag,
4205+
locktag,
42064206
hashcode,
42074207
HASH_ENTER_NULL,
42084208
&found);
@@ -4250,7 +4250,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
42504250
* Find or create a proclock entry with this tag
42514251
*/
42524252
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
4253-
(void *) &proclocktag,
4253+
&proclocktag,
42544254
proclock_hashcode,
42554255
HASH_ENTER_NULL,
42564256
&found);
@@ -4267,7 +4267,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
42674267
*/
42684268
Assert(dlist_is_empty(&lock->procLocks));
42694269
if (!hash_search_with_hash_value(LockMethodLockHash,
4270-
(void *) &(lock->tag),
4270+
&(lock->tag),
42714271
hashcode,
42724272
HASH_REMOVE,
42734273
NULL))
@@ -4679,7 +4679,7 @@ LockWaiterCount(const LOCKTAG *locktag)
46794679
LWLockAcquire(partitionLock, LW_EXCLUSIVE);
46804680

46814681
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
4682-
(const void *) locktag,
4682+
locktag,
46834683
hashcode,
46844684
HASH_FIND,
46854685
&found);

‎src/backend/storage/smgr/smgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ smgropen(RelFileLocator rlocator, BackendId backend)
165165
brlocator.locator = rlocator;
166166
brlocator.backend = backend;
167167
reln = (SMgrRelation) hash_search(SMgrRelationHash,
168-
(void *) &brlocator,
168+
&brlocator,
169169
HASH_ENTER, &found);
170170

171171
/* Initialize it if not present before */
@@ -267,7 +267,7 @@ smgrclose(SMgrRelation reln)
267267
dlist_delete(&reln->node);
268268

269269
if (hash_search(SMgrRelationHash,
270-
(void *) &(reln->smgr_rlocator),
270+
&(reln->smgr_rlocator),
271271
HASH_REMOVE, NULL) == NULL)
272272
elog(ERROR, "SMgrRelation hashtable corrupted");
273273

@@ -352,7 +352,7 @@ smgrcloserellocator(RelFileLocatorBackend rlocator)
352352
return;
353353

354354
reln = (SMgrRelation) hash_search(SMgrRelationHash,
355-
(void *) &rlocator,
355+
&rlocator,
356356
HASH_FIND, NULL);
357357
if (reln != NULL)
358358
smgrclose(reln);

‎src/backend/storage/sync/sync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
501501

502502
/* Cancel previously entered request */
503503
entry = (PendingFsyncEntry *) hash_search(pendingOps,
504-
(void *) ftag,
504+
ftag,
505505
HASH_FIND,
506506
NULL);
507507
if (entry != NULL)
@@ -557,7 +557,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
557557
Assert(type == SYNC_REQUEST);
558558

559559
entry = (PendingFsyncEntry *) hash_search(pendingOps,
560-
(void *) ftag,
560+
ftag,
561561
HASH_ENTER,
562562
&found);
563563
/* if new entry, or was previously canceled, initialize it */

‎src/backend/tsearch/ts_typanalyze.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ compute_tsvector_stats(VacAttrStats *stats,
254254

255255
/* Lookup current lexeme in hashtable, adding it if new */
256256
item = (TrackItem *) hash_search(lexemes_tab,
257-
(const void *) &hash_key,
257+
&hash_key,
258258
HASH_ENTER, &found);
259259

260260
if (found)
@@ -464,7 +464,7 @@ prune_lexemes_hashtable(HTAB *lexemes_tab, int b_current)
464464
{
465465
char *lexeme = item->key.lexeme;
466466

467-
if (hash_search(lexemes_tab, (const void *) &item->key,
467+
if (hash_search(lexemes_tab, &item->key,
468468
HASH_REMOVE, NULL) == NULL)
469469
elog(ERROR, "hash table corrupted");
470470
pfree(lexeme);

‎src/backend/utils/adt/array_typanalyze.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
362362
/* Lookup current element in hashtable, adding it if new */
363363
elem_value = elem_values[j];
364364
item = (TrackItem *) hash_search(elements_tab,
365-
(const void *) &elem_value,
365+
&elem_value,
366366
HASH_ENTER, &found);
367367

368368
if (found)
@@ -690,7 +690,7 @@ prune_element_hashtable(HTAB *elements_tab, int b_current)
690690
{
691691
Datum value = item->key;
692692

693-
if (hash_search(elements_tab, (const void *) &item->key,
693+
if (hash_search(elements_tab, &item->key,
694694
HASH_REMOVE, NULL) == NULL)
695695
elog(ERROR, "hash table corrupted");
696696
/* We should free memory if element is not passed by value */

‎src/backend/utils/adt/ri_triggers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ ri_LoadConstraintInfo(Oid constraintOid)
21292129
* Find or create a hash entry. If we find a valid one, just return it.
21302130
*/
21312131
riinfo = (RI_ConstraintInfo *) hash_search(ri_constraint_cache,
2132-
(void *) &constraintOid,
2132+
&constraintOid,
21332133
HASH_ENTER, &found);
21342134
if (!found)
21352135
riinfo->valid = false;
@@ -2724,7 +2724,7 @@ ri_FetchPreparedPlan(RI_QueryKey *key)
27242724
* Lookup for the key
27252725
*/
27262726
entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
2727-
(void *) key,
2727+
key,
27282728
HASH_FIND, NULL);
27292729
if (entry == NULL)
27302730
return NULL;
@@ -2777,7 +2777,7 @@ ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan)
27772777
* invalid by ri_FetchPreparedPlan.
27782778
*/
27792779
entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
2780-
(void *) key,
2780+
key,
27812781
HASH_ENTER, &found);
27822782
Assert(!found || entry->plan == NULL);
27832783
entry->plan = plan;
@@ -2927,7 +2927,7 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid)
29272927
key.eq_opr = eq_opr;
29282928
key.typeid = typeid;
29292929
entry = (RI_CompareHashEntry *) hash_search(ri_compare_cache,
2930-
(void *) &key,
2930+
&key,
29312931
HASH_ENTER, &found);
29322932
if (!found)
29332933
entry->valid = false;

‎src/backend/utils/cache/attoptcache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
6363
if (attopt->opts)
6464
pfree(attopt->opts);
6565
if (hash_search(AttoptCacheHash,
66-
(void *) &attopt->key,
66+
&attopt->key,
6767
HASH_REMOVE,
6868
NULL) == NULL)
6969
elog(ERROR, "hash table corrupted");
@@ -116,7 +116,7 @@ get_attribute_options(Oid attrelid, int attnum)
116116
key.attnum = attnum;
117117
attopt =
118118
(AttoptCacheEntry *) hash_search(AttoptCacheHash,
119-
(void *) &key,
119+
&key,
120120
HASH_FIND,
121121
NULL);
122122

@@ -163,7 +163,7 @@ get_attribute_options(Oid attrelid, int attnum)
163163
* pg_attribute, since the read could cause a cache flush.
164164
*/
165165
attopt = (AttoptCacheEntry *) hash_search(AttoptCacheHash,
166-
(void *) &key,
166+
&key,
167167
HASH_ENTER,
168168
NULL);
169169
attopt->opts = opts;

‎src/backend/utils/cache/relcache.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int EOXactTupleDescArrayLen = 0;
210210
do { \
211211
RelIdCacheEnt *hentry; bool found; \
212212
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
213-
(void *) &((RELATION)->rd_id), \
213+
&((RELATION)->rd_id), \
214214
HASH_ENTER, &found); \
215215
if (found) \
216216
{ \
@@ -232,7 +232,7 @@ do { \
232232
do { \
233233
RelIdCacheEnt *hentry; \
234234
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
235-
(void *) &(ID), \
235+
&(ID), \
236236
HASH_FIND, NULL); \
237237
if (hentry) \
238238
RELATION = hentry->reldesc; \
@@ -244,7 +244,7 @@ do { \
244244
do { \
245245
RelIdCacheEnt *hentry; \
246246
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
247-
(void *) &((RELATION)->rd_id), \
247+
&((RELATION)->rd_id), \
248248
HASH_REMOVE, NULL); \
249249
if (hentry == NULL) \
250250
elog(WARNING, "failed to delete relcache entry for OID %u", \
@@ -1663,7 +1663,7 @@ LookupOpclassInfo(Oid operatorClassOid,
16631663
}
16641664

16651665
opcentry = (OpClassCacheEnt *) hash_search(OpClassCache,
1666-
(void *) &operatorClassOid,
1666+
&operatorClassOid,
16671667
HASH_ENTER, &found);
16681668

16691669
if (!found)
@@ -3210,7 +3210,7 @@ AtEOXact_RelationCache(bool isCommit)
32103210
for (i = 0; i < eoxact_list_len; i++)
32113211
{
32123212
idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
3213-
(void *) &eoxact_list[i],
3213+
&eoxact_list[i],
32143214
HASH_FIND,
32153215
NULL);
32163216
if (idhentry != NULL)
@@ -3359,7 +3359,7 @@ AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
33593359
for (i = 0; i < eoxact_list_len; i++)
33603360
{
33613361
idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
3362-
(void *) &eoxact_list[i],
3362+
&eoxact_list[i],
33633363
HASH_FIND,
33643364
NULL);
33653365
if (idhentry != NULL)

‎src/backend/utils/cache/relfilenumbermap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RelfilenumberMapInvalidateCallback(Datum arg, Oid relid)
7272
entry->relid == relid) /* individual flushed relation */
7373
{
7474
if (hash_search(RelfilenumberMapHash,
75-
(void *) &entry->key,
75+
&entry->key,
7676
HASH_REMOVE,
7777
NULL) == NULL)
7878
elog(ERROR, "hash table corrupted");
@@ -164,7 +164,7 @@ RelidByRelfilenumber(Oid reltablespace, RelFileNumber relfilenumber)
164164
* since querying invalid values isn't supposed to be a frequent thing,
165165
* but it's basically free.
166166
*/
167-
entry = hash_search(RelfilenumberMapHash, (void *) &key, HASH_FIND, &found);
167+
entry = hash_search(RelfilenumberMapHash, &key, HASH_FIND, &found);
168168

169169
if (found)
170170
return entry->relid;
@@ -235,7 +235,7 @@ RelidByRelfilenumber(Oid reltablespace, RelFileNumber relfilenumber)
235235
* caused cache invalidations to be executed which would have deleted a
236236
* new entry if we had entered it above.
237237
*/
238-
entry = hash_search(RelfilenumberMapHash, (void *) &key, HASH_ENTER, &found);
238+
entry = hash_search(RelfilenumberMapHash, &key, HASH_ENTER, &found);
239239
if (found)
240240
elog(ERROR, "corrupted hashtable");
241241
entry->relid = relid;

‎src/backend/utils/cache/spccache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ InvalidateTableSpaceCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
6363
if (spc->opts)
6464
pfree(spc->opts);
6565
if (hash_search(TableSpaceCacheHash,
66-
(void *) &spc->oid,
66+
&spc->oid,
6767
HASH_REMOVE,
6868
NULL) == NULL)
6969
elog(ERROR, "hash table corrupted");
@@ -121,7 +121,7 @@ get_tablespace(Oid spcid)
121121
if (!TableSpaceCacheHash)
122122
InitializeTableSpaceCache();
123123
spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
124-
(void *) &spcid,
124+
&spcid,
125125
HASH_FIND,
126126
NULL);
127127
if (spc)
@@ -163,7 +163,7 @@ get_tablespace(Oid spcid)
163163
* flush.
164164
*/
165165
spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
166-
(void *) &spcid,
166+
&spcid,
167167
HASH_ENTER,
168168
NULL);
169169
spc->opts = opts;

‎src/backend/utils/cache/ts_cache.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ lookup_ts_parser_cache(Oid prsId)
139139

140140
/* Try to look up an existing entry */
141141
entry = (TSParserCacheEntry *) hash_search(TSParserCacheHash,
142-
(void *) &prsId,
142+
&prsId,
143143
HASH_FIND, NULL);
144144
if (entry == NULL || !entry->isvalid)
145145
{
@@ -172,9 +172,7 @@ lookup_ts_parser_cache(Oid prsId)
172172

173173
/* Now make the cache entry */
174174
entry = (TSParserCacheEntry *)
175-
hash_search(TSParserCacheHash,
176-
(void *) &prsId,
177-
HASH_ENTER, &found);
175+
hash_search(TSParserCacheHash, &prsId, HASH_ENTER, &found);
178176
Assert(!found); /* it wasn't there a moment ago */
179177
}
180178

@@ -238,7 +236,7 @@ lookup_ts_dictionary_cache(Oid dictId)
238236

239237
/* Try to look up an existing entry */
240238
entry = (TSDictionaryCacheEntry *) hash_search(TSDictionaryCacheHash,
241-
(void *) &dictId,
239+
&dictId,
242240
HASH_FIND, NULL);
243241
if (entry == NULL || !entry->isvalid)
244242
{
@@ -288,7 +286,7 @@ lookup_ts_dictionary_cache(Oid dictId)
288286
/* Now make the cache entry */
289287
entry = (TSDictionaryCacheEntry *)
290288
hash_search(TSDictionaryCacheHash,
291-
(void *) &dictId,
289+
&dictId,
292290
HASH_ENTER, &found);
293291
Assert(!found); /* it wasn't there a moment ago */
294292

@@ -401,7 +399,7 @@ lookup_ts_config_cache(Oid cfgId)
401399

402400
/* Try to look up an existing entry */
403401
entry = (TSConfigCacheEntry *) hash_search(TSConfigCacheHash,
404-
(void *) &cfgId,
402+
&cfgId,
405403
HASH_FIND, NULL);
406404
if (entry == NULL || !entry->isvalid)
407405
{
@@ -441,7 +439,7 @@ lookup_ts_config_cache(Oid cfgId)
441439
/* Now make the cache entry */
442440
entry = (TSConfigCacheEntry *)
443441
hash_search(TSConfigCacheHash,
444-
(void *) &cfgId,
442+
&cfgId,
445443
HASH_ENTER, &found);
446444
Assert(!found); /* it wasn't there a moment ago */
447445
}

‎src/backend/utils/cache/typcache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ lookup_type_cache(Oid type_id, int flags)
364364

365365
/* Try to look up an existing entry */
366366
typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
367-
(void *) &type_id,
367+
&type_id,
368368
HASH_FIND, NULL);
369369
if (typentry == NULL)
370370
{
@@ -392,7 +392,7 @@ lookup_type_cache(Oid type_id, int flags)
392392

393393
/* Now make the typcache entry */
394394
typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
395-
(void *) &type_id,
395+
&type_id,
396396
HASH_ENTER, &found);
397397
Assert(!found); /* it wasn't there a moment ago */
398398

@@ -1974,7 +1974,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
19741974
* the allocations succeed before we create the new entry.
19751975
*/
19761976
recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
1977-
(void *) &tupDesc,
1977+
&tupDesc,
19781978
HASH_FIND, &found);
19791979
if (found && recentry->tupdesc != NULL)
19801980
{
@@ -2012,7 +2012,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
20122012

20132013
/* Fully initialized; create the hash table entry */
20142014
recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
2015-
(void *) &tupDesc,
2015+
&tupDesc,
20162016
HASH_ENTER, NULL);
20172017
recentry->tupdesc = entDesc;
20182018

‎src/backend/utils/time/combocid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ GetComboCommandId(CommandId cmin, CommandId cmax)
253253
key.cmin = cmin;
254254
key.cmax = cmax;
255255
entry = (ComboCidEntry) hash_search(comboHash,
256-
(void *) &key,
256+
&key,
257257
HASH_ENTER,
258258
&found);
259259

‎src/pl/plpgsql/src/pl_comp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,7 @@ plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key)
26272627
plpgsql_HashEnt *hentry;
26282628

26292629
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
2630-
(void *) func_key,
2630+
func_key,
26312631
HASH_FIND,
26322632
NULL);
26332633
if (hentry)
@@ -2644,7 +2644,7 @@ plpgsql_HashTableInsert(PLpgSQL_function *function,
26442644
bool found;
26452645

26462646
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
2647-
(void *) func_key,
2647+
func_key,
26482648
HASH_ENTER,
26492649
&found);
26502650
if (found)
@@ -2665,7 +2665,7 @@ plpgsql_HashTableDelete(PLpgSQL_function *function)
26652665
return;
26662666

26672667
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
2668-
(void *) function->fn_hashkey,
2668+
function->fn_hashkey,
26692669
HASH_REMOVE,
26702670
NULL);
26712671
if (hentry == NULL)

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7775,7 +7775,7 @@ get_cast_hashentry(PLpgSQL_execstate *estate,
77757775
cast_key.srctypmod = srctypmod;
77767776
cast_key.dsttypmod = dsttypmod;
77777777
cast_entry = (plpgsql_CastHashEntry *) hash_search(estate->cast_hash,
7778-
(void *) &cast_key,
7778+
&cast_key,
77797779
HASH_ENTER, &found);
77807780
if (!found) /* initialize if new entry */
77817781
cast_entry->cast_cexpr = NULL;

0 commit comments

Comments
 (0)
Please sign in to comment.