Remove useless casts to (void *) in hash_search() calls
authorPeter Eisentraut <[email protected]>
Mon, 6 Feb 2023 08:05:20 +0000 (09:05 +0100)
committerPeter Eisentraut <[email protected]>
Mon, 6 Feb 2023 08:41:01 +0000 (09:41 +0100)
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 <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com

28 files changed:
contrib/postgres_fdw/shippable.c
src/backend/access/gist/gistbuild.c
src/backend/access/gist/gistbuildbuffers.c
src/backend/access/transam/xlogutils.c
src/backend/catalog/storage.c
src/backend/optimizer/util/predtest.c
src/backend/parser/parse_oper.c
src/backend/replication/logical/relation.c
src/backend/replication/logical/reorderbuffer.c
src/backend/replication/pgoutput/pgoutput.c
src/backend/storage/buffer/buf_table.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/lmgr/lock.c
src/backend/storage/smgr/smgr.c
src/backend/storage/sync/sync.c
src/backend/tsearch/ts_typanalyze.c
src/backend/utils/adt/array_typanalyze.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/cache/attoptcache.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relfilenumbermap.c
src/backend/utils/cache/spccache.c
src/backend/utils/cache/ts_cache.c
src/backend/utils/cache/typcache.c
src/backend/utils/time/combocid.c
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c

index 1b47a30dbfdfe4812613f238841dfccca54e1775..eb33d2a9932e30db33f8d72da7c2ecda6238aeb6 100644 (file)
@@ -77,7 +77,7 @@ InvalidateShippableCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
    while ((entry = (ShippableCacheEntry *) hash_seq_search(&status)) != NULL)
    {
        if (hash_search(ShippableCacheHash,
-                       (void *) &entry->key,
+                       &entry->key,
                        HASH_REMOVE,
                        NULL) == NULL)
            elog(ERROR, "hash table corrupted");
@@ -183,10 +183,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
 
    /* See if we already cached the result. */
    entry = (ShippableCacheEntry *)
-       hash_search(ShippableCacheHash,
-                   (void *) &key,
-                   HASH_FIND,
-                   NULL);
+       hash_search(ShippableCacheHash, &key, HASH_FIND, NULL);
 
    if (!entry)
    {
@@ -199,10 +196,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
         * cache invalidation.
         */
        entry = (ShippableCacheEntry *)
-           hash_search(ShippableCacheHash,
-                       (void *) &key,
-                       HASH_ENTER,
-                       NULL);
+           hash_search(ShippableCacheHash, &key, HASH_ENTER, NULL);
 
        entry->shippable = shippable;
    }
index d21a308d41da052b29c4258d3bbc82df6237918b..7a6d93bb8794ae67981fd75ee98ea0a03156a865 100644 (file)
@@ -1587,7 +1587,7 @@ gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, BlockNumber pa
    bool        found;
 
    entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
-                                          (const void *) &child,
+                                          &child,
                                           HASH_ENTER,
                                           &found);
    entry->parentblkno = parent;
@@ -1625,7 +1625,7 @@ gistGetParent(GISTBuildState *buildstate, BlockNumber child)
 
    /* Find node buffer in hash table */
    entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
-                                          (const void *) &child,
+                                          &child,
                                           HASH_FIND,
                                           &found);
    if (!found)
index 3399a6ae6850ef6159f0166029dcc6aac405bdef..95cbed43371abdc0a3fd5147223b72bb1abcf4a7 100644 (file)
@@ -122,7 +122,7 @@ gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
 
    /* Find node buffer in hash table */
    nodeBuffer = (GISTNodeBuffer *) hash_search(gfbb->nodeBuffersTab,
-                                               (const void *) &nodeBlocknum,
+                                               &nodeBlocknum,
                                                HASH_ENTER,
                                                &found);
    if (!found)
index 87ca9dfef167f91903d84e1d4cf12593f90ec20d..2c28956b1aafc84ef3ca92e0c90ea4b4f91d28bf 100644 (file)
@@ -151,7 +151,7 @@ log_invalid_page(RelFileLocator locator, ForkNumber forkno, BlockNumber blkno,
    key.forkno = forkno;
    key.blkno = blkno;
    hentry = (xl_invalid_page *)
-       hash_search(invalid_page_tab, (void *) &key, HASH_ENTER, &found);
+       hash_search(invalid_page_tab, &key, HASH_ENTER, &found);
 
    if (!found)
    {
@@ -193,7 +193,7 @@ forget_invalid_pages(RelFileLocator locator, ForkNumber forkno,
            }
 
            if (hash_search(invalid_page_tab,
-                           (void *) &hentry->key,
+                           &hentry->key,
                            HASH_REMOVE, NULL) == NULL)
                elog(ERROR, "hash table corrupted");
        }
@@ -226,7 +226,7 @@ forget_invalid_pages_db(Oid dbid)
            }
 
            if (hash_search(invalid_page_tab,
-                           (void *) &hentry->key,
+                           &hentry->key,
                            HASH_REMOVE, NULL) == NULL)
                elog(ERROR, "hash table corrupted");
        }
