1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +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

@@ -260,7 +260,7 @@ buf_init(FullTransactionId xmin, FullTransactionId xmax)
snap.nxip = 0;
buf = makeStringInfo();
appendBinaryStringInfo(buf, (char *) &snap, PG_SNAPSHOT_SIZE(0));
appendBinaryStringInfo(buf, &snap, PG_SNAPSHOT_SIZE(0));
return buf;
}
@@ -272,7 +272,7 @@ buf_add_txid(StringInfo buf, FullTransactionId fxid)
/* do this before possible realloc */
snap->nxip++;
appendBinaryStringInfo(buf, (char *) &fxid, sizeof(fxid));
appendBinaryStringInfo(buf, &fxid, sizeof(fxid));
}
static pg_snapshot *