From 54a177a948b0a773c25c6737d1cc3cc49222a526 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 6 Feb 2023 09:05:20 +0100 Subject: 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 Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com --- src/backend/storage/buffer/bufmgr.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/backend/storage/buffer/bufmgr.c') diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 800a4248c95..1bc8d6555b9 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -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--; -- cgit v1.2.3