index 039ada94c4f4a2186e556d2cba9ee0c9f1688677..af1491aa1d1e5486c3da23fad2ec3c4063bf7fdc 100644 (file)
@@ -603,7 +603,7 @@ SerializePendingSyncs(Size maxSize, char *startAddress)
    /* remove deleted rnodes */
    for (delete = pendingDeletes; delete != NULL; delete = delete->next)
        if (delete->atCommit)
-           (void) hash_search(tmphash, (void *) &delete->rlocator,
+           (void) hash_search(tmphash, &delete->rlocator,
                               HASH_REMOVE, NULL);
 
    hash_seq_init(&scan, tmphash);
@@ -748,7 +748,7 @@ smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
    /* Skip syncing nodes that smgrDoPendingDeletes() will delete. */
    for (pending = pendingDeletes; pending != NULL; pending = pending->next)
        if (pending->atCommit)
-           (void) hash_search(pendingSyncHash, (void *) &pending->rlocator,
+           (void) hash_search(pendingSyncHash, &pending->rlocator,
                               HASH_REMOVE, NULL);
 
    hash_seq_init(&scan, pendingSyncHash);
index f6e12856ddb64ed4b743c146475ac3dec0f7e655..237c8838743ba1dce491205b9a6e78c47a591786 100644 (file)
@@ -2040,7 +2040,7 @@ lookup_proof_cache(Oid pred_op, Oid clause_op, bool refute_it)
    key.pred_op = pred_op;
    key.clause_op = clause_op;
    cache_entry = (OprProofCacheEntry *) hash_search(OprProofCacheHash,
-                                                    (void *) &key,
+                                                    &key,
                                                     HASH_ENTER, &cfound);
    if (!cfound)
    {
index 8801f30898497c9baa188748da3d38da641ce60e..bdc8f8e26afcf4d7d960c47698dae3639a10f286 100644 (file)
@@ -1017,7 +1017,7 @@ find_oper_cache_entry(OprCacheKey *key)
 
    /* Look for an existing entry */
    oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
-                                            (void *) key,
+                                            key,
                                             HASH_FIND, NULL);
    if (oprentry == NULL)
        return InvalidOid;
@@ -1038,7 +1038,7 @@ make_oper_cache_entry(OprCacheKey *key, Oid opr_oid)
    Assert(OprCacheHash != NULL);
 
    oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
-                                            (void *) key,
+                                            key,
                                             HASH_ENTER, NULL);
    oprentry->opr_oid = opr_oid;
 }
@@ -1060,7 +1060,7 @@ InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
    while ((hentry = (OprCacheEntry *) hash_seq_search(&status)) != NULL)
    {
        if (hash_search(OprCacheHash,
-                       (void *) &hentry->key,
+                       &hentry->key,
                        HASH_REMOVE, NULL) == NULL)
            elog(ERROR, "hash table corrupted");
    }
index ca88ae171cbc804514aae9ec3c3844b0a6141071..9f139c64dba7ad4865688326e58f64f5b800d93d 100644 (file)
@@ -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;
index efe057b4de2c08ecce15b696fe38b90e5997bcd3..0468d12936f7fe7a57dfdb0bc71e61b55c869c5e 100644 (file)
@@ -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
index 1a80d67bb9c7de1fcc85acb769d04b26ed693c71..e4938d8888fc680ac466122ffc2520e93a6fab3a 100644 (file)
@@ -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);
 
index e61546a5ff6757181ee4081a489d68880790acfb..2b96639a5a5a5a59064158deeabdd7cda22c38d9 100644 (file)
@@ -94,7 +94,7 @@ BufTableLookup(BufferTag *tagPtr, uint32 hashcode)
 
    result = (BufferLookupEnt *)
        hash_search_with_hash_value(SharedBufHash,
-                                   (void *) tagPtr,
+                                   tagPtr,
                                    hashcode,
                                    HASH_FIND,
                                    NULL);
@@ -126,7 +126,7 @@ BufTableInsert(BufferTag *tagPtr, uint32 hashcode, int buf_id)
 
    result = (BufferLookupEnt *)
        hash_search_with_hash_value(SharedBufHash,
-                                   (void *) tagPtr,
+                                   tagPtr,
                                    hashcode,
                                    HASH_ENTER,
                                    &found);
@@ -152,7 +152,7 @@ BufTableDelete(BufferTag *tagPtr, uint32 hashcode)
 
    result = (BufferLookupEnt *)
        hash_search_with_hash_value(SharedBufHash,
-                                   (void *) tagPtr,
+                                   tagPtr,
                                    hashcode,
                                    HASH_REMOVE,
                                    NULL);
