From b1ef83688c619d541dffc0f39fcc48e5f1169d4b Mon Sep 17 00:00:00 2001 From: wenlong_12 Date: Thu, 27 Apr 2023 03:39:49 +0000 Subject: [PATCH] =?UTF-8?q?ProtoEncoder=E6=A1=86=E6=9E=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81-=E6=B8=85=E7=90=86=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wenlong_12 --- proto_encoder/include/varint_encode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto_encoder/include/varint_encode.h b/proto_encoder/include/varint_encode.h index 1357c15b1..f8741c956 100755 --- a/proto_encoder/include/varint_encode.h +++ b/proto_encoder/include/varint_encode.h @@ -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(v); uint32_t size = 0; - while (value > (uint64_t)VARINT_MAX_1BYTE) { + while (value > static_cast(VARINT_MAX_1BYTE)) { buf[size] = (VARINT_MASK_PAYLOAD & value) | VARINT_MASK_MSB; size++; value >>= VARINT_PAYLOAD_BITS;