aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/localbuf.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2023-02-06 09:05:20 +0100
committerPeter Eisentraut <peter@eisentraut.org>2023-02-06 09:41:01 +0100
commit54a177a948b0a773c25c6737d1cc3cc49222a526 (patch)
treea442be10d2b8515f6b1600f60838e379ee546fe8 /src/backend/storage/buffer/localbuf.c
parent009f8d17146da72478fcb8f544b793c443fa254c (diff)
downloadpostgresql-54a177a948b0a773c25c6737d1cc3cc49222a526.tar.gz
postgresql-54a177a948b0a773c25c6737d1cc3cc49222a526.zip
Remove useless casts to (void *) in hash_search() calls
Some of these appear to be leftovers from when hash_search() took a char * argument (changed in 5999e78fc45dcb91784b64b6e9ae43f4e4f68ca2). Since after this there is some more horizontal space available, do some light reformatting where suitable. Reviewed-by: Corey Huinker <corey.huinker@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com
Diffstat (limited to 'src/backend/storage/buffer/localbuf.c')
-rw-r--r--src/backend/storage/buffer/localbuf.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 8372acc383d..71e2a5fecd5 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -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 */