aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/transport/chttp2/bin_encoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/transport/chttp2/bin_encoder.c')
-rw-r--r--src/core/transport/chttp2/bin_encoder.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/transport/chttp2/bin_encoder.c b/src/core/transport/chttp2/bin_encoder.c
index dee6dbec8b..b87d4de04b 100644
--- a/src/core/transport/chttp2/bin_encoder.c
+++ b/src/core/transport/chttp2/bin_encoder.c
@@ -68,7 +68,7 @@ gpr_slice grpc_chttp2_base64_encode(gpr_slice input) {
size_t output_length = input_triplets * 4 + tail_xtra[tail_case];
gpr_slice output = gpr_slice_malloc(output_length);
gpr_uint8 *in = GPR_SLICE_START_PTR(input);
- gpr_uint8 *out = GPR_SLICE_START_PTR(output);
+ char *out = (char *)GPR_SLICE_START_PTR(output);
size_t i;
/* encode full triplets */
@@ -100,7 +100,7 @@ gpr_slice grpc_chttp2_base64_encode(gpr_slice input) {
break;
}
- GPR_ASSERT(out == GPR_SLICE_END_PTR(output));
+ GPR_ASSERT(out == (char *)GPR_SLICE_END_PTR(output));
GPR_ASSERT(in == GPR_SLICE_END_PTR(input));
return output;
}
@@ -133,7 +133,7 @@ gpr_slice grpc_chttp2_huffman_compress(gpr_slice input) {
}
if (temp_length) {
- *out++ = (temp << (8 - temp_length)) | (0xff >> temp_length);
+ *out++ = (temp << (8u - temp_length)) | (0xffu >> temp_length);
}
GPR_ASSERT(out == GPR_SLICE_END_PTR(output));
@@ -157,9 +157,9 @@ static void enc_flush_some(huff_out *out) {
static void enc_add2(huff_out *out, gpr_uint8 a, gpr_uint8 b) {
b64_huff_sym sa = huff_alphabet[a];
b64_huff_sym sb = huff_alphabet[b];
- out->temp =
- (out->temp << (sa.length + sb.length)) | (sa.bits << sb.length) | sb.bits;
- out->temp_length += sa.length + sb.length;
+ out->temp = (out->temp << (sa.length + sb.length)) |
+ ((gpr_uint32)sa.bits << sb.length) | sb.bits;
+ out->temp_length += (gpr_uint32)sa.length + (gpr_uint32)sb.length;
enc_flush_some(out);
}
@@ -211,7 +211,7 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress(gpr_slice input) {
if (out.temp_length) {
*out.out++ =
- (out.temp << (8 - out.temp_length)) | (0xff >> out.temp_length);
+ (out.temp << (8u - out.temp_length)) | (0xffu >> out.temp_length);
}
GPR_ASSERT(out.out <= GPR_SLICE_END_PTR(output));