diff options
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/alarm.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/alarm_heap.c | 20 | ||||
-rw-r--r-- | src/core/iomgr/alarm_heap.h | 4 | ||||
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/resolve_address.h | 2 | ||||
-rw-r--r-- | src/core/iomgr/tcp_client.h | 2 | ||||
-rw-r--r-- | src/core/iomgr/tcp_client_posix.c | 2 |
7 files changed, 17 insertions, 17 deletions
diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c index ddb30dc4bb..e31793475f 100644 --- a/src/core/iomgr/alarm.c +++ b/src/core/iomgr/alarm.c @@ -83,7 +83,7 @@ static gpr_timespec compute_min_deadline(shard_type *shard) { } void grpc_alarm_list_init(gpr_timespec now) { - int i; + gpr_uint32 i; gpr_mu_init(&g_mu); gpr_mu_init(&g_checker_mu); diff --git a/src/core/iomgr/alarm_heap.c b/src/core/iomgr/alarm_heap.c index daed251982..7bafdffcef 100644 --- a/src/core/iomgr/alarm_heap.c +++ b/src/core/iomgr/alarm_heap.c @@ -43,9 +43,9 @@ position. This functor is called each time immediately after modifying a value in the underlying container, with the offset of the modified element as its argument. */ -static void adjust_upwards(grpc_alarm **first, int i, grpc_alarm *t) { +static void adjust_upwards(grpc_alarm **first, gpr_uint32 i, grpc_alarm *t) { while (i > 0) { - int parent = (i - 1) / 2; + gpr_uint32 parent = (i - 1u) / 2u; if (gpr_time_cmp(first[parent]->deadline, t->deadline) >= 0) break; first[i] = first[parent]; first[i]->heap_index = i; @@ -58,12 +58,12 @@ static void adjust_upwards(grpc_alarm **first, int i, grpc_alarm *t) { /* Adjusts a heap so as to move a hole at position i farther away from the root, until a suitable position is found for element t. Then, copies t into that position. */ -static void adjust_downwards(grpc_alarm **first, int i, int length, - grpc_alarm *t) { +static void adjust_downwards(grpc_alarm **first, gpr_uint32 i, + gpr_uint32 length, grpc_alarm *t) { for (;;) { - int left_child = 1 + 2 * i; - int right_child; - int next_i; + gpr_uint32 left_child = 1u + 2u * i; + gpr_uint32 right_child; + gpr_uint32 next_i; if (left_child >= length) break; right_child = left_child + 1; next_i = right_child < length && @@ -93,8 +93,8 @@ static void maybe_shrink(grpc_alarm_heap *heap) { } static void note_changed_priority(grpc_alarm_heap *heap, grpc_alarm *alarm) { - int i = alarm->heap_index; - int parent = (i - 1) / 2; + gpr_uint32 i = alarm->heap_index; + gpr_uint32 parent = (i - 1u) / 2u; if (gpr_time_cmp(heap->alarms[parent]->deadline, alarm->deadline) < 0) { adjust_upwards(heap->alarms, i, alarm); } else { @@ -122,7 +122,7 @@ int grpc_alarm_heap_add(grpc_alarm_heap *heap, grpc_alarm *alarm) { } void grpc_alarm_heap_remove(grpc_alarm_heap *heap, grpc_alarm *alarm) { - int i = alarm->heap_index; + gpr_uint32 i = alarm->heap_index; if (i == heap->alarm_count - 1) { heap->alarm_count--; maybe_shrink(heap); diff --git a/src/core/iomgr/alarm_heap.h b/src/core/iomgr/alarm_heap.h index 60db6c991b..91d6ee3ca2 100644 --- a/src/core/iomgr/alarm_heap.h +++ b/src/core/iomgr/alarm_heap.h @@ -38,8 +38,8 @@ typedef struct { grpc_alarm **alarms; - int alarm_count; - int alarm_capacity; + gpr_uint32 alarm_count; + gpr_uint32 alarm_capacity; } grpc_alarm_heap; /* return 1 if the new alarm is the first alarm in the heap */ diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 6bd1b61f24..93aa3ad662 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -420,7 +420,7 @@ static void basic_pollset_maybe_work(grpc_pollset *pollset, grpc_fd_watcher fd_watcher; int timeout; int r; - int nfds; + nfds_t nfds; if (pollset->in_flight_cbs) { /* Give do_promote priority so we don't starve it out */ diff --git a/src/core/iomgr/resolve_address.h b/src/core/iomgr/resolve_address.h index cc1bd428b0..9f361cb892 100644 --- a/src/core/iomgr/resolve_address.h +++ b/src/core/iomgr/resolve_address.h @@ -40,7 +40,7 @@ typedef struct { char addr[GRPC_MAX_SOCKADDR_SIZE]; - int len; + size_t len; } grpc_resolved_address; typedef struct { diff --git a/src/core/iomgr/tcp_client.h b/src/core/iomgr/tcp_client.h index 8ad9b818e1..12296bd55b 100644 --- a/src/core/iomgr/tcp_client.h +++ b/src/core/iomgr/tcp_client.h @@ -46,7 +46,7 @@ in this connection being established (in order to continue their work) */ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp), void *arg, grpc_pollset_set *interested_parties, - const struct sockaddr *addr, int addr_len, + const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline); #endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */ diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c index 66027f87a0..7ca0a60c31 100644 --- a/src/core/iomgr/tcp_client_posix.c +++ b/src/core/iomgr/tcp_client_posix.c @@ -195,7 +195,7 @@ finish: void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *ep), void *arg, grpc_pollset_set *interested_parties, - const struct sockaddr *addr, int addr_len, + const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline) { int fd; grpc_dualstack_mode dsmode; |