From ace625cfb1aa1b3c2f06890fb1f97900059bf226 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 18 Feb 2010 18:53:03 -0800 Subject: http: const correctness fixes Not fun, but maybe this can help us spot _real_ problems more easily in the future. --- ext/unicorn_http/unicorn_http.rl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/unicorn_http/unicorn_http.rl') diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 0c58473..f0b602b 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -136,7 +136,7 @@ static inline void hp_invalid_if_trailer(struct http_parser *hp) } static void write_cont_value(struct http_parser *hp, - const char *buffer, const char *p) + char *buffer, const char *p) { char *vptr; @@ -154,7 +154,7 @@ static void write_cont_value(struct http_parser *hp, if (RSTRING_LEN(hp->cont) > 0) --hp->mark; - vptr = (char *)PTR_TO(mark); + vptr = PTR_TO(mark); if (RSTRING_LEN(hp->cont) > 0) { assert((' ' == *vptr || '\t' == *vptr) && "invalid leading white space"); @@ -220,8 +220,8 @@ static void write_value(VALUE req, struct http_parser *hp, action mark {MARK(mark, fpc); } action start_field { MARK(start.field, fpc); } - action snake_upcase_field { snake_upcase_char((char *)fpc); } - action downcase_char { downcase_char((char *)fpc); } + action snake_upcase_field { snake_upcase_char(deconst(fpc)); } + action downcase_char { downcase_char(deconst(fpc)); } action write_field { hp->s.field_len = LEN(start.field, fpc); } action start_value { MARK(mark, fpc); } action write_value { write_value(req, hp, buffer, fpc); } @@ -344,7 +344,7 @@ static void http_parser_init(struct http_parser *hp) /** exec **/ static void http_parser_execute(struct http_parser *hp, - VALUE req, const char *buffer, size_t len) + VALUE req, char *buffer, size_t len) { const char *p, *pe; int cs = hp->cs; -- cgit v1.2.3-24-ge0c7