mirror of
https://github.com/ceph/ceph
synced 2025-01-11 05:29:51 +00:00
crush,msg: silence -Wsign-compare warnings
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
17c15fb8be
commit
779419a745
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user