aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/tcp_posix_test.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-10 16:00:22 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-10 16:00:22 -0700
commit6a6b36c50300bcc33d761598591c4d1bd4f1f6aa (patch)
treefa6b9eeb5d9281258b42603465fab6fdbb101512 /test/core/iomgr/tcp_posix_test.c
parent2ed498151da3b68107312b6397dbff4b4f60e475 (diff)
Enable -Wconversion
Diffstat (limited to 'test/core/iomgr/tcp_posix_test.c')
-rw-r--r--test/core/iomgr/tcp_posix_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index b94f5987ca..59c498edff 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -81,7 +81,7 @@ static ssize_t fill_socket(int fd) {
int i;
unsigned char buf[256];
for (i = 0; i < 256; ++i) {
- buf[i] = i;
+ buf[i] = (gpr_uint8)i;
}
do {
write_bytes = write(fd, buf, 256);
@@ -99,7 +99,7 @@ static size_t fill_socket_partial(int fd, size_t bytes) {
unsigned char *buf = malloc(bytes);
unsigned i;
for (i = 0; i < bytes; ++i) {
- buf[i] = i % 256;
+ buf[i] = (gpr_uint8)(i % 256);
}
do {
@@ -276,7 +276,7 @@ struct write_socket_state {
};
static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
- size_t *num_blocks, int *current_data) {
+ size_t *num_blocks, gpr_uint8 *current_data) {
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u);
gpr_slice *slices = gpr_malloc(sizeof(gpr_slice) * nslices);
size_t num_bytes_left = num_bytes;
@@ -291,7 +291,7 @@ static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
buf = GPR_SLICE_START_PTR(slices[i]);
for (j = 0; j < GPR_SLICE_LENGTH(slices[i]); ++j) {
buf[j] = *current_data;
- *current_data = (*current_data + 1) % 256;
+ (*current_data)++;
}
}
GPR_ASSERT(num_bytes_left == 0);
@@ -373,7 +373,7 @@ static void write_test(size_t num_bytes, size_t slice_size) {
ssize_t read_bytes;
size_t num_blocks;
gpr_slice *slices;
- int current_data = 0;
+ gpr_uint8 current_data = 0;
gpr_slice_buffer outgoing;
grpc_iomgr_closure write_done_closure;
gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20);