Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+2-2
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

+1-1
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

+1-1
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

+2-2
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)