Re: appendBinaryStringInfo stuff
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-02-10T12:15:54Z
Lists: pgsql-hackers
Attachments
- 0001-Change-argument-type-of-pq_sendbytes-from-char-to-vo.patch (text/plain) patch 0001
On 19.12.22 07:13, Peter Eisentraut wrote: > Also, the argument type of appendBinaryStringInfo() is char *. There is > some code that uses this function to assemble some kind of packed binary > layout, which requires a bunch of casts because of this. I think > functions taking binary data plus length should take void * instead, > like memcpy() for example. I found a little follow-up for this one: Make the same change to pq_sendbytes(), which is a thin wrapper around appendBinaryStringInfo(). This would allow getting rid of further casts at call sites.
Commits
-
Change argument type of pq_sendbytes from char * to void *
- 3b12e68a5c46 16.0 landed
-
Remove useless casts to (void *) in hash_search() calls
- 54a177a948b0 16.0 cited
-
Change argument of appendBinaryStringInfo from char * to void *
- 1f605b82ba66 16.0 landed
-
Use appendStringInfoString instead of appendBinaryStringInfo where possible
- 33a33f0ba4d7 16.0 landed