1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

init_dom_stack(): Drop unused object_size argument

This commit is contained in:
Jonas Fonseca 2005-12-21 04:41:35 +01:00 committed by Jonas Fonseca
parent f8d48e81eb
commit 632f12f82a
4 changed files with 9 additions and 10 deletions

View File

@ -376,7 +376,7 @@ parse_dom_select(struct dom_select *select, unsigned char *string, int length)
struct dom_select_node sel; struct dom_select_node sel;
init_scanner(&scanner, &css_scanner_info, string, string + length); 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)); memset(&sel, 0, sizeof(sel));
@ -869,11 +869,11 @@ select_dom_nodes(struct dom_select *select, struct dom_node *root)
select_data.select = select;; select_data.select = select;;
init_dom_stack(&stack, 0, 1); init_dom_stack(&stack, 1);
add_dom_stack_context(&stack, &select_data, add_dom_stack_context(&stack, &select_data,
&dom_select_context_info); &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, add_dom_stack_context(&stack, &select_data,
&dom_select_data_context_info); &dom_select_data_context_info);

View File

@ -53,7 +53,7 @@ realloc_dom_stack_state_objects(struct dom_stack_context *context, size_t depth)
} }
void 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); assert(stack);

View File

@ -11,6 +11,9 @@ struct dom_stack;
typedef void (*dom_stack_callback_T)(struct dom_stack *, struct dom_node *, void *); typedef void (*dom_stack_callback_T)(struct dom_stack *, struct dom_node *, void *);
struct dom_stack_context_info { 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; size_t object_size;
dom_stack_callback_T push[DOM_NODES]; dom_stack_callback_T push[DOM_NODES];
dom_stack_callback_T pop[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. */ /* Life cycle functions. */
/* The @object_size arg tells whether the stack should allocate objects for each void init_dom_stack(struct dom_stack *stack, int keep_nodes);
* 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 done_dom_stack(struct dom_stack *stack); void done_dom_stack(struct dom_stack *stack);
/* Add a callback collection to the stack. */ /* Add a callback collection to the stack. */

View File

@ -361,8 +361,7 @@ init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype,
parser->uri = get_uri_reference(uri); parser->uri = get_uri_reference(uri);
parser->info = get_sgml_info(doctype); parser->info = get_sgml_info(doctype);
init_dom_stack(&parser->stack, 0, init_dom_stack(&parser->stack, type != SGML_PARSER_STREAM);
type != SGML_PARSER_STREAM);
/* FIXME: Some sgml backend specific callbacks? Handle HTML script tags, /* FIXME: Some sgml backend specific callbacks? Handle HTML script tags,
* and feed document.write() data back to the parser. */ * and feed document.write() data back to the parser. */
add_dom_stack_context(&parser->stack, parser, &sgml_parser_context_info); add_dom_stack_context(&parser->stack, parser, &sgml_parser_context_info);