From 43a99ab683d14c4a11d5fbeaef90d68c84e345fb Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 3 Apr 2010 16:37:36 +0000 Subject: Constify data parameter to *_process_data svn path=/trunk/netsurf/; revision=10234 --- render/html.c | 8 ++++---- render/html.h | 2 +- render/textplain.c | 3 ++- render/textplain.h | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'render') diff --git a/render/html.c b/render/html.c index ce34d5d63..e38a4ba99 100644 --- a/render/html.c +++ b/render/html.c @@ -192,7 +192,7 @@ error: * The data is parsed in chunks of size CHUNK, multitasking in between. */ -bool html_process_data(struct content *c, char *data, unsigned int size) +bool html_process_data(struct content *c, const char *data, unsigned int size) { unsigned long x; binding_error err; @@ -200,7 +200,7 @@ bool html_process_data(struct content *c, char *data, unsigned int size) for (x = 0; x + CHUNK <= size; x += CHUNK) { err = binding_parse_chunk(c->data.html.parser_binding, - (uint8_t *) data + x, CHUNK); + (const uint8_t *) data + x, CHUNK); if (err == BINDING_ENCODINGCHANGE) { goto encoding_change; } else if (err != BINDING_OK) { @@ -216,7 +216,7 @@ bool html_process_data(struct content *c, char *data, unsigned int size) } err = binding_parse_chunk(c->data.html.parser_binding, - (uint8_t *) data + x, (size - x)); + (const uint8_t *) data + x, (size - x)); if (err == BINDING_ENCODINGCHANGE) { goto encoding_change; } else if (err != BINDING_OK) { @@ -294,7 +294,7 @@ encoding_change: /* Recurse to reprocess all that data. This is safe because * the encoding is now specified at parser-start which means * it cannot be changed again. */ - return html_process_data(c, (char *) source_data, source_size); + return html_process_data(c, source_data, source_size); } } diff --git a/render/html.h b/render/html.h index f56cb585e..42d4ec163 100644 --- a/render/html.h +++ b/render/html.h @@ -186,7 +186,7 @@ extern bool html_redraw_debug; bool html_create(struct content *c, const struct http_parameter *params); -bool html_process_data(struct content *c, char *data, unsigned int size); +bool html_process_data(struct content *c, const char *data, unsigned int size); bool html_convert(struct content *c); void html_reformat(struct content *c, int width, int height); void html_destroy(struct content *c); diff --git a/render/textplain.c b/render/textplain.c index c259a8b07..8983fc2a9 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -133,7 +133,8 @@ no_memory: * Process data for CONTENT_TEXTPLAIN. */ -bool textplain_process_data(struct content *c, char *data, unsigned int size) +bool textplain_process_data(struct content *c, + const char *data, unsigned int size) { iconv_t iconv_cd = c->data.textplain.iconv_cd; size_t count; diff --git a/render/textplain.h b/render/textplain.h index 355695a4d..ec4882800 100644 --- a/render/textplain.h +++ b/render/textplain.h @@ -49,7 +49,8 @@ struct content_textplain_data { }; bool textplain_create(struct content *c, const struct http_parameter *params); -bool textplain_process_data(struct content *c, char *data, unsigned int size); +bool textplain_process_data(struct content *c, + const char *data, unsigned int size); bool textplain_convert(struct content *c); void textplain_reformat(struct content *c, int width, int height); void textplain_destroy(struct content *c); -- cgit v1.2.3