Fix c++ and mac compile errors

event_stream
Ryan Dahl 15 years ago
parent 1b30bf4ba5
commit 8243fddd17

@ -269,8 +269,8 @@ size_t http_parser_execute (http_parser *parser,
const char *p = data, *pe; const char *p = data, *pe;
ssize_t to_read; ssize_t to_read;
enum state state = parser->state; enum state state = (enum state) parser->state;
enum header_states header_state = parser->header_state; enum header_states header_state = (enum header_states) parser->header_state;
size_t index = parser->index; size_t index = parser->index;
size_t nread = parser->nread; size_t nread = parser->nread;
@ -462,7 +462,7 @@ size_t http_parser_execute (http_parser *parser,
if (ch < 'A' || 'Z' < ch) goto error; if (ch < 'A' || 'Z' < ch) goto error;
parser->method = 0; parser->method = (enum http_method) 0;
index = 0; index = 0;
parser->buffer[0] = ch; parser->buffer[0] = ch;
state = s_req_method; state = s_req_method;

@ -950,7 +950,7 @@ print_error (const char *raw, size_t error_location)
for (j = 0; j < error_location_line; j++) { for (j = 0; j < error_location_line; j++) {
fputc(' ', stderr); 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: error:
fprintf(stderr, "i=%d j=%d\n", i, j); fprintf(stderr, "i=%d j=%d\n", i, j);
fprintf(stderr, "buf1 (%d) %s\n\n", buf1_len, buf1); fprintf(stderr, "buf1 (%lu) %s\n\n", buf1_len, buf1);
fprintf(stderr, "buf2 (%d) %s\n\n", buf2_len , buf2); fprintf(stderr, "buf2 (%lu) %s\n\n", buf2_len , buf2);
fprintf(stderr, "buf3 (%d) %s\n", buf3_len, buf3); fprintf(stderr, "buf3 (%lu) %s\n", buf3_len, buf3);
exit(1); exit(1);
} }
@ -1156,7 +1156,7 @@ main (void)
int request_count; int request_count;
int response_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 (request_count = 0; requests[request_count].name; request_count++);
for (response_count = 0; responses[response_count].name; response_count++); for (response_count = 0; responses[response_count].name; response_count++);

Loading…
Cancel
Save