1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Change argument of appendBinaryStringInfo from char * to void *

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.
Functions taking binary data plus length should take void * instead,
like memcpy() for example.

Discussion: https://www.postgresql.org/message-id/flat/a0086cfc-ff0f-2827-20fe-52b591d2666c%40enterprisedb.com
This commit is contained in:
Peter Eisentraut
2022-12-30 10:59:25 +01:00
parent 33a33f0ba4
commit 1f605b82ba
4 changed files with 15 additions and 15 deletions

View File

@@ -224,7 +224,7 @@ appendStringInfoSpaces(StringInfo str, int count)
* if necessary. Ensures that a trailing null byte is present.
*/
void
appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
{
Assert(str != NULL);
@@ -250,7 +250,7 @@ appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
* if necessary. Does not ensure a trailing null-byte exists.
*/
void
appendBinaryStringInfoNT(StringInfo str, const char *data, int datalen)
appendBinaryStringInfoNT(StringInfo str, const void *data, int datalen)
{
Assert(str != NULL);