From 1f605b82ba66ece8b421b10d41094dd2e3c0c48b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 30 Dec 2022 10:59:25 +0100 Subject: 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 --- src/common/stringinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/stringinfo.c') diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c index 76ff4d3e245..66a64180c96 100644 --- a/src/common/stringinfo.c +++ b/src/common/stringinfo.c @@ -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); -- cgit v1.2.3