aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-10-03 15:57:09 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-10-03 15:57:09 -0700
commitd76cdac17a394d5a4be882ef0474db605db0c950 (patch)
treed04e052c8c5684657d3b5e8785d59d6fa8a46c1b
parentf8460df564385af2197ffccb4d4004fd96d0eddd (diff)
Type conversion fixes to make GCC 5.2.0 happy
-rw-r--r--src/core/surface/call.c8
-rw-r--r--src/core/transport/chttp2/bin_encoder.c8
-rw-r--r--src/core/tsi/fake_transport_security.c8
-rw-r--r--tools/codegen/core/gen_hpack_tables.c5
-rw-r--r--tools/codegen/core/gen_legal_metadata_characters.c3
5 files changed, 18 insertions, 14 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 0b917f1561..3f06507f9f 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.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; }
+
diff --git a/src/core/transport/chttp2/bin_encoder.c b/src/core/transport/chttp2/bin_encoder.c
index f1bbf9aa91..b0b04f697a 100644
--- a/src/core/transport/chttp2/bin_encoder.c
+++ b/src/core/transport/chttp2/bin_encoder.c
@@ -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));
diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.c
index cbb6f17ae1..a40268a7f0 100644
--- a/src/core/tsi/fake_transport_security.c
+++ b/src/core/tsi/fake_transport_security.c
@@ -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) {
diff --git a/tools/codegen/core/gen_hpack_tables.c b/tools/codegen/core/gen_hpack_tables.c
index d924aba602..21667f0651 100644
--- a/tools/codegen/core/gen_hpack_tables.c
+++ b/tools/codegen/core/gen_hpack_tables.c
@@ -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) {
diff --git a/tools/codegen/core/gen_legal_metadata_characters.c b/tools/codegen/core/gen_legal_metadata_characters.c
index 2ffda54a21..5783c3ff69 100644
--- a/tools/codegen/core/gen_legal_metadata_characters.c
+++ b/tools/codegen/core/gen_legal_metadata_characters.c
@@ -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) {