crush,msg: silence -Wsign-compare warnings

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-04-22 22:08:15 +08:00
parent 17c15fb8be
commit 779419a745
2 changed files with 3 additions and 2 deletions

View 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;

View 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;