From 632f12f82a7b83d9e2fabc04dbe28e6f635b3504 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 21 Dec 2005 04:41:35 +0100 Subject: [PATCH] init_dom_stack(): Drop unused object_size argument --- src/document/dom/select.c | 6 +++--- src/document/dom/stack.c | 2 +- src/document/dom/stack.h | 8 ++++---- src/document/sgml/parser.c | 3 +-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/document/dom/select.c b/src/document/dom/select.c index 7922735a..457a959b 100644 --- a/src/document/dom/select.c +++ b/src/document/dom/select.c @@ -376,7 +376,7 @@ parse_dom_select(struct dom_select *select, unsigned char *string, int length) struct dom_select_node sel; init_scanner(&scanner, &css_scanner_info, string, string + length); - init_dom_stack(&stack, 0, 1); + init_dom_stack(&stack, 1); memset(&sel, 0, sizeof(sel)); @@ -869,11 +869,11 @@ select_dom_nodes(struct dom_select *select, struct dom_node *root) select_data.select = select;; - init_dom_stack(&stack, 0, 1); + init_dom_stack(&stack, 1); add_dom_stack_context(&stack, &select_data, &dom_select_context_info); - init_dom_stack(&select_data.stack, 0, 1); + init_dom_stack(&select_data.stack, 1); add_dom_stack_context(&stack, &select_data, &dom_select_data_context_info); diff --git a/src/document/dom/stack.c b/src/document/dom/stack.c index 853eacab..53125425 100644 --- a/src/document/dom/stack.c +++ b/src/document/dom/stack.c @@ -53,7 +53,7 @@ realloc_dom_stack_state_objects(struct dom_stack_context *context, size_t depth) } void -init_dom_stack(struct dom_stack *stack, size_t object_size, int keep_nodes) +init_dom_stack(struct dom_stack *stack, int keep_nodes) { assert(stack); diff --git a/src/document/dom/stack.h b/src/document/dom/stack.h index 85318c5c..988399cc 100644 --- a/src/document/dom/stack.h +++ b/src/document/dom/stack.h @@ -11,6 +11,9 @@ struct dom_stack; typedef void (*dom_stack_callback_T)(struct dom_stack *, struct dom_node *, void *); struct dom_stack_context_info { + /* The @object_size member tells whether the stack should allocate + * objects for each state to be assigned to the state's @data member. + * Zero means no state data should be allocated. */ size_t object_size; dom_stack_callback_T push[DOM_NODES]; dom_stack_callback_T pop[DOM_NODES]; @@ -118,10 +121,7 @@ search_dom_stack(struct dom_stack *stack, enum dom_node_type type, /* Life cycle functions. */ -/* The @object_size arg tells whether the stack should allocate objects for each - * state to be assigned to the state's @data member. Zero means no state data should - * be allocated. */ -void init_dom_stack(struct dom_stack *stack, size_t object_size, int keep_nodes); +void init_dom_stack(struct dom_stack *stack, int keep_nodes); void done_dom_stack(struct dom_stack *stack); /* Add a callback collection to the stack. */ diff --git a/src/document/sgml/parser.c b/src/document/sgml/parser.c index 3116d997..3a321f70 100644 --- a/src/document/sgml/parser.c +++ b/src/document/sgml/parser.c @@ -361,8 +361,7 @@ init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype, parser->uri = get_uri_reference(uri); parser->info = get_sgml_info(doctype); - init_dom_stack(&parser->stack, 0, - type != SGML_PARSER_STREAM); + init_dom_stack(&parser->stack, type != SGML_PARSER_STREAM); /* FIXME: Some sgml backend specific callbacks? Handle HTML script tags, * and feed document.write() data back to the parser. */ add_dom_stack_context(&parser->stack, parser, &sgml_parser_context_info);