diff options
-rw-r--r-- | src/core/transport/chttp2/varint.h | 3 | ||||
-rw-r--r-- | test/core/transport/chttp2/varint_test.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/core/transport/chttp2/varint.h b/src/core/transport/chttp2/varint.h index c252f45fc5..970d1e17e2 100644 --- a/src/core/transport/chttp2/varint.h +++ b/src/core/transport/chttp2/varint.h @@ -50,7 +50,8 @@ void grpc_chttp2_hpack_write_varint_tail(gpr_uint32 tail_value, /* maximum value that can be bitpacked with the opcode if the opcode has a prefix of length prefix_bits */ -#define GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) ((1 << (8 - (prefix_bits))) - 1) +#define GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \ + ((gpr_uint32)((1 << (8 - (prefix_bits))) - 1)) /* length required to bitpack a value */ #define GRPC_CHTTP2_VARINT_LENGTH(n, prefix_bits) \ diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c index dc4447af5c..e5c5d9a35e 100644 --- a/test/core/transport/chttp2/varint_test.c +++ b/test/core/transport/chttp2/varint_test.c @@ -38,7 +38,9 @@ #include "test/core/util/test_config.h" -static void test_varint(gpr_uint32 value, int prefix_bits, gpr_uint8 prefix_or, const char *expect_bytes, size_t expect_length) { +static void test_varint(gpr_uint32 value, gpr_uint32 prefix_bits, + gpr_uint8 prefix_or, const char *expect_bytes, + size_t expect_length) { gpr_uint32 nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits); gpr_slice expect = gpr_slice_from_copied_buffer(expect_bytes, expect_length); gpr_slice slice; |