index 800a4248c955b7a7c1d895cba416a0f5888b992e..1bc8d6555b9e2f46e96e4a9475a57f7aa486f6b3 100644 (file)
@@ -262,7 +262,7 @@ ReservePrivateRefCountEntry(void)
 
        /* enter victim array entry into hashtable */
        hashent = hash_search(PrivateRefCountHash,
-                             (void *) &(ReservedRefCountEntry->buffer),
+                             &(ReservedRefCountEntry->buffer),
                              HASH_ENTER,
                              &found);
        Assert(!found);
@@ -336,10 +336,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
    if (PrivateRefCountOverflowed == 0)
        return NULL;
 
-   res = hash_search(PrivateRefCountHash,
-                     (void *) &buffer,
-                     HASH_FIND,
-                     NULL);
+   res = hash_search(PrivateRefCountHash, &buffer, HASH_FIND, NULL);
 
    if (res == NULL)
        return NULL;
@@ -368,10 +365,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
        free->refcount = res->refcount;
 
        /* delete from hashtable */
-       hash_search(PrivateRefCountHash,
-                   (void *) &buffer,
-                   HASH_REMOVE,
-                   &found);
+       hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
        Assert(found);
        Assert(PrivateRefCountOverflowed > 0);
        PrivateRefCountOverflowed--;
@@ -430,10 +424,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
        bool        found;
        Buffer      buffer = ref->buffer;
 
-       hash_search(PrivateRefCountHash,
-                   (void *) &buffer,
-                   HASH_REMOVE,
-                   &found);
+       hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
        Assert(found);
        Assert(PrivateRefCountOverflowed > 0);
        PrivateRefCountOverflowed--;
index 8372acc383d75496251e946e91e8b7298a5dfb93..71e2a5fecd5795658b1a01857e099de492ae0224 100644 (file)
@@ -76,7 +76,7 @@ PrefetchLocalBuffer(SMgrRelation smgr, ForkNumber forkNum,
 
    /* See if the desired buffer already exists */
    hresult = (LocalBufferLookupEnt *)
-       hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL);
+       hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
 
    if (hresult)
    {
@@ -125,7 +125,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
 
    /* See if the desired buffer already exists */
    hresult = (LocalBufferLookupEnt *)
-       hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL);
+       hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
 
    if (hresult)
    {
@@ -248,8 +248,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
    if (buf_state & BM_TAG_VALID)
    {
        hresult = (LocalBufferLookupEnt *)
-           hash_search(LocalBufHash, (void *) &bufHdr->tag,
-                       HASH_REMOVE, NULL);
+           hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
        if (!hresult)           /* shouldn't happen */
            elog(ERROR, "local buffer hash table corrupted");
        /* mark buffer invalid just in case hash insert fails */
@@ -259,7 +258,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
    }
 
    hresult = (LocalBufferLookupEnt *)
-       hash_search(LocalBufHash, (void *) &newTag, HASH_ENTER, &found);
+       hash_search(LocalBufHash, &newTag, HASH_ENTER, &found);
    if (found)                  /* shouldn't happen */
        elog(ERROR, "local buffer hash table corrupted");
    hresult->id = b;
@@ -351,8 +350,7 @@ DropRelationLocalBuffers(RelFileLocator rlocator, ForkNumber forkNum,
 
            /* Remove entry from hashtable */
            hresult = (LocalBufferLookupEnt *)
-               hash_search(LocalBufHash, (void *) &bufHdr->tag,
-                           HASH_REMOVE, NULL);
+               hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
            if (!hresult)       /* shouldn't happen */
                elog(ERROR, "local buffer hash table corrupted");
            /* Mark buffer invalid */
@@ -396,8 +394,7 @@ DropRelationAllLocalBuffers(RelFileLocator rlocator)
                     LocalRefCount[i]);
            /* Remove entry from hashtable */
            hresult = (LocalBufferLookupEnt *)
-               hash_search(LocalBufHash, (void *) &bufHdr->tag,
-                           HASH_REMOVE, NULL);
+               hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
            if (!hresult)       /* shouldn't happen */
                elog(ERROR, "local buffer hash table corrupted");
            /* Mark buffer invalid */
index 49d62a0dc7e6dc422d7387c7e55ba5b14fb63739..a87372f33f950e3459bacf3d7bebc554e4d96298 100644 (file)
@@ -608,7 +608,7 @@ LockHeldByMe(const LOCKTAG *locktag, LOCKMODE lockmode)
    localtag.mode = lockmode;
 
    locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
-                                         (void *) &localtag,
+                                         &localtag,
                                          HASH_FIND, NULL);
 
    return (locallock && locallock->nLocks > 0);
@@ -663,7 +663,7 @@ LockHasWaiters(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
    localtag.mode = lockmode;
 
    locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
-                                         (void *) &localtag,
+                                         &localtag,
                                          HASH_FIND, NULL);
 
    /*
@@ -825,7 +825,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
    localtag.mode = lockmode;
 
    locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
-                                         (void *) &localtag,
+                                         &localtag,
                                          HASH_ENTER, &found);
 
    /*
@@ -1061,7 +1061,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
                dlist_delete(&proclock->lockLink);
                dlist_delete(&proclock->procLink);
                if (!hash_search_with_hash_value(LockMethodProcLockHash,
-                                                (void *) &(proclock->tag),
+                                                &(proclock->tag),
                                                 proclock_hashcode,
                                                 HASH_REMOVE,
                                                 NULL))
@@ -1180,7 +1180,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
     * Find or create a lock with this tag.
     */
    lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                               (const void *) locktag,
+                                               locktag,
                                                hashcode,
                                                HASH_ENTER_NULL,
                                                &found);
@@ -1222,7 +1222,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
     * Find or create a proclock entry with this tag
     */
    proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
-                                                       (void *) &proclocktag,
+                                                       &proclocktag,
                                                        proclock_hashcode,
                                                        HASH_ENTER_NULL,
                                                        &found);
@@ -1239,7 +1239,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
             */
            Assert(dlist_is_empty(&(lock->procLocks)));
            if (!hash_search_with_hash_value(LockMethodLockHash,
-                                            (void *) &(lock->tag),
+                                            &(lock->tag),
                                             hashcode,
                                             HASH_REMOVE,
                                             NULL))
@@ -1391,7 +1391,7 @@ RemoveLocalLock(LOCALLOCK *locallock)
    }
 
    if (!hash_search(LockMethodLocalHash,
-                    (void *) &(locallock->tag),
+                    &(locallock->tag),
                     HASH_REMOVE, NULL))
        elog(WARNING, "locallock table corrupted");
 
@@ -1644,7 +1644,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
        dlist_delete(&proclock->procLink);
        proclock_hashcode = ProcLockHashCode(&proclock->tag, hashcode);
        if (!hash_search_with_hash_value(LockMethodProcLockHash,
-                                        (void *) &(proclock->tag),
+                                        &(proclock->tag),
                                         proclock_hashcode,
                                         HASH_REMOVE,
                                         NULL))
@@ -1660,7 +1660,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
        LOCK_PRINT("CleanUpLock: deleting", lock, 0);
        Assert(dlist_is_empty(&lock->procLocks));
        if (!hash_search_with_hash_value(LockMethodLockHash,
-                                        (void *) &(lock->tag),
+                                        &(lock->tag),
                                         hashcode,
                                         HASH_REMOVE,
                                         NULL))
@@ -1998,7 +1998,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
    localtag.mode = lockmode;
 
    locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
-                                         (void *) &localtag,
+                                         &localtag,
                                          HASH_FIND, NULL);
 
    /*
@@ -2112,7 +2112,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
 
        Assert(EligibleForRelationFastPath(locktag, lockmode));
        lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                                   (const void *) locktag,
+                                                   locktag,
                                                    locallock->hashcode,
                                                    HASH_FIND,
                                                    NULL);
@@ -2123,7 +2123,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
        proclocktag.myLock = lock;
        proclocktag.myProc = MyProc;
        locallock->proclock = (PROCLOCK *) hash_search(LockMethodProcLockHash,
-                                                      (void *) &proclocktag,
+                                                      &proclocktag,
                                                       HASH_FIND,
                                                       NULL);
        if (!locallock->proclock)
@@ -2851,7 +2851,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
        LWLockAcquire(partitionLock, LW_SHARED);
 
        lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                                   (void *) locktag,
+                                                   locktag,
                                                    locallock->hashcode,
                                                    HASH_FIND,
                                                    NULL);
@@ -2864,7 +2864,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
        proclock_hashcode = ProcLockHashCode(&proclocktag, locallock->hashcode);
        proclock = (PROCLOCK *)
            hash_search_with_hash_value(LockMethodProcLockHash,
-                                       (void *) &proclocktag,
+                                       &proclocktag,
                                        proclock_hashcode,
                                        HASH_FIND,
                                        NULL);
@@ -3028,7 +3028,7 @@ GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp)
    LWLockAcquire(partitionLock, LW_SHARED);
 
    lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                               (const void *) locktag,
+                                               locktag,
                                                hashcode,
                                                HASH_FIND,
                                                NULL);
@@ -3125,7 +3125,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
     * Re-find the lock object (it had better be there).
     */
    lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                               (void *) locktag,
+                                               locktag,
                                                hashcode,
                                                HASH_FIND,
                                                NULL);
@@ -3141,7 +3141,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
    proclock_hashcode = ProcLockHashCode(&proclocktag, hashcode);
 
    proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
-                                                       (void *) &proclocktag,
+                                                       &proclocktag,
                                                        proclock_hashcode,
                                                        HASH_FIND,
                                                        NULL);
