32 bit compilation fixes for core

pull/645/head
Craig Tiller 10 years ago
parent 99d6593db8
commit 54f9a65f1e
  1. 2
      src/core/transport/chttp2/frame_data.c
  2. 2
      src/core/transport/chttp2_transport.c
  3. 2
      src/core/tsi/ssl_transport_security.c
  4. 2
      test/core/iomgr/tcp_posix_test.c
  5. 4
      test/core/statistics/hash_table_test.c

@ -135,7 +135,7 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
case GRPC_CHTTP2_DATA_FRAME:
if (cur == end) {
return GRPC_CHTTP2_PARSE_OK;
} else if (end - cur == p->frame_size) {
} else if ((gpr_uint32)(end - cur) == p->frame_size) {
state->need_flush_reads = 1;
grpc_sopb_add_slice(&p->incoming_sopb,
gpr_slice_sub(slice, cur - beg, end - beg));

@ -1631,7 +1631,7 @@ static int process_read(transport *t, gpr_slice slice) {
/* fallthrough */
case DTS_FRAME:
GPR_ASSERT(cur < end);
if (end - cur == t->incoming_frame_size) {
if ((gpr_uint32)(end - cur) == t->incoming_frame_size) {
if (!parse_frame_slice(
t, gpr_slice_sub_no_ref(slice, cur - beg, end - beg), 1)) {
return 0;

@ -1084,7 +1084,7 @@ static int server_handshaker_factory_alpn_callback(
tsi_ssl_server_handshaker_factory* factory =
(tsi_ssl_server_handshaker_factory*)arg;
const unsigned char* client_current = in;
while ((client_current - in) < inlen) {
while ((unsigned int)(client_current - in) < inlen) {
unsigned char client_current_len = *(client_current++);
const unsigned char* server_current = factory->alpn_protocol_list;
while ((server_current >= factory->alpn_protocol_list) &&

@ -250,7 +250,7 @@ struct write_socket_state {
static gpr_slice *allocate_blocks(ssize_t num_bytes, ssize_t slice_size,
size_t *num_blocks, int *current_data) {
ssize_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
gpr_slice *slices = gpr_malloc(sizeof(gpr_slice) * nslices);
ssize_t num_bytes_left = num_bytes;
unsigned i, j;

@ -97,7 +97,7 @@ static void test_table_with_int_key(void) {
for (i = 0; i < 20; ++i) {
census_ht_key key;
key.val = i;
census_ht_insert(ht, key, (void*)i);
census_ht_insert(ht, key, (void*)(gpr_intptr)i);
GPR_ASSERT(census_ht_get_size(ht) == i + 1);
}
for (i = 0; i < 20; i++) {
@ -105,7 +105,7 @@ static void test_table_with_int_key(void) {
census_ht_key key;
key.val = i;
val = census_ht_find(ht, key);
GPR_ASSERT(val == (void*)i);
GPR_ASSERT(val == (void*)(gpr_intptr)i);
}
elements = census_ht_get_all_elements(ht, &num_elements);
GPR_ASSERT(elements != NULL);

Loading…
Cancel
Save