Thread
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
-
Remove some useless casts to (void *)
Peter Eisentraut <peter.eisentraut@enterprisedb.com> — 2023-02-02T22:22:27Z
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.
-
Re: Remove some useless casts to (void *)
Corey Huinker <corey.huinker@gmail.com> — 2023-02-02T23:59:44Z
On Thu, Feb 2, 2023 at 5:22 PM Peter Eisentraut < peter.eisentraut@enterprisedb.com> wrote: > 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. +1 All code is example code. Applies. Passes make check world.
-
Re: Remove some useless casts to (void *)
Peter Eisentraut <peter.eisentraut@enterprisedb.com> — 2023-02-07T07:09:57Z
On 03.02.23 00:59, Corey Huinker wrote: > On Thu, Feb 2, 2023 at 5:22 PM Peter Eisentraut > <peter.eisentraut@enterprisedb.com > <mailto:peter.eisentraut@enterprisedb.com>> wrote: > > 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. > > > +1 committed > All code is example code. I like that one!