Remove some useless casts to (void *)
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-02-02T22:22:27Z
Lists: pgsql-hackers
Attachments
- 0001-Remove-useless-casts-to-void-hash_search.patch (text/plain) patch 0001
- 0002-Remove-useless-casts-to-void-repalloc.patch (text/plain) patch 0002
- 0003-Remove-useless-casts-to-void-memcpy.patch (text/plain) patch 0003
- 0004-Remove-useless-casts-to-void-memset.patch (text/plain) patch 0004
- 0005-Remove-useless-casts-to-void-memmove.patch (text/plain) patch 0005
- 0006-Remove-useless-casts-to-void-memcmp.patch (text/plain) patch 0006
- 0007-Remove-useless-casts-to-void-qsort.patch (text/plain) patch 0007
- 0008-Remove-useless-casts-to-void-bsearch.patch (text/plain) patch 0008
I have found that in some corners of the code some calls to standard C functions are decorated with casts to (void *) for no reason, and this code pattern then gets copied around. I have gone through and cleaned this up a bit, in the attached patches. The involved functions are: repalloc, memcpy, memset, memmove, memcmp, qsort, bsearch Also hash_search(), for which there was a historical reason (the argument used to be char *), but not anymore.
Commits
-
Remove useless casts to (void *) in arguments of some system functions
- aa6954104644 16.0 landed
-
Remove useless casts to (void *) in hash_search() calls
- 54a177a948b0 16.0 landed