mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Fix warnings from cpluspluscheck
Fix warnings about "comparison between signed and unsigned integer expressions" in inline functions in header files by adding some casts.
This commit is contained in:
parent
066bc21c0e
commit
e7cfb26fbc
@ -51,7 +51,7 @@ pq_writeint8(StringInfoData *pg_restrict buf, int8 i)
|
|||||||
{
|
{
|
||||||
int8 ni = i;
|
int8 ni = i;
|
||||||
|
|
||||||
Assert(buf->len + sizeof(int8) <= buf->maxlen);
|
Assert(buf->len + (int) sizeof(int8) <= buf->maxlen);
|
||||||
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int8));
|
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int8));
|
||||||
buf->len += sizeof(int8);
|
buf->len += sizeof(int8);
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ pq_writeint16(StringInfoData *pg_restrict buf, int16 i)
|
|||||||
{
|
{
|
||||||
int16 ni = pg_hton16(i);
|
int16 ni = pg_hton16(i);
|
||||||
|
|
||||||
Assert(buf->len + sizeof(int16) <= buf->maxlen);
|
Assert(buf->len + (int) sizeof(int16) <= buf->maxlen);
|
||||||
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int16));
|
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int16));
|
||||||
buf->len += sizeof(int16);
|
buf->len += sizeof(int16);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ pq_writeint32(StringInfoData *pg_restrict buf, int32 i)
|
|||||||
{
|
{
|
||||||
int32 ni = pg_hton32(i);
|
int32 ni = pg_hton32(i);
|
||||||
|
|
||||||
Assert(buf->len + sizeof(int32) <= buf->maxlen);
|
Assert(buf->len + (int) sizeof(int32) <= buf->maxlen);
|
||||||
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int32));
|
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int32));
|
||||||
buf->len += sizeof(int32);
|
buf->len += sizeof(int32);
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ pq_writeint64(StringInfoData *pg_restrict buf, int64 i)
|
|||||||
{
|
{
|
||||||
int64 ni = pg_hton64(i);
|
int64 ni = pg_hton64(i);
|
||||||
|
|
||||||
Assert(buf->len + sizeof(int64) <= buf->maxlen);
|
Assert(buf->len + (int) sizeof(int64) <= buf->maxlen);
|
||||||
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int64));
|
memcpy((char *pg_restrict) (buf->data + buf->len), &ni, sizeof(int64));
|
||||||
buf->len += sizeof(int64);
|
buf->len += sizeof(int64);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user