Skip to content

Commit 4f0f396

Browse files
committed
common/compat: resolve signedness warnings
/home/ubuntu/ceph/src/common/compat.cc:365:11: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Wsign-compare] if (r < iov[i].iov_len) ~ ^ ~~~~~~~~~~~~~~ /home/ubuntu/ceph/src/common/compat.cc:380:11: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Wsign-compare] if (r < iov[i].iov_len) ~ ^ ~~~~~~~~~~~~~~ 6 warnings generated. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 792222c commit 4f0f396

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/compat.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ ssize_t preadv(int fd, const struct iovec *iov, int iov_cnt) {
368368
if (r < 0)
369369
return r;
370370
read += r;
371-
if (r < iov[i].iov_len)
371+
if ((unsigned)r < iov[i].iov_len)
372372
break;
373373
}
374374

@@ -383,7 +383,7 @@ ssize_t writev(int fd, const struct iovec *iov, int iov_cnt) {
383383
if (r < 0)
384384
return r;
385385
written += r;
386-
if (r < iov[i].iov_len)
386+
if ((unsigned)r < iov[i].iov_len)
387387
break;
388388
}
389389

0 commit comments

Comments
 (0)