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
This commit is contained in:
Peter Eisentraut 2023-02-06 09:05:20 +01:00
parent 009f8d1714
commit 54a177a948
28 changed files with 108 additions and 146 deletions

View File

@ -77,7 +77,7 @@ InvalidateShippableCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
while ((entry = (ShippableCacheEntry *) hash_seq_search(&status)) != NULL) while ((entry = (ShippableCacheEntry *) hash_seq_search(&status)) != NULL)
{ {
if (hash_search(ShippableCacheHash, if (hash_search(ShippableCacheHash,
(void *) &entry->key, &entry->key,
HASH_REMOVE, HASH_REMOVE,
NULL) == NULL) NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
@ -183,10 +183,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
/* See if we already cached the result. */ /* See if we already cached the result. */
entry = (ShippableCacheEntry *) entry = (ShippableCacheEntry *)
hash_search(ShippableCacheHash, hash_search(ShippableCacheHash, &key, HASH_FIND, NULL);
(void *) &key,
HASH_FIND,
NULL);
if (!entry) if (!entry)
{ {
@ -199,10 +196,7 @@ is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
* cache invalidation. * cache invalidation.
*/ */
entry = (ShippableCacheEntry *) entry = (ShippableCacheEntry *)
hash_search(ShippableCacheHash, hash_search(ShippableCacheHash, &key, HASH_ENTER, NULL);
(void *) &key,
HASH_ENTER,
NULL);
entry->shippable = shippable; entry->shippable = shippable;
} }

View File

@ -1587,7 +1587,7 @@ gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, BlockNumber pa
bool found; bool found;
entry = (ParentMapEntry *) hash_search(buildstate->parentMap, entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
(const void *) &child, &child,
HASH_ENTER, HASH_ENTER,
&found); &found);
entry->parentblkno = parent; entry->parentblkno = parent;
@ -1625,7 +1625,7 @@ gistGetParent(GISTBuildState *buildstate, BlockNumber child)
/* Find node buffer in hash table */ /* Find node buffer in hash table */
entry = (ParentMapEntry *) hash_search(buildstate->parentMap, entry = (ParentMapEntry *) hash_search(buildstate->parentMap,
(const void *) &child, &child,
HASH_FIND, HASH_FIND,
&found); &found);
if (!found) if (!found)

View File

@ -122,7 +122,7 @@ gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
/* Find node buffer in hash table */ /* Find node buffer in hash table */
nodeBuffer = (GISTNodeBuffer *) hash_search(gfbb->nodeBuffersTab, nodeBuffer = (GISTNodeBuffer *) hash_search(gfbb->nodeBuffersTab,
(const void *) &nodeBlocknum, &nodeBlocknum,
HASH_ENTER, HASH_ENTER,
&found); &found);
if (!found) if (!found)

View File

@ -151,7 +151,7 @@ log_invalid_page(RelFileLocator locator, ForkNumber forkno, BlockNumber blkno,
key.forkno = forkno; key.forkno = forkno;
key.blkno = blkno; key.blkno = blkno;
hentry = (xl_invalid_page *) 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) if (!found)
{ {
@ -193,7 +193,7 @@ forget_invalid_pages(RelFileLocator locator, ForkNumber forkno,
} }
if (hash_search(invalid_page_tab, if (hash_search(invalid_page_tab,
(void *) &hentry->key, &hentry->key,
HASH_REMOVE, NULL) == NULL) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
} }
@ -226,7 +226,7 @@ forget_invalid_pages_db(Oid dbid)
} }
if (hash_search(invalid_page_tab, if (hash_search(invalid_page_tab,
(void *) &hentry->key, &hentry->key,
HASH_REMOVE, NULL) == NULL) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
} }

View File

@ -603,7 +603,7 @@ SerializePendingSyncs(Size maxSize, char *startAddress)
/* remove deleted rnodes */ /* remove deleted rnodes */
for (delete = pendingDeletes; delete != NULL; delete = delete->next) for (delete = pendingDeletes; delete != NULL; delete = delete->next)
if (delete->atCommit) if (delete->atCommit)
(void) hash_search(tmphash, (void *) &delete->rlocator, (void) hash_search(tmphash, &delete->rlocator,
HASH_REMOVE, NULL); HASH_REMOVE, NULL);
hash_seq_init(&scan, tmphash); hash_seq_init(&scan, tmphash);
@ -748,7 +748,7 @@ smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
/* Skip syncing nodes that smgrDoPendingDeletes() will delete. */ /* Skip syncing nodes that smgrDoPendingDeletes() will delete. */
for (pending = pendingDeletes; pending != NULL; pending = pending->next) for (pending = pendingDeletes; pending != NULL; pending = pending->next)
if (pending->atCommit) if (pending->atCommit)
(void) hash_search(pendingSyncHash, (void *) &pending->rlocator, (void) hash_search(pendingSyncHash, &pending->rlocator,
HASH_REMOVE, NULL); HASH_REMOVE, NULL);
hash_seq_init(&scan, pendingSyncHash); hash_seq_init(&scan, pendingSyncHash);

View File

@ -2040,7 +2040,7 @@ lookup_proof_cache(Oid pred_op, Oid clause_op, bool refute_it)
key.pred_op = pred_op; key.pred_op = pred_op;
key.clause_op = clause_op; key.clause_op = clause_op;
cache_entry = (OprProofCacheEntry *) hash_search(OprProofCacheHash, cache_entry = (OprProofCacheEntry *) hash_search(OprProofCacheHash,
(void *) &key, &key,
HASH_ENTER, &cfound); HASH_ENTER, &cfound);
if (!cfound) if (!cfound)
{ {

View File

@ -1017,7 +1017,7 @@ find_oper_cache_entry(OprCacheKey *key)
/* Look for an existing entry */ /* Look for an existing entry */
oprentry = (OprCacheEntry *) hash_search(OprCacheHash, oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
(void *) key, key,
HASH_FIND, NULL); HASH_FIND, NULL);
if (oprentry == NULL) if (oprentry == NULL)
return InvalidOid; return InvalidOid;
@ -1038,7 +1038,7 @@ make_oper_cache_entry(OprCacheKey *key, Oid opr_oid)
Assert(OprCacheHash != NULL); Assert(OprCacheHash != NULL);
oprentry = (OprCacheEntry *) hash_search(OprCacheHash, oprentry = (OprCacheEntry *) hash_search(OprCacheHash,
(void *) key, key,
HASH_ENTER, NULL); HASH_ENTER, NULL);
oprentry->opr_oid = opr_oid; oprentry->opr_oid = opr_oid;
} }
@ -1060,7 +1060,7 @@ InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
while ((hentry = (OprCacheEntry *) hash_seq_search(&status)) != NULL) while ((hentry = (OprCacheEntry *) hash_seq_search(&status)) != NULL)
{ {
if (hash_search(OprCacheHash, if (hash_search(OprCacheHash,
(void *) &hentry->key, &hentry->key,
HASH_REMOVE, NULL) == NULL) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
} }

View File

@ -167,7 +167,7 @@ logicalrep_relmap_update(LogicalRepRelation *remoterel)
/* /*
* HASH_ENTER returns the existing entry if present or creates a new one. * 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); HASH_ENTER, &found);
if (found) if (found)
@ -326,7 +326,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
logicalrep_relmap_init(); logicalrep_relmap_init();
/* Search for existing entry. */ /* Search for existing entry. */
entry = hash_search(LogicalRepRelMap, (void *) &remoteid, entry = hash_search(LogicalRepRelMap, &remoteid,
HASH_FIND, &found); HASH_FIND, &found);
if (!found) if (!found)
@ -598,7 +598,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
/* Search for existing entry. */ /* Search for existing entry. */
part_entry = (LogicalRepPartMapEntry *) hash_search(LogicalRepPartMap, part_entry = (LogicalRepPartMapEntry *) hash_search(LogicalRepPartMap,
(void *) &partOid, &partOid,
HASH_ENTER, &found); HASH_ENTER, &found);
entry = &part_entry->relmapentry; entry = &part_entry->relmapentry;

View File

@ -657,7 +657,7 @@ ReorderBufferTXNByXid(ReorderBuffer *rb, TransactionId xid, bool create,
/* search the lookup table */ /* search the lookup table */
ent = (ReorderBufferTXNByIdEnt *) ent = (ReorderBufferTXNByIdEnt *)
hash_search(rb->by_txn, hash_search(rb->by_txn,
(void *) &xid, &xid,
create ? HASH_ENTER : HASH_FIND, create ? HASH_ENTER : HASH_FIND,
&found); &found);
if (found) if (found)
@ -1581,10 +1581,7 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
dclist_delete_from(&rb->catchange_txns, &txn->catchange_node); dclist_delete_from(&rb->catchange_txns, &txn->catchange_node);
/* now remove reference from buffer */ /* now remove reference from buffer */
hash_search(rb->by_txn, hash_search(rb->by_txn, &txn->xid, HASH_REMOVE, &found);
(void *) &txn->xid,
HASH_REMOVE,
&found);
Assert(found); Assert(found);
/* remove entries spilled to disk */ /* remove entries spilled to disk */
@ -1762,10 +1759,7 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn)
&key.tid); &key.tid);
ent = (ReorderBufferTupleCidEnt *) ent = (ReorderBufferTupleCidEnt *)
hash_search(txn->tuplecid_hash, hash_search(txn->tuplecid_hash, &key, HASH_ENTER, &found);
(void *) &key,
HASH_ENTER,
&found);
if (!found) if (!found)
{ {
ent->cmin = change->data.tuplecid.cmin; ent->cmin = change->data.tuplecid.cmin;
@ -4653,10 +4647,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
Assert(!isnull); Assert(!isnull);
ent = (ReorderBufferToastEnt *) ent = (ReorderBufferToastEnt *)
hash_search(txn->toast_hash, hash_search(txn->toast_hash, &chunk_id, HASH_ENTER, &found);
(void *) &chunk_id,
HASH_ENTER,
&found);
if (!found) if (!found)
{ {
@ -4811,7 +4802,7 @@ ReorderBufferToastReplace(ReorderBuffer *rb, ReorderBufferTXN *txn,
*/ */
ent = (ReorderBufferToastEnt *) ent = (ReorderBufferToastEnt *)
hash_search(txn->toast_hash, hash_search(txn->toast_hash,
(void *) &toast_pointer.va_valueid, &toast_pointer.va_valueid,
HASH_FIND, HASH_FIND,
NULL); NULL);
if (ent == NULL) if (ent == NULL)
@ -5053,10 +5044,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
ent = (ReorderBufferTupleCidEnt *) ent = (ReorderBufferTupleCidEnt *)
hash_search(tuplecid_data, hash_search(tuplecid_data, &key, HASH_FIND, NULL);
(void *) &key,
HASH_FIND,
NULL);
/* no existing mapping, no need to update */ /* no existing mapping, no need to update */
if (!ent) if (!ent)
@ -5067,10 +5055,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
&key.tid); &key.tid);
new_ent = (ReorderBufferTupleCidEnt *) new_ent = (ReorderBufferTupleCidEnt *)
hash_search(tuplecid_data, hash_search(tuplecid_data, &key, HASH_ENTER, &found);
(void *) &key,
HASH_ENTER,
&found);
if (found) if (found)
{ {
@ -5249,10 +5234,7 @@ ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data,
restart: restart:
ent = (ReorderBufferTupleCidEnt *) ent = (ReorderBufferTupleCidEnt *)
hash_search(tuplecid_data, hash_search(tuplecid_data, &key, HASH_FIND, NULL);
(void *) &key,
HASH_FIND,
NULL);
/* /*
* failed to find a mapping, check whether the table was rewritten and * failed to find a mapping, check whether the table was rewritten and

View File

@ -2026,7 +2026,7 @@ get_rel_sync_entry(PGOutputData *data, Relation relation)
/* Find cached relation info, creating if not found */ /* Find cached relation info, creating if not found */
entry = (RelationSyncEntry *) hash_search(RelationSyncCache, entry = (RelationSyncEntry *) hash_search(RelationSyncCache,
(void *) &relid, &relid,
HASH_ENTER, &found); HASH_ENTER, &found);
Assert(entry != NULL); Assert(entry != NULL);

View File

@ -94,7 +94,7 @@ BufTableLookup(BufferTag *tagPtr, uint32 hashcode)
result = (BufferLookupEnt *) result = (BufferLookupEnt *)
hash_search_with_hash_value(SharedBufHash, hash_search_with_hash_value(SharedBufHash,
(void *) tagPtr, tagPtr,
hashcode, hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -126,7 +126,7 @@ BufTableInsert(BufferTag *tagPtr, uint32 hashcode, int buf_id)
result = (BufferLookupEnt *) result = (BufferLookupEnt *)
hash_search_with_hash_value(SharedBufHash, hash_search_with_hash_value(SharedBufHash,
(void *) tagPtr, tagPtr,
hashcode, hashcode,
HASH_ENTER, HASH_ENTER,
&found); &found);
@ -152,7 +152,7 @@ BufTableDelete(BufferTag *tagPtr, uint32 hashcode)
result = (BufferLookupEnt *) result = (BufferLookupEnt *)
hash_search_with_hash_value(SharedBufHash, hash_search_with_hash_value(SharedBufHash,
(void *) tagPtr, tagPtr,
hashcode, hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL); NULL);

View File

@ -262,7 +262,7 @@ ReservePrivateRefCountEntry(void)
/* enter victim array entry into hashtable */ /* enter victim array entry into hashtable */
hashent = hash_search(PrivateRefCountHash, hashent = hash_search(PrivateRefCountHash,
(void *) &(ReservedRefCountEntry->buffer), &(ReservedRefCountEntry->buffer),
HASH_ENTER, HASH_ENTER,
&found); &found);
Assert(!found); Assert(!found);
@ -336,10 +336,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
if (PrivateRefCountOverflowed == 0) if (PrivateRefCountOverflowed == 0)
return NULL; return NULL;
res = hash_search(PrivateRefCountHash, res = hash_search(PrivateRefCountHash, &buffer, HASH_FIND, NULL);
(void *) &buffer,
HASH_FIND,
NULL);
if (res == NULL) if (res == NULL)
return NULL; return NULL;
@ -368,10 +365,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
free->refcount = res->refcount; free->refcount = res->refcount;
/* delete from hashtable */ /* delete from hashtable */
hash_search(PrivateRefCountHash, hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
(void *) &buffer,
HASH_REMOVE,
&found);
Assert(found); Assert(found);
Assert(PrivateRefCountOverflowed > 0); Assert(PrivateRefCountOverflowed > 0);
PrivateRefCountOverflowed--; PrivateRefCountOverflowed--;
@ -430,10 +424,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
bool found; bool found;
Buffer buffer = ref->buffer; Buffer buffer = ref->buffer;
hash_search(PrivateRefCountHash, hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
(void *) &buffer,
HASH_REMOVE,
&found);
Assert(found); Assert(found);
Assert(PrivateRefCountOverflowed > 0); Assert(PrivateRefCountOverflowed > 0);
PrivateRefCountOverflowed--; PrivateRefCountOverflowed--;

View File

@ -76,7 +76,7 @@ PrefetchLocalBuffer(SMgrRelation smgr, ForkNumber forkNum,
/* See if the desired buffer already exists */ /* See if the desired buffer already exists */
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL); hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
if (hresult) if (hresult)
{ {
@ -125,7 +125,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
/* See if the desired buffer already exists */ /* See if the desired buffer already exists */
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &newTag, HASH_FIND, NULL); hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
if (hresult) if (hresult)
{ {
@ -248,8 +248,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
if (buf_state & BM_TAG_VALID) if (buf_state & BM_TAG_VALID)
{ {
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &bufHdr->tag, hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
HASH_REMOVE, NULL);
if (!hresult) /* shouldn't happen */ if (!hresult) /* shouldn't happen */
elog(ERROR, "local buffer hash table corrupted"); elog(ERROR, "local buffer hash table corrupted");
/* mark buffer invalid just in case hash insert fails */ /* mark buffer invalid just in case hash insert fails */
@ -259,7 +258,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
} }
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &newTag, HASH_ENTER, &found); hash_search(LocalBufHash, &newTag, HASH_ENTER, &found);
if (found) /* shouldn't happen */ if (found) /* shouldn't happen */
elog(ERROR, "local buffer hash table corrupted"); elog(ERROR, "local buffer hash table corrupted");
hresult->id = b; hresult->id = b;
@ -351,8 +350,7 @@ DropRelationLocalBuffers(RelFileLocator rlocator, ForkNumber forkNum,
/* Remove entry from hashtable */ /* Remove entry from hashtable */
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &bufHdr->tag, hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
HASH_REMOVE, NULL);
if (!hresult) /* shouldn't happen */ if (!hresult) /* shouldn't happen */
elog(ERROR, "local buffer hash table corrupted"); elog(ERROR, "local buffer hash table corrupted");
/* Mark buffer invalid */ /* Mark buffer invalid */
@ -396,8 +394,7 @@ DropRelationAllLocalBuffers(RelFileLocator rlocator)
LocalRefCount[i]); LocalRefCount[i]);
/* Remove entry from hashtable */ /* Remove entry from hashtable */
hresult = (LocalBufferLookupEnt *) hresult = (LocalBufferLookupEnt *)
hash_search(LocalBufHash, (void *) &bufHdr->tag, hash_search(LocalBufHash, &bufHdr->tag, HASH_REMOVE, NULL);
HASH_REMOVE, NULL);
if (!hresult) /* shouldn't happen */ if (!hresult) /* shouldn't happen */
elog(ERROR, "local buffer hash table corrupted"); elog(ERROR, "local buffer hash table corrupted");
/* Mark buffer invalid */ /* Mark buffer invalid */

View File

@ -608,7 +608,7 @@ LockHeldByMe(const LOCKTAG *locktag, LOCKMODE lockmode)
localtag.mode = lockmode; localtag.mode = lockmode;
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash, locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
(void *) &localtag, &localtag,
HASH_FIND, NULL); HASH_FIND, NULL);
return (locallock && locallock->nLocks > 0); return (locallock && locallock->nLocks > 0);
@ -663,7 +663,7 @@ LockHasWaiters(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
localtag.mode = lockmode; localtag.mode = lockmode;
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash, locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
(void *) &localtag, &localtag,
HASH_FIND, NULL); HASH_FIND, NULL);
/* /*
@ -825,7 +825,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
localtag.mode = lockmode; localtag.mode = lockmode;
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash, locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
(void *) &localtag, &localtag,
HASH_ENTER, &found); HASH_ENTER, &found);
/* /*
@ -1061,7 +1061,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
dlist_delete(&proclock->lockLink); dlist_delete(&proclock->lockLink);
dlist_delete(&proclock->procLink); dlist_delete(&proclock->procLink);
if (!hash_search_with_hash_value(LockMethodProcLockHash, if (!hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &(proclock->tag), &(proclock->tag),
proclock_hashcode, proclock_hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL)) NULL))
@ -1180,7 +1180,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
* Find or create a lock with this tag. * Find or create a lock with this tag.
*/ */
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(const void *) locktag, locktag,
hashcode, hashcode,
HASH_ENTER_NULL, HASH_ENTER_NULL,
&found); &found);
@ -1222,7 +1222,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
* Find or create a proclock entry with this tag * Find or create a proclock entry with this tag
*/ */
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash, proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &proclocktag, &proclocktag,
proclock_hashcode, proclock_hashcode,
HASH_ENTER_NULL, HASH_ENTER_NULL,
&found); &found);
@ -1239,7 +1239,7 @@ SetupLockInTable(LockMethod lockMethodTable, PGPROC *proc,
*/ */
Assert(dlist_is_empty(&(lock->procLocks))); Assert(dlist_is_empty(&(lock->procLocks)));
if (!hash_search_with_hash_value(LockMethodLockHash, if (!hash_search_with_hash_value(LockMethodLockHash,
(void *) &(lock->tag), &(lock->tag),
hashcode, hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL)) NULL))
@ -1391,7 +1391,7 @@ RemoveLocalLock(LOCALLOCK *locallock)
} }
if (!hash_search(LockMethodLocalHash, if (!hash_search(LockMethodLocalHash,
(void *) &(locallock->tag), &(locallock->tag),
HASH_REMOVE, NULL)) HASH_REMOVE, NULL))
elog(WARNING, "locallock table corrupted"); elog(WARNING, "locallock table corrupted");
@ -1644,7 +1644,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
dlist_delete(&proclock->procLink); dlist_delete(&proclock->procLink);
proclock_hashcode = ProcLockHashCode(&proclock->tag, hashcode); proclock_hashcode = ProcLockHashCode(&proclock->tag, hashcode);
if (!hash_search_with_hash_value(LockMethodProcLockHash, if (!hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &(proclock->tag), &(proclock->tag),
proclock_hashcode, proclock_hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL)) NULL))
@ -1660,7 +1660,7 @@ CleanUpLock(LOCK *lock, PROCLOCK *proclock,
LOCK_PRINT("CleanUpLock: deleting", lock, 0); LOCK_PRINT("CleanUpLock: deleting", lock, 0);
Assert(dlist_is_empty(&lock->procLocks)); Assert(dlist_is_empty(&lock->procLocks));
if (!hash_search_with_hash_value(LockMethodLockHash, if (!hash_search_with_hash_value(LockMethodLockHash,
(void *) &(lock->tag), &(lock->tag),
hashcode, hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL)) NULL))
@ -1998,7 +1998,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
localtag.mode = lockmode; localtag.mode = lockmode;
locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash, locallock = (LOCALLOCK *) hash_search(LockMethodLocalHash,
(void *) &localtag, &localtag,
HASH_FIND, NULL); HASH_FIND, NULL);
/* /*
@ -2112,7 +2112,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
Assert(EligibleForRelationFastPath(locktag, lockmode)); Assert(EligibleForRelationFastPath(locktag, lockmode));
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(const void *) locktag, locktag,
locallock->hashcode, locallock->hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -2123,7 +2123,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
proclocktag.myLock = lock; proclocktag.myLock = lock;
proclocktag.myProc = MyProc; proclocktag.myProc = MyProc;
locallock->proclock = (PROCLOCK *) hash_search(LockMethodProcLockHash, locallock->proclock = (PROCLOCK *) hash_search(LockMethodProcLockHash,
(void *) &proclocktag, &proclocktag,
HASH_FIND, HASH_FIND,
NULL); NULL);
if (!locallock->proclock) if (!locallock->proclock)
@ -2851,7 +2851,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
LWLockAcquire(partitionLock, LW_SHARED); LWLockAcquire(partitionLock, LW_SHARED);
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(void *) locktag, locktag,
locallock->hashcode, locallock->hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -2864,7 +2864,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
proclock_hashcode = ProcLockHashCode(&proclocktag, locallock->hashcode); proclock_hashcode = ProcLockHashCode(&proclocktag, locallock->hashcode);
proclock = (PROCLOCK *) proclock = (PROCLOCK *)
hash_search_with_hash_value(LockMethodProcLockHash, hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &proclocktag, &proclocktag,
proclock_hashcode, proclock_hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -3028,7 +3028,7 @@ GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp)
LWLockAcquire(partitionLock, LW_SHARED); LWLockAcquire(partitionLock, LW_SHARED);
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(const void *) locktag, locktag,
hashcode, hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -3125,7 +3125,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
* Re-find the lock object (it had better be there). * Re-find the lock object (it had better be there).
*/ */
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(void *) locktag, locktag,
hashcode, hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -3141,7 +3141,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
proclock_hashcode = ProcLockHashCode(&proclocktag, hashcode); proclock_hashcode = ProcLockHashCode(&proclocktag, hashcode);
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash, proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &proclocktag, &proclocktag,
proclock_hashcode, proclock_hashcode,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -3255,7 +3255,7 @@ CheckForSessionAndXactLocks(void)
/* Otherwise, find or make an entry in lockhtab */ /* Otherwise, find or make an entry in lockhtab */
hentry = (PerLockTagEntry *) hash_search(lockhtab, hentry = (PerLockTagEntry *) hash_search(lockhtab,
(void *) &locallock->tag.lock, &locallock->tag.lock,
HASH_ENTER, &found); HASH_ENTER, &found);
if (!found) /* initialize, if newly created */ if (!found) /* initialize, if newly created */
hentry->sessLock = hentry->xactLock = false; hentry->sessLock = hentry->xactLock = false;
@ -3555,8 +3555,8 @@ PostPrepare_Locks(TransactionId xid)
* given lock with my own proc. * given lock with my own proc.
*/ */
if (!hash_update_hash_key(LockMethodProcLockHash, if (!hash_update_hash_key(LockMethodProcLockHash,
(void *) proclock, proclock,
(void *) &proclocktag)) &proclocktag))
elog(PANIC, "duplicate entry found while reassigning a prepared transaction's locks"); elog(PANIC, "duplicate entry found while reassigning a prepared transaction's locks");
/* Re-link into the new proc's proclock list */ /* 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. * Find or create a lock with this tag.
*/ */
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(void *) locktag, locktag,
hashcode, hashcode,
HASH_ENTER_NULL, HASH_ENTER_NULL,
&found); &found);
@ -4250,7 +4250,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
* Find or create a proclock entry with this tag * Find or create a proclock entry with this tag
*/ */
proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash, proclock = (PROCLOCK *) hash_search_with_hash_value(LockMethodProcLockHash,
(void *) &proclocktag, &proclocktag,
proclock_hashcode, proclock_hashcode,
HASH_ENTER_NULL, HASH_ENTER_NULL,
&found); &found);
@ -4267,7 +4267,7 @@ lock_twophase_recover(TransactionId xid, uint16 info,
*/ */
Assert(dlist_is_empty(&lock->procLocks)); Assert(dlist_is_empty(&lock->procLocks));
if (!hash_search_with_hash_value(LockMethodLockHash, if (!hash_search_with_hash_value(LockMethodLockHash,
(void *) &(lock->tag), &(lock->tag),
hashcode, hashcode,
HASH_REMOVE, HASH_REMOVE,
NULL)) NULL))
@ -4679,7 +4679,7 @@ LockWaiterCount(const LOCKTAG *locktag)
LWLockAcquire(partitionLock, LW_EXCLUSIVE); LWLockAcquire(partitionLock, LW_EXCLUSIVE);
lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash, lock = (LOCK *) hash_search_with_hash_value(LockMethodLockHash,
(const void *) locktag, locktag,
hashcode, hashcode,
HASH_FIND, HASH_FIND,
&found); &found);

