diff --git a/http_parser.c b/http_parser.c index 36257fd..a4db6e7 100644 --- a/http_parser.c +++ b/http_parser.c @@ -269,8 +269,8 @@ size_t http_parser_execute (http_parser *parser, const char *p = data, *pe; ssize_t to_read; - enum state state = parser->state; - enum header_states header_state = parser->header_state; + enum state state = (enum state) parser->state; + enum header_states header_state = (enum header_states) parser->header_state; size_t index = parser->index; size_t nread = parser->nread; @@ -462,7 +462,7 @@ size_t http_parser_execute (http_parser *parser, if (ch < 'A' || 'Z' < ch) goto error; - parser->method = 0; + parser->method = (enum http_method) 0; index = 0; parser->buffer[0] = ch; state = s_req_method; diff --git a/test.c b/test.c index 63d4800..3216dc8 100644 --- a/test.c +++ b/test.c @@ -950,7 +950,7 @@ print_error (const char *raw, size_t error_location) for (j = 0; j < error_location_line; j++) { fputc(' ', stderr); } - fprintf(stderr, "^\n\nerror location: %d\n", error_location); + fprintf(stderr, "^\n\nerror location: %lu\n", error_location); } @@ -1142,9 +1142,9 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess error: fprintf(stderr, "i=%d j=%d\n", i, j); - fprintf(stderr, "buf1 (%d) %s\n\n", buf1_len, buf1); - fprintf(stderr, "buf2 (%d) %s\n\n", buf2_len , buf2); - fprintf(stderr, "buf3 (%d) %s\n", buf3_len, buf3); + fprintf(stderr, "buf1 (%lu) %s\n\n", buf1_len, buf1); + fprintf(stderr, "buf2 (%lu) %s\n\n", buf2_len , buf2); + fprintf(stderr, "buf3 (%lu) %s\n", buf3_len, buf3); exit(1); } @@ -1156,7 +1156,7 @@ main (void) int request_count; int response_count; - printf("sizeof(http_parser) = %d\n", sizeof(http_parser)); + printf("sizeof(http_parser) = %lu\n", sizeof(http_parser)); for (request_count = 0; requests[request_count].name; request_count++); for (response_count = 0; responses[response_count].name; response_count++);