Type conversion fixes to make GCC 5.2.0 happy

pull/3615/head
David Garcia Quintas 9 years ago
parent f8460df564
commit d76cdac17a
  1. 8
      src/core/surface/call.c
  2. 8
      src/core/transport/chttp2/bin_encoder.c
  3. 8
      src/core/tsi/fake_transport_security.c
  4. 5
      tools/codegen/core/gen_hpack_tables.c
  5. 3
      tools/codegen/core/gen_legal_metadata_characters.c

@ -424,7 +424,8 @@ static grpc_cq_completion *allocate_completion(grpc_call *call) {
if (call->allocated_completions & (1u << i)) {
continue;
}
call->allocated_completions |= (gpr_uint8)(1u << i);
call->allocated_completions =
(gpr_uint8)(call->allocated_completions | (1u << i));
gpr_mu_unlock(&call->completion_mu);
return &call->completions[i];
}
@ -735,7 +736,7 @@ static void finish_live_ioreq_op(grpc_call *call, grpc_ioreq_op op,
size_t i;
/* ioreq is live: we need to do something */
master = &call->masters[master_set];
master->complete_mask |= (gpr_uint16)(1u << op);
master->complete_mask = (gpr_uint16)(master->complete_mask | (1u << op));
if (!success) {
master->success = 0;
}
@ -1245,7 +1246,7 @@ static grpc_call_error start_ioreq(grpc_call *call, const grpc_ioreq *reqs,
GRPC_MDSTR_REF(reqs[i].data.send_status.details));
}
}
have_ops |= (gpr_uint16)(1u << op);
have_ops = (gpr_uint16)(have_ops | (1u << op));
call->request_data[op] = data;
call->request_flags[op] = reqs[i].flags;
@ -1830,3 +1831,4 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) {
}
gpr_uint8 grpc_call_is_client(grpc_call *call) { return call->is_client; }

@ -185,8 +185,8 @@ gpr_slice grpc_chttp2_huffman_compress(gpr_slice input) {
}
if (temp_length) {
*out++ = (gpr_uint8)(temp << (8u - temp_length)) |
(gpr_uint8)(0xffu >> temp_length);
*out++ = (gpr_uint8)((gpr_uint8)(temp << (8u - temp_length)) |
(gpr_uint8)(0xffu >> temp_length));
}
GPR_ASSERT(out == GPR_SLICE_END_PTR(output));
@ -265,8 +265,8 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress(gpr_slice input) {
}
if (out.temp_length) {
*out.out++ = (gpr_uint8)(out.temp << (8u - out.temp_length)) |
(gpr_uint8)(0xffu >> out.temp_length);
*out.out++ = (gpr_uint8)((gpr_uint8)(out.temp << (8u - out.temp_length)) |
(gpr_uint8)(0xffu >> out.temp_length));
}
GPR_ASSERT(out.out <= GPR_SLICE_END_PTR(output));

@ -118,10 +118,10 @@ static gpr_uint32 load32_little_endian(const unsigned char *buf) {
}
static void store32_little_endian(gpr_uint32 value, unsigned char *buf) {
buf[3] = (unsigned char)(value >> 24) & 0xFF;
buf[2] = (unsigned char)(value >> 16) & 0xFF;
buf[1] = (unsigned char)(value >> 8) & 0xFF;
buf[0] = (unsigned char)(value)&0xFF;
buf[3] = (unsigned char)((value >> 24) & 0xFF);
buf[2] = (unsigned char)((value >> 16) & 0xFF);
buf[1] = (unsigned char)((value >> 8) & 0xFF);
buf[0] = (unsigned char)((value) & 0xFF);
}
static void tsi_fake_frame_reset(tsi_fake_frame *frame, int needs_draining) {

@ -71,7 +71,7 @@ static unsigned char prefix_mask(unsigned char prefix_len) {
unsigned char i;
unsigned char out = 0;
for (i = 0; i < prefix_len; i++) {
out |= (unsigned char)(1 << (7 - i));
out = (unsigned char)(out | (unsigned char)(1 << (7 - i)));
}
return out;
}
@ -92,7 +92,8 @@ static void generate_first_byte_lut(void) {
chrspec = NULL;
for (j = 0; j < num_fields; j++) {
if ((prefix_mask(fields[j].prefix_length) & i) == fields[j].prefix) {
suffix = suffix_mask(fields[j].prefix_length) & (unsigned char)i;
suffix = (unsigned char)(suffix_mask(fields[j].prefix_length) &
(unsigned char)i);
if (suffix == suffix_mask(fields[j].prefix_length)) {
if (fields[j].index != 2) continue;
} else if (suffix == 0) {

@ -41,7 +41,8 @@ static unsigned char legal_bits[256 / 8];
static void legal(int x) {
int byte = x / 8;
int bit = x % 8;
legal_bits[byte] |= (unsigned char)(1 << bit);
legal_bits[byte] =
(unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
}
static void dump(void) {

Loading…
Cancel
Save