@@ -3255,7 +3255,7 @@ CheckForSessionAndXactLocks(void)
 
        /* Otherwise, find or make an entry in lockhtab */
        hentry = (PerLockTagEntry *) hash_search(lockhtab,
-                                                (void *) &locallock->tag.lock,
+                                                &locallock->tag.lock,
                                                 HASH_ENTER, &found);
        if (!found)             /* initialize, if newly created */
            hentry->sessLock = hentry->xactLock = false;
@@ -3555,8 +3555,8 @@ PostPrepare_Locks(TransactionId xid)
             * given lock with my own proc.
             */
            if (!hash_update_hash_key(LockMethodProcLockHash,
-                                     (void *) proclock,
-                                     (void *) &proclocktag))
+                                     proclock,
+                                     &proclocktag))
                elog(PANIC, "duplicate entry found while reassigning a prepared transaction's locks");
 
            /* Re-link into the new proc's proclock list */
@@ -4202,7 +4202,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
     * Find or create a lock with this tag.
     */
    lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                               (void *) locktag,
+                                               locktag,
                                                hashcode,
                                                HASH_ENTER_NULL,
                                                &found);
@@ -4250,7 +4250,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
     * Find or create a proclock entry with this tag
     */
    proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
-                                                       (void *) &proclocktag,
+                                                       &proclocktag,
                                                        proclock_hashcode,
                                                        HASH_ENTER_NULL,
                                                        &found);
@@ -4267,7 +4267,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
             */
            Assert(dlist_is_empty(&lock->procLocks));
            if (!hash_search_with_hash_value(LockMethodLockHash,
-                                            (void *) &(lock->tag),
+                                            &(lock->tag),
                                             hashcode,
                                             HASH_REMOVE,
                                             NULL))
@@ -4679,7 +4679,7 @@ LockWaiterCount(const LOCKTAG *locktag)
    LWLockAcquire(partitionLock, LW_EXCLUSIVE);
 
    lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
-                                               (const void *) locktag,
+                                               locktag,
                                                hashcode,
                                                HASH_FIND,
                                                &found);
index 80eb6311e74f9e4b9f4633b64f752c67cc3ee40c..b2bd749d7703b9d2ce61fd907f7f957cedef2cae 100644 (file)
@@ -165,7 +165,7 @@ smgropen(RelFileLocator rlocator, BackendId backend)
    brlocator.locator = rlocator;
    brlocator.backend = backend;
    reln = (SMgrRelation) hash_search(SMgrRelationHash,
-                                     (void *) &brlocator,
+                                     &brlocator,
                                      HASH_ENTER, &found);
 
    /* Initialize it if not present before */
@@ -267,7 +267,7 @@ smgrclose(SMgrRelation reln)
        dlist_delete(&reln->node);
 
    if (hash_search(SMgrRelationHash,
-                   (void *) &(reln->smgr_rlocator),
+                   &(reln->smgr_rlocator),
                    HASH_REMOVE, NULL) == NULL)
        elog(ERROR, "SMgrRelation hashtable corrupted");
 
@@ -352,7 +352,7 @@ smgrcloserellocator(RelFileLocatorBackend rlocator)
        return;
 
    reln = (SMgrRelation) hash_search(SMgrRelationHash,
-                                     (void *) &rlocator,
+                                     &rlocator,
                                      HASH_FIND, NULL);
    if (reln != NULL)
        smgrclose(reln);
index 7135150b1676ea178321a075c398a2d9b055ca18..768d1dbfc41c45f09049bde4f6a123eaaebb11af 100644 (file)
@@ -501,7 +501,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
 
        /* Cancel previously entered request */
        entry = (PendingFsyncEntry *) hash_search(pendingOps,
-                                                 (void *) ftag,
+                                                 ftag,
                                                  HASH_FIND,
                                                  NULL);
        if (entry != NULL)
@@ -557,7 +557,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
        Assert(type == SYNC_REQUEST);
 
        entry = (PendingFsyncEntry *) hash_search(pendingOps,
-                                                 (void *) ftag,
+                                                 ftag,
                                                  HASH_ENTER,
                                                  &found);
        /* if new entry, or was previously canceled, initialize it */
