Fixed compiler warning with stricter warning options

This commit is contained in:
Tatsuhiro Tsujikawa 2012-05-13 17:38:29 +09:00
parent d8e7d1a112
commit e778f268de
5 changed files with 13 additions and 12 deletions

View File

@ -118,7 +118,7 @@ static ssize_t get_credential_ncerts(spdylay_session *session,
static ssize_t get_credential_cert(spdylay_session *session, static ssize_t get_credential_cert(spdylay_session *session,
const spdylay_origin *origin, const spdylay_origin *origin,
size_t index, size_t idx,
uint8_t *cert, size_t certlen, uint8_t *cert, size_t certlen,
void *user_data) void *user_data)
{ {

View File

@ -664,7 +664,7 @@ void test_spdylay_frame_nv_3to2(void)
spdylay_frame_nv_del(nv); 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 len_size)
{ {
size_t i, n; size_t i, n;

View File

@ -32,17 +32,18 @@ void test_spdylay_map(void)
{ {
spdylay_map map; spdylay_map map;
spdylay_map_init(&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(strcmp("foo", spdylay_map_find(&map, 1)) == 0);
CU_ASSERT(1 == spdylay_map_size(&map)); 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(1 == spdylay_map_size(&map));
CU_ASSERT(strcmp("foo", spdylay_map_find(&map, 1)) == 0); 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(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(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(4 == spdylay_map_size(&map));
CU_ASSERT(strcmp("baz", spdylay_map_find(&map, 3)) == 0); CU_ASSERT(strcmp("baz", spdylay_map_find(&map, 3)) == 0);

View File

@ -39,15 +39,15 @@ void test_spdylay_pq(void)
spdylay_pq_init(&pq, pq_compar); spdylay_pq_init(&pq, pq_compar);
CU_ASSERT(spdylay_pq_empty(&pq)); CU_ASSERT(spdylay_pq_empty(&pq));
CU_ASSERT(0 == spdylay_pq_size(&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(0 == spdylay_pq_empty(&pq));
CU_ASSERT(1 == spdylay_pq_size(&pq)); CU_ASSERT(1 == spdylay_pq_size(&pq));
CU_ASSERT(strcmp("foo", spdylay_pq_top(&pq)) == 0); 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(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(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(4 == spdylay_pq_size(&pq));
CU_ASSERT(strcmp("C", spdylay_pq_top(&pq)) == 0); CU_ASSERT(strcmp("C", spdylay_pq_top(&pq)) == 0);
spdylay_pq_pop(&pq); spdylay_pq_pop(&pq);

View File

@ -2140,7 +2140,7 @@ static ssize_t get_credential_ncerts(spdylay_session *session,
static ssize_t get_credential_cert(spdylay_session *session, static ssize_t get_credential_cert(spdylay_session *session,
const spdylay_origin *origin, const spdylay_origin *origin,
size_t index, size_t idx,
uint8_t *cert, size_t certlen, uint8_t *cert, size_t certlen,
void *user_data) void *user_data)
{ {