From 708a9e51e7a73df72c1632ab2dab0c450d925954 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 15 Oct 2025 10:14:06 +0200 Subject: [PATCH 1/2] Remove meaninglist restrict qualifiers The use of the restrict qualifier in casts is meaningless, so remove it. --- 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) -- 2.51.0