View File

@ -165,7 +165,7 @@ smgropen(RelFileLocator rlocator, BackendId backend)
brlocator.locator = rlocator; brlocator.locator = rlocator;
brlocator.backend = backend; brlocator.backend = backend;
reln = (SMgrRelation) hash_search(SMgrRelationHash, reln = (SMgrRelation) hash_search(SMgrRelationHash,
(void *) &brlocator, &brlocator,
HASH_ENTER, &found); HASH_ENTER, &found);
/* Initialize it if not present before */ /* Initialize it if not present before */
@ -267,7 +267,7 @@ smgrclose(SMgrRelation reln)
dlist_delete(&reln->node); dlist_delete(&reln->node);
if (hash_search(SMgrRelationHash, if (hash_search(SMgrRelationHash,
(void *) &(reln->smgr_rlocator), &(reln->smgr_rlocator),
HASH_REMOVE, NULL) == NULL) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "SMgrRelation hashtable corrupted"); elog(ERROR, "SMgrRelation hashtable corrupted");
@ -352,7 +352,7 @@ smgrcloserellocator(RelFileLocatorBackend rlocator)
return; return;
reln = (SMgrRelation) hash_search(SMgrRelationHash, reln = (SMgrRelation) hash_search(SMgrRelationHash,
(void *) &rlocator, &rlocator,
HASH_FIND, NULL); HASH_FIND, NULL);
if (reln != NULL) if (reln != NULL)
smgrclose(reln); smgrclose(reln);

View File

@ -501,7 +501,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
/* Cancel previously entered request */ /* Cancel previously entered request */
entry = (PendingFsyncEntry *) hash_search(pendingOps, entry = (PendingFsyncEntry *) hash_search(pendingOps,
(void *) ftag, ftag,
HASH_FIND, HASH_FIND,
NULL); NULL);
if (entry != NULL) if (entry != NULL)
@ -557,7 +557,7 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
Assert(type == SYNC_REQUEST); Assert(type == SYNC_REQUEST);
entry = (PendingFsyncEntry *) hash_search(pendingOps, entry = (PendingFsyncEntry *) hash_search(pendingOps,
(void *) ftag, ftag,
HASH_ENTER, HASH_ENTER,
&found); &found);
/* if new entry, or was previously canceled, initialize it */ /* if new entry, or was previously canceled, initialize it */

View File

@ -254,7 +254,7 @@ compute_tsvector_stats(VacAttrStats *stats,
/* Lookup current lexeme in hashtable, adding it if new */ /* Lookup current lexeme in hashtable, adding it if new */
item = (TrackItem *) hash_search(lexemes_tab, item = (TrackItem *) hash_search(lexemes_tab,
(const void *) &hash_key, &hash_key,
HASH_ENTER, &found); HASH_ENTER, &found);
if (found) if (found)
@ -464,7 +464,7 @@ prune_lexemes_hashtable(HTAB *lexemes_tab, int b_current)
{ {
char *lexeme = item->key.lexeme; 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) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
pfree(lexeme); pfree(lexeme);

View File

@ -362,7 +362,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
/* Lookup current element in hashtable, adding it if new */ /* Lookup current element in hashtable, adding it if new */
elem_value = elem_values[j]; elem_value = elem_values[j];
item = (TrackItem *) hash_search(elements_tab, item = (TrackItem *) hash_search(elements_tab,
(const void *) &elem_value, &elem_value,
HASH_ENTER, &found); HASH_ENTER, &found);
if (found) if (found)
@ -690,7 +690,7 @@ prune_element_hashtable(HTAB *elements_tab, int b_current)
{ {
Datum value = item->key; Datum value = item->key;
if (hash_search(elements_tab, (const void *) &item->key, if (hash_search(elements_tab, &item->key,
HASH_REMOVE, NULL) == NULL) HASH_REMOVE, NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
/* We should free memory if element is not passed by value */ /* We should free memory if element is not passed by value */

View File

@ -2129,7 +2129,7 @@ ri_LoadConstraintInfo(Oid constraintOid)
* Find or create a hash entry. If we find a valid one, just return it. * Find or create a hash entry. If we find a valid one, just return it.
*/ */
riinfo = (RI_ConstraintInfo *) hash_search(ri_constraint_cache, riinfo = (RI_ConstraintInfo *) hash_search(ri_constraint_cache,
(void *) &constraintOid, &constraintOid,
HASH_ENTER, &found); HASH_ENTER, &found);
if (!found) if (!found)
riinfo->valid = false; riinfo->valid = false;
@ -2724,7 +2724,7 @@ ri_FetchPreparedPlan(RI_QueryKey *key)
* Lookup for the key * Lookup for the key
*/ */
entry = (RI_QueryHashEntry *) hash_search(ri_query_cache, entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
(void *) key, key,
HASH_FIND, NULL); HASH_FIND, NULL);
if (entry == NULL) if (entry == NULL)
return NULL; return NULL;
@ -2777,7 +2777,7 @@ ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan)
* invalid by ri_FetchPreparedPlan. * invalid by ri_FetchPreparedPlan.
*/ */
entry = (RI_QueryHashEntry *) hash_search(ri_query_cache, entry = (RI_QueryHashEntry *) hash_search(ri_query_cache,
(void *) key, key,
HASH_ENTER, &found); HASH_ENTER, &found);
Assert(!found || entry->plan == NULL); Assert(!found || entry->plan == NULL);
entry->plan = plan; entry->plan = plan;
@ -2927,7 +2927,7 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid)
key.eq_opr = eq_opr; key.eq_opr = eq_opr;
key.typeid = typeid; key.typeid = typeid;
entry = (RI_CompareHashEntry *) hash_search(ri_compare_cache, entry = (RI_CompareHashEntry *) hash_search(ri_compare_cache,
(void *) &key, &key,
HASH_ENTER, &found); HASH_ENTER, &found);
if (!found) if (!found)
entry->valid = false; entry->valid = false;

View File

@ -63,7 +63,7 @@ InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
if (attopt->opts) if (attopt->opts)
pfree(attopt->opts); pfree(attopt->opts);
if (hash_search(AttoptCacheHash, if (hash_search(AttoptCacheHash,
(void *) &attopt->key, &attopt->key,
HASH_REMOVE, HASH_REMOVE,
NULL) == NULL) NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
@ -116,7 +116,7 @@ get_attribute_options(Oid attrelid, int attnum)
key.attnum = attnum; key.attnum = attnum;
attopt = attopt =
(AttoptCacheEntry *) hash_search(AttoptCacheHash, (AttoptCacheEntry *) hash_search(AttoptCacheHash,
(void *) &key, &key,
HASH_FIND, HASH_FIND,
NULL); NULL);
@ -163,7 +163,7 @@ get_attribute_options(Oid attrelid, int attnum)
* pg_attribute, since the read could cause a cache flush. * pg_attribute, since the read could cause a cache flush.
*/ */
attopt = (AttoptCacheEntry *) hash_search(AttoptCacheHash, attopt = (AttoptCacheEntry *) hash_search(AttoptCacheHash,
(void *) &key, &key,
HASH_ENTER, HASH_ENTER,
NULL); NULL);
attopt->opts = opts; attopt->opts = opts;

View File

@ -210,7 +210,7 @@ static int EOXactTupleDescArrayLen = 0;
do { \ do { \
RelIdCacheEnt *hentry; bool found; \ RelIdCacheEnt *hentry; bool found; \
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \ hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
(void *) &((RELATION)->rd_id), \ &((RELATION)->rd_id), \
HASH_ENTER, &found); \ HASH_ENTER, &found); \
if (found) \ if (found) \
{ \ { \
@ -232,7 +232,7 @@ do { \
do { \ do { \
RelIdCacheEnt *hentry; \ RelIdCacheEnt *hentry; \
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \ hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
(void *) &(ID), \ &(ID), \
HASH_FIND, NULL); \ HASH_FIND, NULL); \
if (hentry) \ if (hentry) \
RELATION = hentry->reldesc; \ RELATION = hentry->reldesc; \
@ -244,7 +244,7 @@ do { \
do { \ do { \
RelIdCacheEnt *hentry; \ RelIdCacheEnt *hentry; \
hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \ hentry = (RelIdCacheEnt *) hash_search(RelationIdCache, \
(void *) &((RELATION)->rd_id), \ &((RELATION)->rd_id), \
HASH_REMOVE, NULL); \ HASH_REMOVE, NULL); \
if (hentry == NULL) \ if (hentry == NULL) \
elog(WARNING, "failed to delete relcache entry for OID %u", \ elog(WARNING, "failed to delete relcache entry for OID %u", \
@ -1663,7 +1663,7 @@ LookupOpclassInfo(Oid operatorClassOid,
} }
opcentry = (OpClassCacheEnt *) hash_search(OpClassCache, opcentry = (OpClassCacheEnt *) hash_search(OpClassCache,
(void *) &operatorClassOid, &operatorClassOid,
HASH_ENTER, &found); HASH_ENTER, &found);
if (!found) if (!found)
@ -3210,7 +3210,7 @@ AtEOXact_RelationCache(bool isCommit)
for (i = 0; i < eoxact_list_len; i++) for (i = 0; i < eoxact_list_len; i++)
{ {
idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache, idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
(void *) &eoxact_list[i], &eoxact_list[i],
HASH_FIND, HASH_FIND,
NULL); NULL);
if (idhentry != NULL) if (idhentry != NULL)
@ -3359,7 +3359,7 @@ AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
for (i = 0; i < eoxact_list_len; i++) for (i = 0; i < eoxact_list_len; i++)
{ {
idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache, idhentry = (RelIdCacheEnt *) hash_search(RelationIdCache,
(void *) &eoxact_list[i], &eoxact_list[i],
HASH_FIND, HASH_FIND,
NULL); NULL);
if (idhentry != NULL) if (idhentry != NULL)

View File

@ -72,7 +72,7 @@ RelfilenumberMapInvalidateCallback(Datum arg, Oid relid)
entry->relid == relid) /* individual flushed relation */ entry->relid == relid) /* individual flushed relation */
{ {
if (hash_search(RelfilenumberMapHash, if (hash_search(RelfilenumberMapHash,
(void *) &entry->key, &entry->key,
HASH_REMOVE, HASH_REMOVE,
NULL) == NULL) NULL) == NULL)
elog(ERROR, "hash table corrupted"); 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, * since querying invalid values isn't supposed to be a frequent thing,
* but it's basically free. * but it's basically free.
*/ */
entry = hash_search(RelfilenumberMapHash, (void *) &key, HASH_FIND, &found); entry = hash_search(RelfilenumberMapHash, &key, HASH_FIND, &found);
if (found) if (found)
return entry->relid; return entry->relid;
@ -235,7 +235,7 @@ RelidByRelfilenumber(Oid reltablespace, RelFileNumber relfilenumber)
* caused cache invalidations to be executed which would have deleted a * caused cache invalidations to be executed which would have deleted a
* new entry if we had entered it above. * 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) if (found)
elog(ERROR, "corrupted hashtable"); elog(ERROR, "corrupted hashtable");
entry->relid = relid; entry->relid = relid;

View File

@ -63,7 +63,7 @@ InvalidateTableSpaceCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
if (spc->opts) if (spc->opts)
pfree(spc->opts); pfree(spc->opts);
if (hash_search(TableSpaceCacheHash, if (hash_search(TableSpaceCacheHash,
(void *) &spc->oid, &spc->oid,
HASH_REMOVE, HASH_REMOVE,
NULL) == NULL) NULL) == NULL)
elog(ERROR, "hash table corrupted"); elog(ERROR, "hash table corrupted");
@ -121,7 +121,7 @@ get_tablespace(Oid spcid)
if (!TableSpaceCacheHash) if (!TableSpaceCacheHash)
InitializeTableSpaceCache(); InitializeTableSpaceCache();
spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash, spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
(void *) &spcid, &spcid,
HASH_FIND, HASH_FIND,
NULL); NULL);
if (spc) if (spc)
@ -163,7 +163,7 @@ get_tablespace(Oid spcid)
* flush. * flush.
*/ */
spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash, spc = (TableSpaceCacheEntry *) hash_search(TableSpaceCacheHash,
(void *) &spcid, &spcid,
HASH_ENTER, HASH_ENTER,
NULL); NULL);
spc->opts = opts; spc->opts = opts;

View File

@ -139,7 +139,7 @@ lookup_ts_parser_cache(Oid prsId)
/* Try to look up an existing entry */ /* Try to look up an existing entry */
entry = (TSParserCacheEntry *) hash_search(TSParserCacheHash, entry = (TSParserCacheEntry *) hash_search(TSParserCacheHash,
(void *) &prsId, &prsId,
HASH_FIND, NULL); HASH_FIND, NULL);
if (entry == NULL || !entry->isvalid) if (entry == NULL || !entry->isvalid)
{ {
@ -172,9 +172,7 @@ lookup_ts_parser_cache(Oid prsId)
/* Now make the cache entry */ /* Now make the cache entry */
entry = (TSParserCacheEntry *) entry = (TSParserCacheEntry *)
hash_search(TSParserCacheHash, hash_search(TSParserCacheHash, &prsId, HASH_ENTER, &found);
(void *) &prsId,
HASH_ENTER, &found);
Assert(!found); /* it wasn't there a moment ago */ 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 */ /* Try to look up an existing entry */
entry = (TSDictionaryCacheEntry *) hash_search(TSDictionaryCacheHash, entry = (TSDictionaryCacheEntry *) hash_search(TSDictionaryCacheHash,
(void *) &dictId, &dictId,
HASH_FIND, NULL); HASH_FIND, NULL);
if (entry == NULL || !entry->isvalid) if (entry == NULL || !entry->isvalid)
{ {
@ -288,7 +286,7 @@ lookup_ts_dictionary_cache(Oid dictId)
/* Now make the cache entry */ /* Now make the cache entry */
entry = (TSDictionaryCacheEntry *) entry = (TSDictionaryCacheEntry *)
hash_search(TSDictionaryCacheHash, hash_search(TSDictionaryCacheHash,
(void *) &dictId, &dictId,
HASH_ENTER, &found); HASH_ENTER, &found);
Assert(!found); /* it wasn't there a moment ago */ 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 */ /* Try to look up an existing entry */
entry = (TSConfigCacheEntry *) hash_search(TSConfigCacheHash, entry = (TSConfigCacheEntry *) hash_search(TSConfigCacheHash,
(void *) &cfgId, &cfgId,
HASH_FIND, NULL); HASH_FIND, NULL);
if (entry == NULL || !entry->isvalid) if (entry == NULL || !entry->isvalid)
{ {
@ -441,7 +439,7 @@ lookup_ts_config_cache(Oid cfgId)
/* Now make the cache entry */ /* Now make the cache entry */
entry = (TSConfigCacheEntry *) entry = (TSConfigCacheEntry *)
hash_search(TSConfigCacheHash, hash_search(TSConfigCacheHash,
(void *) &cfgId, &cfgId,
HASH_ENTER, &found); HASH_ENTER, &found);
Assert(!found); /* it wasn't there a moment ago */ Assert(!found); /* it wasn't there a moment ago */
} }

View File

@ -364,7 +364,7 @@ lookup_type_cache(Oid type_id, int flags)
/* Try to look up an existing entry */ /* Try to look up an existing entry */
typentry = (TypeCacheEntry *) hash_search(TypeCacheHash, typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
(void *) &type_id, &type_id,
HASH_FIND, NULL); HASH_FIND, NULL);
if (typentry == NULL) if (typentry == NULL)
{ {
@ -392,7 +392,7 @@ lookup_type_cache(Oid type_id, int flags)
/* Now make the typcache entry */ /* Now make the typcache entry */
typentry = (TypeCacheEntry *) hash_search(TypeCacheHash, typentry = (TypeCacheEntry *) hash_search(TypeCacheHash,
(void *) &type_id, &type_id,
HASH_ENTER, &found); HASH_ENTER, &found);
Assert(!found); /* it wasn't there a moment ago */ 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. * the allocations succeed before we create the new entry.
*/ */
recentry = (RecordCacheEntry *) hash_search(RecordCacheHash, recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
(void *) &tupDesc, &tupDesc,
HASH_FIND, &found); HASH_FIND, &found);
if (found && recentry->tupdesc != NULL) if (found && recentry->tupdesc != NULL)
{ {
@ -2012,7 +2012,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
/* Fully initialized; create the hash table entry */ /* Fully initialized; create the hash table entry */
recentry = (RecordCacheEntry *) hash_search(RecordCacheHash, recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
(void *) &tupDesc, &tupDesc,
HASH_ENTER, NULL); HASH_ENTER, NULL);
recentry->tupdesc = entDesc; recentry->tupdesc = entDesc;

View File

@ -253,7 +253,7 @@ GetComboCommandId(CommandId cmin, CommandId cmax)
key.cmin = cmin; key.cmin = cmin;
key.cmax = cmax; key.cmax = cmax;
entry = (ComboCidEntry) hash_search(comboHash, entry = (ComboCidEntry) hash_search(comboHash,
(void *) &key, &key,
HASH_ENTER, HASH_ENTER,
&found); &found);

View File

@ -2627,7 +2627,7 @@ plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key)
plpgsql_HashEnt *hentry; plpgsql_HashEnt *hentry;
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable, hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
(void *) func_key, func_key,
HASH_FIND, HASH_FIND,
NULL); NULL);
if (hentry) if (hentry)
@ -2644,7 +2644,7 @@ plpgsql_HashTableInsert(PLpgSQL_function *function,
bool found; bool found;
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable, hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
(void *) func_key, func_key,
HASH_ENTER, HASH_ENTER,
&found); &found);
if (found) if (found)
@ -2665,7 +2665,7 @@ plpgsql_HashTableDelete(PLpgSQL_function *function)
return; return;
hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable, hentry = (plpgsql_HashEnt *) hash_search(plpgsql_HashTable,
(void *) function->fn_hashkey, function->fn_hashkey,
HASH_REMOVE, HASH_REMOVE,
NULL); NULL);
if (hentry == NULL) if (hentry == NULL)

View File

@ -7775,7 +7775,7 @@ get_cast_hashentry(PLpgSQL_execstate *estate,
cast_key.srctypmod = srctypmod; cast_key.srctypmod = srctypmod;
cast_key.dsttypmod = dsttypmod; cast_key.dsttypmod = dsttypmod;
cast_entry = (plpgsql_CastHashEntry *) hash_search(estate->cast_hash, cast_entry = (plpgsql_CastHashEntry *) hash_search(estate->cast_hash,
(void *) &cast_key, &cast_key,
HASH_ENTER, &found); HASH_ENTER, &found);
if (!found) /* initialize if new entry */ if (!found) /* initialize if new entry */
cast_entry->cast_cexpr = NULL; cast_entry->cast_cexpr = NULL;