From 20320f3091ed1d8d09a2dffd308e146a186237da Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 17 Aug 2016 14:38:44 +0800 Subject: [PATCH] msg/async: fix compiler warnings fix warnings like ``` comparison between signed and unsigned integer expressions [-Wsign-compare] ``` Signed-off-by: Kefu Chai --- src/msg/async/PosixStack.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msg/async/PosixStack.cc b/src/msg/async/PosixStack.cc index 65d0bf64b77f0..e71cd6aa3d1c8 100644 --- a/src/msg/async/PosixStack.cc +++ b/src/msg/async/PosixStack.cc @@ -146,7 +146,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl { { suppress_sigpipe(); - ssize_t sent = 0; + size_t sent = 0; while (1) { ssize_t r; #if defined(MSG_NOSIGNAL) @@ -185,7 +185,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl { } virtual ssize_t send(bufferlist &bl, bool more) { - ssize_t sent_bytes = 0; + size_t sent_bytes = 0; std::list::const_iterator pb = bl.buffers().begin(); uint64_t left_pbrs = bl.buffers().size(); while (left_pbrs) { @@ -212,7 +212,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl { // "r" is the remaining length sent_bytes += r; - if (r < msglen) + if (static_cast(r) < msglen) break; // only "r" == 0 continue } @@ -227,7 +227,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl { } } - return sent_bytes; + return static_cast(sent_bytes); } virtual void shutdown() { ::shutdown(_fd, SHUT_RDWR); -- 2.39.5