Remove meaninglist restrict qualifiers
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 27 Oct 2025 07:52:39 +0000 (08:52 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 27 Oct 2025 07:53:09 +0000 (08:53 +0100)
The use of the restrict qualifier in casts is meaningless, so remove
them.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/0e3d8644-c01d-4374-86ea-9f0a987981f0%40eisentraut.org

src/include/libpq/pqformat.h

index 9a1534be521c66005d66306549331a38021d1368..55442caf0e4e8d14af9cb1f6ada351d70947fa3b 100644 (file)
@@ -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)