diff --git a/examples/htparse/htparse.c b/examples/htparse/htparse.c index 64a38407..fe313439 100644 --- a/examples/htparse/htparse.c +++ b/examples/htparse/htparse.c @@ -1560,7 +1560,8 @@ hdrline_start: { const char * pp = &data[i]; const char * pe = (const char *)(data + len); - size_t to_read = _MIN_READ(pe - pp, p->content_len); + size_t to_read = _MIN_READ((uint64_t)(pe - pp), + p->content_len); if (to_read > 0) { res = hook_body_run(p, hooks, pp, to_read); @@ -1612,7 +1613,8 @@ hdrline_start: { const char * pp = &data[i]; const char * pe = (const char *)(data + len); - size_t to_read = _MIN_READ(pe - pp, p->content_len); + size_t to_read = _MIN_READ((uint64_t)(pe - pp), + p->content_len); htparse_log_debug("[%p] s_body_read %zu", p, to_read); diff --git a/examples/htparse/htparse.h b/examples/htparse/htparse.h index 685015ab..827c8dc9 100644 --- a/examples/htparse/htparse.h +++ b/examples/htparse/htparse.h @@ -96,6 +96,7 @@ unsigned char htparser_get_major(htparser *); unsigned char htparser_get_minor(htparser *); unsigned int htparser_get_status(htparser *); uint64_t htparser_get_content_length(htparser *); +uint64_t htparser_get_bytes_read(htparser *); uint64_t htparser_get_total_bytes_read(htparser *); htpparse_error htparser_get_error(htparser *); const char * htparser_get_strerror(htparser *); diff --git a/tests/spdylay_pq_test.c b/tests/spdylay_pq_test.c index 6ae75c2b..e4b8eb7f 100644 --- a/tests/spdylay_pq_test.c +++ b/tests/spdylay_pq_test.c @@ -66,12 +66,12 @@ void test_spdylay_pq(void) /* Add bunch of entry to see realloc works */ for(i = 0; i < 10000; ++i) { CU_ASSERT(0 == spdylay_pq_push(&pq, (void*)"foo")); - CU_ASSERT(i+1 == spdylay_pq_size(&pq)); + CU_ASSERT((size_t)(i+1) == spdylay_pq_size(&pq)); } for(i = 10000; i > 0; --i) { CU_ASSERT(NULL != spdylay_pq_top(&pq)); spdylay_pq_pop(&pq); - CU_ASSERT(i-1 == spdylay_pq_size(&pq)); + CU_ASSERT((size_t)(i-1) == spdylay_pq_size(&pq)); } spdylay_pq_free(&pq);