index ae4b5d10f298b88afe8ce5f960f70585e8970b79..75ecd72efe1e89381bf3b179d9a1da656c072571 100644 (file)
@@ -254,7 +254,7 @@ compute_tsvector_stats(VacAttrStats *stats,
 
            /* Lookup current lexeme in hashtable, adding it if new */
            item = (TrackItem *) hash_search(lexemes_tab,
-                                            (const void *) &hash_key,
+                                            &hash_key,
                                             HASH_ENTER, &found);
 
            if (found)
@@ -464,7 +464,7 @@ prune_lexemes_hashtable(HTAB *lexemes_tab, int b_current)
        {
            char       *lexeme = item->key.lexeme;
 
-           if (hash_search(lexemes_tab, (const void *) &item->key,
+           if (hash_search(lexemes_tab, &item->key,
                            HASH_REMOVE, NULL) == NULL)
                elog(ERROR, "hash table corrupted");
            pfree(lexeme);
index 5841d7d6fcbbfcfc5e586a2e7f70a1544a444a93..52e160d6bbb200ec8ed7cab830eb0fd0425cdb13 100644 (file)
@@ -362,7 +362,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
            /* Lookup current element in hashtable, adding it if new */
            elem_value = elem_values[j];
            item = (TrackItem *) hash_search(elements_tab,
-                                            (const void *) &elem_value,
+                                            &elem_value,
                                             HASH_ENTER, &found);
 
            if (found)
@@ -690,7 +690,7 @@ prune_element_hashtable(HTAB *elements_tab, int b_current)
        {
            Datum       value = item->key;
 
-           if (hash_search(elements_tab, (const void *) &item->key,
+           if (hash_search(elements_tab, &item->key,
                            HASH_REMOVE, NULL) == NULL)
                elog(ERROR, "hash table corrupted");
            /* We should free memory if element is not passed by value */
index 995571ae044344c9854522d9cdb5b2c10aa8ad46..375b17b9f3bb17c6584e69f58457e5079877de77 100644 (file)
@@ -2129,7 +2129,7 @@ ri_LoadConstraintInfo(Oid constraintOid)
     * Find or create a hash entry.  If we find a valid one, just return it.
     */
    riinfo = (RI_ConstraintInfo *) hash_search(ri_constraint_cache,
-                                              (void *) &constraintOid,
+                                              &constraintOid,
                                               HASH_ENTER, &found);
    if (!found)
        riinfo->valid = false;
@@ -2724,7 +2724,7 @@ ri_FetchPreparedPlan(RI_QueryKey *key)
     * Lookup for the key
     */
    entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
-                                             (void *) key,
+                                             key,
                                              HASH_FIND, NULL);
    if (entry == NULL)
        return NULL;
@@ -2777,7 +2777,7 @@ ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan)
     * invalid by ri_FetchPreparedPlan.
     */
    entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
-                                             (void *) key,
+                                             key,
                                              HASH_ENTER, &found);
    Assert(!found || entry->plan == NULL);
    entry->plan = plan;
@@ -2927,7 +2927,7 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid)
    key.eq_opr = eq_opr;
    key.typeid = typeid;
    entry = (RI_CompareHashEntry *) hash_search(ri_compare_cache,
-                                               (void *) &key,
+                                               &key,
                                                HASH_ENTER, &found);
    if (!found)
        entry->valid = false;
index 28a99f0fc42598b8fea34679b33dfe593159dd97..6769d4765b16eec02eb5c744d735ecb35b91041e 100644 (file)
@@ -63,7 +63,7 @@ InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
        if (attopt->opts)
            pfree(attopt->opts);
        if (hash_search(AttoptCacheHash,
-                       (void *) &attopt->key,
+                       &attopt->key,
                        HASH_REMOVE,
                        NULL) == NULL)
            elog(ERROR, "hash table corrupted");
@@ -116,7 +116,7 @@ get_attribute_options(Oid attrelid, int attnum)
    key.attnum = attnum;
    attopt =
        (AttoptCacheEntry *) hash_search(AttoptCacheHash,
-                                        (void *) &key,
+                                        &key,
                                         HASH_FIND,
                                         NULL);
 
@@ -163,7 +163,7 @@ get_attribute_options(Oid attrelid, int attnum)
         * pg_attribute, since the read could cause a cache flush.
         */
        attopt = (AttoptCacheEntry *) hash_search(AttoptCacheHash,
-                                                 (void *) &key,
+                                                 &key,
                                                  HASH_ENTER,
                                                  NULL);
        attopt->opts = opts;
index d171cfcf2fc5a9c6f6b35ed59f4ed9f9953a57fb..dfda0ab7d69d25b24badbd861185815c364f60e6 100644 (file)
@@ -210,7 +210,7 @@ static int  EOXactTupleDescArrayLen = 0;
 do { \
    RelIdCacheEnt *hentry; bool found; \
    hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
-                                          (void *) &((RELATION)->rd_id), \
+                                          &((RELATION)->rd_id), \
                                           HASH_ENTER, &found); \
    if (found) \
    { \
@@ -232,7 +232,7 @@ do { \
 do { \
    RelIdCacheEnt *hentry; \
    hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
-                                          (void *) &(ID), \
+                                          &(ID), \
                                           HASH_FIND, NULL); \
    if (hentry) \
        RELATION = hentry->reldesc; \
@@ -244,7 +244,7 @@ do { \
 do { \
    RelIdCacheEnt *hentry; \
    hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
-                                          (void *) &((RELATION)->rd_id), \
+                                          &((RELATION)->rd_id), \
                                           HASH_REMOVE, NULL); \
    if (hentry == NULL) \
        elog(WARNING, "failed to delete relcache entry for OID %u", \
@@ -1663,7 +1663,7 @@ LookupOpclassInfo(Oid operatorClassOid,
    }
 
    opcentry = (OpClassCacheEnt *) hash_search(OpClassCache,
-                                              (void *) &operatorClassOid,
+                                              &operatorClassOid,
                                               HASH_ENTER, &found);
 
    if (!found)
@@ -3210,7 +3210,7 @@ AtEOXact_RelationCache(bool isCommit)
        for (i = 0; i < eoxact_list_len; i++)
        {
            idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
-                                                    (void *) &eoxact_list[i],
+                                                    &eoxact_list[i],
                                                     HASH_FIND,
                                                     NULL);
            if (idhentry != NULL)
@@ -3359,7 +3359,7 @@ AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
        for (i = 0; i < eoxact_list_len; i++)
        {
            idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
-                                                    (void *) &eoxact_list[i],
+                                                    &eoxact_list[i],
                                                     HASH_FIND,
                                                     NULL);
            if (idhentry != NULL)
index 57c3254795959519f591cf311a44f5aee3ffa342..220f33d43f5ab1b5c846ae0b0f6d65fcefe2aff5 100644 (file)
@@ -72,7 +72,7 @@ RelfilenumberMapInvalidateCallback(Datum arg, Oid relid)
            entry->relid == relid)  /* individual flushed relation */
        {
            if (hash_search(RelfilenumberMapHash,
-                           (void *) &entry->key,
+                           &entry->key,
                            HASH_REMOVE,
                            NULL) == NULL)
                elog(ERROR, "hash table corrupted");
@@ -164,7 +164,7 @@ RelidByRelfilenumber(Oid reltablespace, RelFileNumber relfilenumber)
     * since querying invalid values isn't supposed to be a frequent thing,
     * but it's basically free.
     */
-   entry = hash_search(RelfilenumberMapHash, (void *) &key, HASH_FIND, &found);
+   entry = hash_search(RelfilenumberMapHash, &key, HASH_FIND, &found);
 
    if (found)
        return entry->relid;
@@ -235,7 +235,7 @@ RelidByRelfilenumber(Oid reltablespace, RelFileNumber relfilenumber)
     * caused cache invalidations to be executed which would have deleted a
     * new entry if we had entered it above.
     */
-   entry = hash_search(RelfilenumberMapHash, (void *) &key, HASH_ENTER, &found);
+   entry = hash_search(RelfilenumberMapHash, &key, HASH_ENTER, &found);
    if (found)
        elog(ERROR, "corrupted hashtable");
    entry->relid = relid;
index aabe6ba64b1c4ed494f5af9e3f96b241bb2dfc11..136fd737d37574aa37fd57306b758d32885b4d0c 100644 (file)
@@ -63,7 +63,7 @@ InvalidateTableSpaceCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
        if (spc->opts)
            pfree(spc->opts);
        if (hash_search(TableSpaceCacheHash,
-                       (void *) &spc->oid,
+                       &spc->oid,
                        HASH_REMOVE,
                        NULL) == NULL)
            elog(ERROR, "hash table corrupted");
@@ -121,7 +121,7 @@ get_tablespace(Oid spcid)
    if (!TableSpaceCacheHash)
        InitializeTableSpaceCache();
    spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
-                                              (void *) &spcid,
+                                              &spcid,
                                               HASH_FIND,
                                               NULL);
    if (spc)
@@ -163,7 +163,7 @@ get_tablespace(Oid spcid)
     * flush.
     */
    spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
-                                              (void *) &spcid,
+                                              &spcid,
                                               HASH_ENTER,
                                               NULL);
    spc->opts = opts;
index 519fa9fa7312d60102f1749a4814e3ae4f7f1e95..7760ad764ea54e97781f6f2d357891d91b385d36 100644 (file)
@@ -139,7 +139,7 @@ lookup_ts_parser_cache(Oid prsId)
 
    /* Try to look up an existing entry */
    entry = (TSParserCacheEntry *) hash_search(TSParserCacheHash,
-                                              (void *) &prsId,
+                                              &prsId,
                                               HASH_FIND, NULL);
    if (entry == NULL || !entry->isvalid)
    {
@@ -172,9 +172,7 @@ lookup_ts_parser_cache(Oid prsId)
 
            /* Now make the cache entry */
            entry = (TSParserCacheEntry *)
-               hash_search(TSParserCacheHash,
-                           (void *) &prsId,
-                           HASH_ENTER, &found);
+               hash_search(TSParserCacheHash, &prsId, HASH_ENTER, &found);
            Assert(!found);     /* it wasn't there a moment ago */
        }
 
@@ -238,7 +236,7 @@ lookup_ts_dictionary_cache(Oid dictId)
 
    /* Try to look up an existing entry */
    entry = (TSDictionaryCacheEntry *) hash_search(TSDictionaryCacheHash,
-                                                  (void *) &dictId,
+                                                  &dictId,
                                                   HASH_FIND, NULL);
    if (entry == NULL || !entry->isvalid)
    {
@@ -288,7 +286,7 @@ lookup_ts_dictionary_cache(Oid dictId)
            /* Now make the cache entry */
            entry = (TSDictionaryCacheEntry *)
                hash_search(TSDictionaryCacheHash,
-                           (void *) &dictId,
+                           &dictId,
                            HASH_ENTER, &found);
            Assert(!found);     /* it wasn't there a moment ago */
 
@@ -401,7 +399,7 @@ lookup_ts_config_cache(Oid cfgId)
 
    /* Try to look up an existing entry */
    entry = (TSConfigCacheEntry *) hash_search(TSConfigCacheHash,
-                                              (void *) &cfgId,
+                                              &cfgId,
                                               HASH_FIND, NULL);
    if (entry == NULL || !entry->isvalid)
    {
@@ -441,7 +439,7 @@ lookup_ts_config_cache(Oid cfgId)
            /* Now make the cache entry */
            entry = (TSConfigCacheEntry *)
                hash_search(TSConfigCacheHash,
-                           (void *) &cfgId,
+                           &cfgId,
                            HASH_ENTER, &found);
            Assert(!found);     /* it wasn't there a moment ago */
        }
index 4a3e0fdb7fe74b91497175336e0f04f444bb7d09..ed6360ce2b94db1237568c483c99f6c78f14b208 100644 (file)
@@ -364,7 +364,7 @@ lookup_type_cache(Oid type_id, int flags)
 
    /* Try to look up an existing entry */
    typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
-                                             (void *) &type_id,
+                                             &type_id,
                                              HASH_FIND, NULL);
    if (typentry == NULL)
    {
@@ -392,7 +392,7 @@ lookup_type_cache(Oid type_id, int flags)
 
        /* Now make the typcache entry */
        typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
-                                                 (void *) &type_id,
+                                                 &type_id,
                                                  HASH_ENTER, &found);
        Assert(!found);         /* it wasn't there a moment ago */
 
@@ -1974,7 +1974,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
     * the allocations succeed before we create the new entry.
     */
    recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
-                                               (void *) &tupDesc,
+                                               &tupDesc,
                                                HASH_FIND, &found);
    if (found && recentry->tupdesc != NULL)
    {
@@ -2012,7 +2012,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
 
    /* Fully initialized; create the hash table entry */
    recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
-                                               (void *) &tupDesc,
+                                               &tupDesc,
                                                HASH_ENTER, NULL);
    recentry->tupdesc = entDesc;
 
index c7124d284fa461fa3ec048b44127a6f232c5a5d0..0e94bc93f748d64dce364efe3f4f04fc1b5b26ea 100644 (file)
@@ -253,7 +253,7 @@ GetComboCommandId(CommandId cmin, CommandId cmax)
    key.cmin = cmin;
    key.cmax = cmax;
    entry = (ComboCidEntry) hash_search(comboHash,
-                                       (void *) &key,
+                                       &key,
                                        HASH_ENTER,
                                        &found);
 
index 8ce4186240060d860b20d6f65e18c68e03bff4f1..7db912fd18b74bfd693a6e6fa5c12162e6620df9 100644 (file)
@@ -2627,7 +2627,7 @@ plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key)
    plpgsql_HashEnt *hentry;
 
    hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
-                                            (void *) func_key,
+                                            func_key,
                                             HASH_FIND,
                                             NULL);
    if (hentry)
@@ -2644,7 +2644,7 @@ plpgsql_HashTableInsert(PLpgSQL_function *function,
    bool        found;
 
    hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
-                                            (void *) func_key,
+                                            func_key,
                                             HASH_ENTER,
                                             &found);
    if (found)
@@ -2665,7 +2665,7 @@ plpgsql_HashTableDelete(PLpgSQL_function *function)
        return;
 
    hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
-                                            (void *) function->fn_hashkey,
+                                            function->fn_hashkey,
                                             HASH_REMOVE,
                                             NULL);
    if (hentry == NULL)
index 37da62438817146d4a50335350f314ccd7a4cec1..70a002a0f6af68b65723c1686ad4579852a6de02 100644 (file)
@@ -7775,7 +7775,7 @@ get_cast_hashentry(PLpgSQL_execstate *estate,
    cast_key.srctypmod = srctypmod;
    cast_key.dsttypmod = dsttypmod;
    cast_entry = (plpgsql_CastHashEntry *) hash_search(estate->cast_hash,
-                                                      (void *) &cast_key,
+                                                      &cast_key,
                                                       HASH_ENTER, &found);
    if (!found)                 /* initialize if new entry */
        cast_entry->cast_cexpr = NULL;