]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush,msg: silence -Wsign-compare warnings
authorKefu Chai <kchai@redhat.com>
Mon, 22 Apr 2019 14:08:15 +0000 (22:08 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Apr 2019 08:26:07 +0000 (16:26 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crush/CrushWrapper.h
src/msg/async/ProtocolV1.cc

index ce3ddf3b3addca499f0bcff5ac316699cd316de9..eddf944362db8db6a32ee2d2476373e4f04d02e1 100644 (file)
@@ -968,7 +968,7 @@ public:
 
   int validate_weightf(float weight) {
     uint64_t iweight = weight * 0x10000;
-    if (iweight > std::numeric_limits<int>::max()) {
+    if (iweight > static_cast<uint64_t>(std::numeric_limits<int>::max())) {
       return -EOVERFLOW;
     }
     return 0;
index 8879767453684b415fcad7b3f6e6485d3d4dc624..edc75ab2922fd53b8a02ed42ef5e12b54ec2550d 100644 (file)
@@ -863,7 +863,8 @@ CtPtr ProtocolV1::handle_message_data(char *buffer, int r) {
 
   bufferptr bp = data_blp.get_current_ptr();
   unsigned read_len = std::min(bp.length(), msg_left);
-  ceph_assert(read_len < std::numeric_limits<int>::max());
+  ceph_assert(read_len <
+             static_cast<unsigned>(std::numeric_limits<int>::max()));
   data_blp.advance(read_len);
   data.append(bp, 0, read_len);
   msg_left -= read_len;