Skip to content
Snippets Groups Projects
Commit e52be8c8 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Merge pull request #6224 from dgquintas/gcc6

Casting fixes for gcc 6.0
parents 241dea56 ee6f4bcd
No related branches found
No related tags found
No related merge requests found
...@@ -194,9 +194,13 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input) { ...@@ -194,9 +194,13 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input) {
/* encode full triplets */ /* encode full triplets */
for (i = 0; i < input_triplets; i++) { for (i = 0; i < input_triplets; i++) {
enc_add2(&out, in[0] >> 2, (uint8_t)((in[0] & 0x3) << 4) | (in[1] >> 4)); const uint8_t low_to_high = (uint8_t)((in[0] & 0x3) << 4);
enc_add2(&out, (uint8_t)((in[1] & 0xf) << 2) | (in[2] >> 6), const uint8_t high_to_low = in[1] >> 4;
(uint8_t)(in[2] & 0x3f)); enc_add2(&out, in[0] >> 2, low_to_high | high_to_low);
const uint8_t a = (uint8_t)((in[1] & 0xf) << 2);
const uint8_t b = (in[2] >> 6);
enc_add2(&out, a | b, in[2] & 0x3f);
in += 3; in += 3;
} }
...@@ -208,12 +212,14 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input) { ...@@ -208,12 +212,14 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input) {
enc_add2(&out, in[0] >> 2, (uint8_t)((in[0] & 0x3) << 4)); enc_add2(&out, in[0] >> 2, (uint8_t)((in[0] & 0x3) << 4));
in += 1; in += 1;
break; break;
case 2: case 2: {
enc_add2(&out, in[0] >> 2, const uint8_t low_to_high = (uint8_t)((in[0] & 0x3) << 4);
(uint8_t)((in[0] & 0x3) << 4) | (uint8_t)(in[1] >> 4)); const uint8_t high_to_low = in[1] >> 4;
enc_add2(&out, in[0] >> 2, low_to_high | high_to_low);
enc_add1(&out, (uint8_t)((in[1] & 0xf) << 2)); enc_add1(&out, (uint8_t)((in[1] & 0xf) << 2));
in += 2; in += 2;
break; break;
}
} }
if (out.temp_length) { if (out.temp_length) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment