From e778f268dece73be1574ddd732c54e33c1b79ede Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 13 May 2012 17:38:29 +0900 Subject: [PATCH] Fixed compiler warning with stricter warning options --- tests/failmalloc_test.c | 2 +- tests/spdylay_frame_test.c | 2 +- tests/spdylay_map_test.c | 11 ++++++----- tests/spdylay_pq_test.c | 8 ++++---- tests/spdylay_session_test.c | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/failmalloc_test.c b/tests/failmalloc_test.c index 49954e93..74f53fac 100644 --- a/tests/failmalloc_test.c +++ b/tests/failmalloc_test.c @@ -118,7 +118,7 @@ static ssize_t get_credential_ncerts(spdylay_session *session, static ssize_t get_credential_cert(spdylay_session *session, const spdylay_origin *origin, - size_t index, + size_t idx, uint8_t *cert, size_t certlen, void *user_data) { diff --git a/tests/spdylay_frame_test.c b/tests/spdylay_frame_test.c index 3fad076d..5c85244e 100644 --- a/tests/spdylay_frame_test.c +++ b/tests/spdylay_frame_test.c @@ -664,7 +664,7 @@ void test_spdylay_frame_nv_3to2(void) spdylay_frame_nv_del(nv); } -static size_t spdylay_pack_nv(uint8_t *buf, size_t len, const char **nv, +static size_t spdylay_pack_nv(uint8_t *buf, size_t buflen, const char **nv, size_t len_size) { size_t i, n; diff --git a/tests/spdylay_map_test.c b/tests/spdylay_map_test.c index 9f9f9d28..f5b9714b 100644 --- a/tests/spdylay_map_test.c +++ b/tests/spdylay_map_test.c @@ -32,17 +32,18 @@ void test_spdylay_map(void) { spdylay_map map; spdylay_map_init(&map); - CU_ASSERT(0 == spdylay_map_insert(&map, 1, "foo")); + CU_ASSERT(0 == spdylay_map_insert(&map, 1, (void*)"foo")); CU_ASSERT(strcmp("foo", spdylay_map_find(&map, 1)) == 0); CU_ASSERT(1 == spdylay_map_size(&map)); - CU_ASSERT(SPDYLAY_ERR_INVALID_ARGUMENT == spdylay_map_insert(&map, 1, "FOO")); + CU_ASSERT(SPDYLAY_ERR_INVALID_ARGUMENT == spdylay_map_insert(&map, 1, + (void*)"FOO")); CU_ASSERT(1 == spdylay_map_size(&map)); CU_ASSERT(strcmp("foo", spdylay_map_find(&map, 1)) == 0); - CU_ASSERT(0 == spdylay_map_insert(&map, 2, "bar")); + CU_ASSERT(0 == spdylay_map_insert(&map, 2, (void*)"bar")); CU_ASSERT(2 == spdylay_map_size(&map)); - CU_ASSERT(0 == spdylay_map_insert(&map, 3, "baz")); + CU_ASSERT(0 == spdylay_map_insert(&map, 3, (void*)"baz")); CU_ASSERT(3 == spdylay_map_size(&map)); - CU_ASSERT(0 == spdylay_map_insert(&map, 4, "shrubbery")); + CU_ASSERT(0 == spdylay_map_insert(&map, 4, (void*)"shrubbery")); CU_ASSERT(4 == spdylay_map_size(&map)); CU_ASSERT(strcmp("baz", spdylay_map_find(&map, 3)) == 0); diff --git a/tests/spdylay_pq_test.c b/tests/spdylay_pq_test.c index 978864b4..b49ed05c 100644 --- a/tests/spdylay_pq_test.c +++ b/tests/spdylay_pq_test.c @@ -39,15 +39,15 @@ void test_spdylay_pq(void) spdylay_pq_init(&pq, pq_compar); CU_ASSERT(spdylay_pq_empty(&pq)); CU_ASSERT(0 == spdylay_pq_size(&pq)); - CU_ASSERT(0 == spdylay_pq_push(&pq, "foo")); + CU_ASSERT(0 == spdylay_pq_push(&pq, (void*)"foo")); CU_ASSERT(0 == spdylay_pq_empty(&pq)); CU_ASSERT(1 == spdylay_pq_size(&pq)); CU_ASSERT(strcmp("foo", spdylay_pq_top(&pq)) == 0); - CU_ASSERT(0 == spdylay_pq_push(&pq, "bar")); + CU_ASSERT(0 == spdylay_pq_push(&pq, (void*)"bar")); CU_ASSERT(strcmp("bar", spdylay_pq_top(&pq)) == 0); - CU_ASSERT(0 == spdylay_pq_push(&pq, "baz")); + CU_ASSERT(0 == spdylay_pq_push(&pq, (void*)"baz")); CU_ASSERT(strcmp("bar", spdylay_pq_top(&pq)) == 0); - CU_ASSERT(0 == spdylay_pq_push(&pq, "C")); + CU_ASSERT(0 == spdylay_pq_push(&pq, (void*)"C")); CU_ASSERT(4 == spdylay_pq_size(&pq)); CU_ASSERT(strcmp("C", spdylay_pq_top(&pq)) == 0); spdylay_pq_pop(&pq); diff --git a/tests/spdylay_session_test.c b/tests/spdylay_session_test.c index 94f7373f..0fcbf231 100644 --- a/tests/spdylay_session_test.c +++ b/tests/spdylay_session_test.c @@ -2140,7 +2140,7 @@ static ssize_t get_credential_ncerts(spdylay_session *session, static ssize_t get_credential_cert(spdylay_session *session, const spdylay_origin *origin, - size_t index, + size_t idx, uint8_t *cert, size_t certlen, void *user_data) {