From 64d2b0968ea494cb11900ffb7681b5784e4112b9 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 27 Oct 2025 08:52:39 +0100 Subject: [PATCH] Remove meaninglist restrict qualifiers The use of the restrict qualifier in casts is meaningless, so remove them. Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/0e3d8644-c01d-4374-86ea-9f0a987981f0%40eisentraut.org --- src/include/libpq/pqformat.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h index 9a1534be521..55442caf0e4 100644 --- a/src/include/libpq/pqformat.h +++ b/src/include/libpq/pqformat.h @@ -48,7 +48,7 @@ pq_writeint8(StringInfoData *pg_restrict buf, uint8 i) uint8 ni = i; Assert(buf->len + (int) sizeof(uint8) <= buf->maxlen); - memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(uint8)); + memcpy(buf->data + buf->len, &ni, sizeof(uint8)); buf->len += sizeof(uint8); } @@ -62,7 +62,7 @@ pq_writeint16(StringInfoData *pg_restrict buf, uint16 i) uint16 ni = pg_hton16(i); Assert(buf->len + (int) sizeof(uint16) <= buf->maxlen); - memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(uint16)); + memcpy(buf->data + buf->len, &ni, sizeof(uint16)); buf->len += sizeof(uint16); } @@ -76,7 +76,7 @@ pq_writeint32(StringInfoData *pg_restrict buf, uint32 i) uint32 ni = pg_hton32(i); Assert(buf->len + (int) sizeof(uint32) <= buf->maxlen); - memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(uint32)); + memcpy(buf->data + buf->len, &ni, sizeof(uint32)); buf->len += sizeof(uint32); } @@ -90,7 +90,7 @@ pq_writeint64(StringInfoData *pg_restrict buf, uint64 i) uint64 ni = pg_hton64(i); Assert(buf->len + (int) sizeof(uint64) <= buf->maxlen); - memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(uint64)); + memcpy(buf->data + buf->len, &ni, sizeof(uint64)); buf->len += sizeof(uint64); } @@ -116,7 +116,7 @@ pq_writestring(StringInfoData *pg_restrict buf, const char *pg_restrict str) Assert(buf->len + slen + 1 <= buf->maxlen); - memcpy(((char *pg_restrict) buf->data + buf->len), p, slen + 1); + memcpy(buf->data + buf->len, p, slen + 1); buf->len += slen + 1; if (p != str)