From 53fe38504f087ec278177e562f57ac2e744927ac Mon Sep 17 00:00:00 2001 From: François Revel Date: Sat, 29 Nov 2008 22:53:58 +0000 Subject: C89 svn path=/trunk/netsurf/; revision=5837 --- image/svg.c | 3 ++- render/hubbub_binding.c | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/image/svg.c b/image/svg.c index a1d0abce5..0c2097341 100644 --- a/image/svg.c +++ b/image/svg.c @@ -94,6 +94,7 @@ bool svg_redraw(struct content *c, int x, int y, struct svgtiny_diagram *diagram = c->data.svg.diagram; bool ok; int px, py; + unsigned int i; assert(diagram); @@ -106,7 +107,7 @@ bool svg_redraw(struct content *c, int x, int y, #define BGR(c) ((c) == svgtiny_TRANSPARENT ? TRANSPARENT : ((svgtiny_RED((c))) | (svgtiny_GREEN((c)) << 8) | (svgtiny_BLUE((c)) << 16))) - for (unsigned int i = 0; i != diagram->shape_count; i++) { + for (i = 0; i != diagram->shape_count; i++) { if (diagram->shape[i].path) { ok = plot.path(diagram->shape[i].path, diagram->shape[i].path_length, diff --git a/render/hubbub_binding.c b/render/hubbub_binding.c index 1cc4ad72e..1a368ccc2 100644 --- a/render/hubbub_binding.c +++ b/render/hubbub_binding.c @@ -121,6 +121,7 @@ binding_error binding_create_tree(void *arena, const char *charset, void **ctx) { hubbub_ctx *c; hubbub_parser_optparams params; + uint32_t i; hubbub_error error; c = malloc(sizeof(hubbub_ctx)); @@ -151,7 +152,7 @@ binding_error binding_create_tree(void *arena, const char *charset, void **ctx) } c->document->_private = (void *) 0; - for (uint32_t i = 0; + for (i = 0; i < sizeof(c->namespaces) / sizeof(c->namespaces[0]); i++) { c->namespaces[i] = NULL; } @@ -244,7 +245,8 @@ char *c_string_from_hubbub_string(hubbub_ctx *ctx, const hubbub_string *str) void create_namespaces(hubbub_ctx *ctx, xmlNode *root) { - for (uint32_t i = 1; + uint32_t i; + for (i = 1; i < sizeof(namespaces) / sizeof(namespaces[0]); i++) { ctx->namespaces[i - 1] = xmlNewNs(root, BAD_CAST namespaces[i].url, @@ -521,8 +523,9 @@ int reparent_children(void *ctx, void *node, void *new_parent) { xmlNode *n = (xmlNode *) node; xmlNode *p = (xmlNode *) new_parent; + xmlNode *child; - for (xmlNode *child = n->children; child != NULL; ) { + for (child = n->children; child != NULL; ) { xmlNode *next = child->next; xmlUnlinkNode(child); @@ -572,8 +575,9 @@ int add_attributes(void *ctx, void *node, { hubbub_ctx *c = (hubbub_ctx *) ctx; xmlNode *n = (xmlNode *) node; + uint32_t attr; - for (uint32_t attr = 0; attr < n_attributes; attr++) { + for (attr = 0; attr < n_attributes; attr++) { xmlAttr *prop; char *name, *value; @@ -616,6 +620,8 @@ int set_quirks_mode(void *ctx, hubbub_quirks_mode mode) int change_encoding(void *ctx, const char *charset) { hubbub_ctx *c = (hubbub_ctx *) ctx; + uint32_t source; + const char *name; /* If we have an encoding here, it means we are *certain* */ if (c->encoding != NULL) { @@ -623,8 +629,7 @@ int change_encoding(void *ctx, const char *charset) } /* Find the confidence otherwise (can only be from a BOM) */ - uint32_t source; - const char *name = hubbub_parser_read_charset(c->parser, &source); + name = hubbub_parser_read_charset(c->parser, &source); if (source == HUBBUB_CHARSET_CONFIDENT) { c->encoding_source = ENCODING_SOURCE_DETECTED; -- cgit v1.2.3