Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7cfb26

Browse files
committed
Fix warnings from cpluspluscheck
Fix warnings about "comparison between signed and unsigned integerexpressions" in inline functions in header files by adding some casts.
1 parent066bc21 commite7cfb26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/include/libpq/pqformat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pq_writeint8(StringInfoData *pg_restrict buf, int8 i)
5151
{
5252
int8ni=i;
5353

54-
Assert(buf->len+sizeof(int8) <=buf->maxlen);
54+
Assert(buf->len+(int)sizeof(int8) <=buf->maxlen);
5555
memcpy((char*pg_restrict) (buf->data+buf->len),&ni,sizeof(int8));
5656
buf->len+=sizeof(int8);
5757
}
@@ -65,7 +65,7 @@ pq_writeint16(StringInfoData *pg_restrict buf, int16 i)
6565
{
6666
int16ni=pg_hton16(i);
6767

68-
Assert(buf->len+sizeof(int16) <=buf->maxlen);
68+
Assert(buf->len+(int)sizeof(int16) <=buf->maxlen);
6969
memcpy((char*pg_restrict) (buf->data+buf->len),&ni,sizeof(int16));
7070
buf->len+=sizeof(int16);
7171
}
@@ -79,7 +79,7 @@ pq_writeint32(StringInfoData *pg_restrict buf, int32 i)
7979
{
8080
int32ni=pg_hton32(i);
8181

82-
Assert(buf->len+sizeof(int32) <=buf->maxlen);
82+
Assert(buf->len+(int)sizeof(int32) <=buf->maxlen);
8383
memcpy((char*pg_restrict) (buf->data+buf->len),&ni,sizeof(int32));
8484
buf->len+=sizeof(int32);
8585
}
@@ -93,7 +93,7 @@ pq_writeint64(StringInfoData *pg_restrict buf, int64 i)
9393
{
9494
int64ni=pg_hton64(i);
9595

96-
Assert(buf->len+sizeof(int64) <=buf->maxlen);
96+
Assert(buf->len+(int)sizeof(int64) <=buf->maxlen);
9797
memcpy((char*pg_restrict) (buf->data+buf->len),&ni,sizeof(int64));
9898
buf->len+=sizeof(int64);
9999
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp