From 3374f3cbba413d7d549c3913e06b8679b9ad3930 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 21 Dec 2005 01:36:47 +0100 Subject: [PATCH] Drop data member from struct sgml_parser it is at stack->current->data --- src/document/dom/renderer.c | 15 +++++---------- src/document/sgml/parser.c | 3 +-- src/document/sgml/parser.h | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/document/dom/renderer.c b/src/document/dom/renderer.c index 3341024cc..f3c0699e1 100644 --- a/src/document/dom/renderer.c +++ b/src/document/dom/renderer.c @@ -597,8 +597,7 @@ render_dom_node_text(struct dom_renderer *renderer, struct screen_char *template static void render_dom_node_source(struct dom_stack *stack, struct dom_node *node, void *data) { - struct sgml_parser *parser = stack->data; - struct dom_renderer *renderer = parser->data; + struct dom_renderer *renderer = stack->current->data; assert(node && renderer && renderer->document); @@ -611,8 +610,7 @@ render_dom_node_source(struct dom_stack *stack, struct dom_node *node, void *dat static void render_dom_element_source(struct dom_stack *stack, struct dom_node *node, void *data) { - struct sgml_parser *parser = stack->data; - struct dom_renderer *renderer = parser->data; + struct dom_renderer *renderer = stack->current->data; assert(node && renderer && renderer->document); @@ -622,8 +620,7 @@ render_dom_element_source(struct dom_stack *stack, struct dom_node *node, void * static void render_dom_element_end_source(struct dom_stack *stack, struct dom_node *node, void *data) { - struct sgml_parser *parser = stack->data; - struct dom_renderer *renderer = parser->data; + struct dom_renderer *renderer = stack->current->data; struct sgml_parser_state *pstate = data; struct scanner_token *token = &pstate->end_token; unsigned char *string = token->string; @@ -646,8 +643,7 @@ render_dom_element_end_source(struct dom_stack *stack, struct dom_node *node, vo static void render_dom_attribute_source(struct dom_stack *stack, struct dom_node *node, void *data) { - struct sgml_parser *parser = stack->data; - struct dom_renderer *renderer = parser->data; + struct dom_renderer *renderer = stack->current->data; struct screen_char *template = &renderer->styles[node->type]; assert(node && renderer->document); @@ -799,8 +795,7 @@ render_dom_document(struct cache_entry *cached, struct document *document, else doctype = SGML_DOCTYPE_HTML; - parser = init_sgml_parser(SGML_PARSER_STREAM, doctype, - &renderer, cached->uri); + parser = init_sgml_parser(SGML_PARSER_STREAM, doctype, cached->uri); if (!parser) return; add_dom_stack_context(&parser->stack, &renderer, diff --git a/src/document/sgml/parser.c b/src/document/sgml/parser.c index 91f6420be..6d36381eb 100644 --- a/src/document/sgml/parser.c +++ b/src/document/sgml/parser.c @@ -305,7 +305,7 @@ parse_sgml_document(struct dom_stack *stack, struct scanner *scanner) struct sgml_parser * init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype, - void *data, struct uri *uri) + struct uri *uri) { size_t obj_size = sizeof(struct sgml_parser_state); struct sgml_parser *parser; @@ -316,7 +316,6 @@ init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype, parser->type = type; parser->uri = get_uri_reference(uri); parser->info = get_sgml_info(doctype); - parser->data = data; init_dom_stack(&parser->stack, parser, obj_size, type != SGML_PARSER_STREAM); diff --git a/src/document/sgml/parser.h b/src/document/sgml/parser.h index e0318d102..a5e11c308 100644 --- a/src/document/sgml/parser.h +++ b/src/document/sgml/parser.h @@ -29,7 +29,6 @@ struct sgml_parser { struct uri *uri; struct dom_node *root; - void *data; struct scanner scanner; struct dom_stack stack; @@ -44,7 +43,7 @@ struct sgml_parser_state { struct sgml_parser * init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype, - void *data, struct uri *uri); + struct uri *uri); void done_sgml_parser(struct sgml_parser *parser);