Skip to content

Commit 8743ea1

Browse files
committed
Remove useless casts to (const void *)
Similar to commit 7f798ac, but I didn't think to look for "const" as well.
1 parent 1319997 commit 8743ea1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,7 +4292,7 @@ DropRelationsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
42924292
RelFileLocator locator;
42934293

42944294
locator = BufTagGetRelFileLocator(&bufHdr->tag);
4295-
rlocator = bsearch((const void *) &(locator),
4295+
rlocator = bsearch(&locator,
42964296
locators, n, sizeof(RelFileLocator),
42974297
rlocator_comparator);
42984298
}
@@ -4646,7 +4646,7 @@ FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels)
46464646
RelFileLocator rlocator;
46474647

46484648
rlocator = BufTagGetRelFileLocator(&bufHdr->tag);
4649-
srelent = bsearch((const void *) &(rlocator),
4649+
srelent = bsearch(&rlocator,
46504650
srels, nrels, sizeof(SMgrSortArray),
46514651
rlocator_comparator);
46524652
}

src/backend/storage/lmgr/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ GetLockTagsMethodTable(const LOCKTAG *locktag)
550550
uint32
551551
LockTagHashCode(const LOCKTAG *locktag)
552552
{
553-
return get_hash_value(LockMethodLockHash, (const void *) locktag);
553+
return get_hash_value(LockMethodLockHash, locktag);
554554
}
555555

556556
/*

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
18221822
size_t avail = AH->lo_buf_size - AH->lo_buf_used;
18231823

18241824
memcpy((char *) AH->lo_buf + AH->lo_buf_used, ptr, avail);
1825-
ptr = (const void *) ((const char *) ptr + avail);
1825+
ptr = (const char *) ptr + avail;
18261826
remaining -= avail;
18271827
AH->lo_buf_used += avail;
18281828
dump_lo_buf(AH);

src/test/modules/test_tidstore/test_tidstore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ check_set_block_offsets(PG_FUNCTION_ARGS)
292292
qsort(items.lookup_tids, items.num_tids, sizeof(ItemPointerData), itemptr_cmp);
293293
for (int i = 0; i < items.num_tids; i++)
294294
{
295-
if (itemptr_cmp((const void *) &items.insert_tids[i], (const void *) &items.iter_tids[i]) != 0)
295+
if (itemptr_cmp(&items.insert_tids[i], &items.iter_tids[i]) != 0)
296296
elog(ERROR, "TID iter array doesn't match verification array, got (%u,%u) expected (%u,%u)",
297297
ItemPointerGetBlockNumber(&items.iter_tids[i]),
298298
ItemPointerGetOffsetNumber(&items.iter_tids[i]),
299299
ItemPointerGetBlockNumber(&items.insert_tids[i]),
300300
ItemPointerGetOffsetNumber(&items.insert_tids[i]));
301-
if (itemptr_cmp((const void *) &items.insert_tids[i], (const void *) &items.lookup_tids[i]) != 0)
301+
if (itemptr_cmp(&items.insert_tids[i], &items.lookup_tids[i]) != 0)
302302
elog(ERROR, "TID lookup array doesn't match verification array, got (%u,%u) expected (%u,%u)",
303303
ItemPointerGetBlockNumber(&items.lookup_tids[i]),
304304
ItemPointerGetOffsetNumber(&items.lookup_tids[i]),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy