ProtoEncoder框架代码-清理告警

Signed-off-by: wenlong_12 <wenlong12@huawei.com>
This commit is contained in:
wenlong_12 2023-04-27 03:39:49 +00:00 committed by Gitee
parent 02b10fe22a
commit b1ef83688c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -79,9 +79,9 @@ inline uint32_t EncodeVarint(uint8_t* buf, T v)
{
// https://developers.google.com/protocol-buffers/docs/encoding
// Unsigned Integers and Signed Integers(intN)
uint64_t value = (uint64_t)v;
uint64_t value = static_cast<uint64_t>(v);
uint32_t size = 0;
while (value > (uint64_t)VARINT_MAX_1BYTE) {
while (value > static_cast<uint64_t>(VARINT_MAX_1BYTE)) {
buf[size] = (VARINT_MASK_PAYLOAD & value) | VARINT_MASK_MSB;
size++;
value >>= VARINT_PAYLOAD_BITS;