summaryrefslogtreecommitdiff
path: root/src/backend/libpq/pqformat.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-02-23 14:26:39 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-02-23 14:27:02 +0100
commit454c182f8542890d0e2eac85f70d9a254a34fce3 (patch)
treeb943eb0aab64a1617a889314ccb5dc1f3d315713 /src/backend/libpq/pqformat.c
parentebdccead1647aec1122810dad498438d9964f35f (diff)
backend libpq void * argument for binary data
Change some backend libpq functions to take void * for binary data instead of char *. This removes the need for numerous casts. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org
Diffstat (limited to 'src/backend/libpq/pqformat.c')
-rw-r--r--src/backend/libpq/pqformat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/libpq/pqformat.c b/src/backend/libpq/pqformat.c
index 295297cb559..1cc126772f7 100644
--- a/src/backend/libpq/pqformat.c
+++ b/src/backend/libpq/pqformat.c
@@ -422,15 +422,15 @@ pq_getmsgint(StringInfo msg, int b)
switch (b)
{
case 1:
- pq_copymsgbytes(msg, (char *) &n8, 1);
+ pq_copymsgbytes(msg, &n8, 1);
result = n8;
break;
case 2:
- pq_copymsgbytes(msg, (char *) &n16, 2);
+ pq_copymsgbytes(msg, &n16, 2);
result = pg_ntoh16(n16);
break;
case 4:
- pq_copymsgbytes(msg, (char *) &n32, 4);
+ pq_copymsgbytes(msg, &n32, 4);
result = pg_ntoh32(n32);
break;
default:
@@ -454,7 +454,7 @@ pq_getmsgint64(StringInfo msg)
{
uint64 n64;
- pq_copymsgbytes(msg, (char *) &n64, sizeof(n64));
+ pq_copymsgbytes(msg, &n64, sizeof(n64));
return pg_ntoh64(n64);
}
@@ -525,7 +525,7 @@ pq_getmsgbytes(StringInfo msg, int datalen)
* --------------------------------
*/
void
-pq_copymsgbytes(StringInfo msg, char *buf, int datalen)
+pq_copymsgbytes(StringInfo msg, void *buf, int datalen)
{
if (datalen < 0 || datalen > (msg->len - msg->cursor))
ereport(ERROR,