summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-07-26 21:20:28 (GMT)
committer John Mark Bell <jmb@netsurf-browser.org>2011-07-26 21:20:28 (GMT)
commit60c01918f34e99e5f9428fbc96cbcf62257c82fa (patch)
tree1c32acd13385f7d1a495654dcb2614e043bb4253
parent9c2fbb29cc1d77e1d0600baf2d0f8bd9503ad419 (diff)
downloadlibhubbub-60c01918f34e99e5f9428fbc96cbcf62257c82fa.tar.gz
libhubbub-60c01918f34e99e5f9428fbc96cbcf62257c82fa.tar.bz2
Fix build with GCC 4.6
svn path=/trunk/hubbub/; revision=12628
-rw-r--r--src/tokeniser/tokeniser.c17
-rw-r--r--src/treebuilder/after_head.c5
-rw-r--r--src/treebuilder/generic_rcdata.c4
-rw-r--r--src/treebuilder/in_body.c71
-rw-r--r--src/treebuilder/in_caption.c4
-rw-r--r--src/treebuilder/in_cell.c8
-rw-r--r--src/treebuilder/in_column_group.c4
-rw-r--r--src/treebuilder/in_foreign_content.c4
-rw-r--r--src/treebuilder/in_frameset.c4
-rw-r--r--src/treebuilder/in_head.c4
-rw-r--r--src/treebuilder/in_head_noscript.c4
-rw-r--r--src/treebuilder/in_row.c16
-rw-r--r--src/treebuilder/in_select.c32
-rw-r--r--src/treebuilder/in_select_in_table.c5
-rw-r--r--src/treebuilder/in_table.c17
-rw-r--r--src/treebuilder/in_table_body.c12
-rw-r--r--src/treebuilder/treebuilder.c36
17 files changed, 68 insertions, 179 deletions
diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c
index 7eb6bc1..949f433 100644
--- a/src/tokeniser/tokeniser.c
+++ b/src/tokeniser/tokeniser.c
@@ -788,13 +788,16 @@ hubbub_error hubbub_tokeniser_handle_character_reference_data(
} else {
parserutils_error error;
const uint8_t *cptr = NULL;
+
error = parserutils_inputstream_peek(
tokeniser->input,
tokeniser->context.pending,
&cptr,
&len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK) {
+ return hubbub_error_from_parserutils_error(
+ error);
+ }
token.data.character.ptr = cptr;
token.data.character.len = len;
@@ -1586,8 +1589,10 @@ hubbub_error hubbub_tokeniser_handle_character_reference_in_attribute_value(
tokeniser->context.pending,
&cptr,
&len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK) {
+ return hubbub_error_from_parserutils_error(
+ error);
+ }
/* Insert the ampersand */
COLLECT_MS(attr->value, cptr, len);
@@ -3131,8 +3136,8 @@ hubbub_error emit_current_chars(hubbub_tokeniser *tokeniser)
assert(tokeniser->context.pending > 0);
error = parserutils_inputstream_peek(tokeniser->input, 0, &cptr, &len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK)
+ return hubbub_error_from_parserutils_error(error);
token.type = HUBBUB_TOKEN_CHARACTER;
token.data.character.ptr = cptr;
diff --git a/src/treebuilder/after_head.c b/src/treebuilder/after_head.c
index 6305f4c..bd6e004 100644
--- a/src/treebuilder/after_head.c
+++ b/src/treebuilder/after_head.c
@@ -62,7 +62,6 @@ hubbub_error handle_after_head(hubbub_treebuilder *treebuilder,
element_type otype;
void *node;
uint32_t index;
- hubbub_error e;
/** \todo parse error */
@@ -78,10 +77,8 @@ hubbub_error handle_after_head(hubbub_treebuilder *treebuilder,
/* Process as "in head" */
err = handle_in_head(treebuilder, token);
- e = element_stack_remove(treebuilder, index,
+ element_stack_remove(treebuilder, index,
&ns, &otype, &node);
- /* Can't result in error -- ensure this. */
- assert(e == HUBBUB_OK);
/* No need to unref node as we never increased
* its reference count when pushing it on the stack */
diff --git a/src/treebuilder/generic_rcdata.c b/src/treebuilder/generic_rcdata.c
index 2da8d44..6991dce 100644
--- a/src/treebuilder/generic_rcdata.c
+++ b/src/treebuilder/generic_rcdata.c
@@ -85,14 +85,12 @@ hubbub_error handle_generic_rcdata(hubbub_treebuilder *treebuilder,
}
if (done) {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
/* Pop the current node from the stack */
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_body.c b/src/treebuilder/in_body.c
index f29910d..e736d51 100644
--- a/src/treebuilder/in_body.c
+++ b/src/treebuilder/in_body.c
@@ -827,18 +827,15 @@ hubbub_error process_a_in_body(hubbub_treebuilder *treebuilder,
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
/* Unref twice (once for stack, once for formatting list) */
treebuilder->tree_handler->unref_node(
@@ -883,18 +880,15 @@ hubbub_error process_presentational_in_body(hubbub_treebuilder *treebuilder,
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
/* Unref twice (once for stack, once for formatting list) */
treebuilder->tree_handler->unref_node(
@@ -952,18 +946,15 @@ hubbub_error process_nobr_in_body(hubbub_treebuilder *treebuilder,
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
/* Unref twice (once for stack, once for formatting list) */
treebuilder->tree_handler->unref_node(
@@ -1016,18 +1007,15 @@ hubbub_error process_button_in_body(hubbub_treebuilder *treebuilder,
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
/* Unref twice (once for stack, once for formatting list) */
treebuilder->tree_handler->unref_node(
@@ -1075,18 +1063,15 @@ hubbub_error process_applet_marquee_object_in_body(
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
/* Unref twice (once for stack, once for formatting list) */
treebuilder->tree_handler->unref_node(
@@ -1467,12 +1452,10 @@ hubbub_error process_0container_in_body(hubbub_treebuilder *treebuilder,
close_implied_end_tags(treebuilder, UNKNOWN);
do {
- hubbub_error e;
hubbub_ns ns;
void *node;
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1496,7 +1479,6 @@ hubbub_error process_0container_in_body(hubbub_treebuilder *treebuilder,
*/
hubbub_error process_0form_in_body(hubbub_treebuilder *treebuilder)
{
- hubbub_error err;
void *node = treebuilder->context.form_element;
uint32_t idx = 0;
@@ -1524,9 +1506,8 @@ hubbub_error process_0form_in_body(hubbub_treebuilder *treebuilder)
/** \todo parse error */
}
- err = element_stack_remove(treebuilder, idx,
+ element_stack_remove(treebuilder, idx,
&ns, &otype, &onode);
- assert(err == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1599,8 +1580,6 @@ hubbub_error process_0p_in_body(hubbub_treebuilder *treebuilder)
hubbub_error process_0dd_dt_li_in_body(hubbub_treebuilder *treebuilder,
element_type type)
{
- hubbub_error err;
-
if (!element_in_scope(treebuilder, type, false)) {
/** \todo parse error */
} else {
@@ -1613,9 +1592,8 @@ hubbub_error process_0dd_dt_li_in_body(hubbub_treebuilder *treebuilder,
hubbub_ns ns;
void *node;
- err = element_stack_pop(treebuilder,
+ element_stack_pop(treebuilder,
&ns, &otype, &node);
- assert(err == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1656,12 +1634,10 @@ hubbub_error process_0h_in_body(hubbub_treebuilder *treebuilder,
close_implied_end_tags(treebuilder, UNKNOWN);
do {
- hubbub_error e;
hubbub_ns ns;
void *node;
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1897,7 +1873,6 @@ hubbub_error aa_find_and_validate_formatting_element(
if (entry->stack_index == 0) {
/* Not in element stack => remove from formatting list */
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
@@ -1905,9 +1880,8 @@ hubbub_error aa_find_and_validate_formatting_element(
/** \todo parse error */
- e = formatting_list_remove(treebuilder, entry,
+ formatting_list_remove(treebuilder, entry,
&ns, &type, &node, &index);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx, node);
@@ -1976,7 +1950,6 @@ hubbub_error aa_find_furthest_block(hubbub_treebuilder *treebuilder,
}
if (fb > treebuilder->context.current_node) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
@@ -1985,8 +1958,7 @@ hubbub_error aa_find_furthest_block(hubbub_treebuilder *treebuilder,
/* Pop all elements off the stack up to,
* and including, the formatting element */
do {
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1994,9 +1966,8 @@ hubbub_error aa_find_furthest_block(hubbub_treebuilder *treebuilder,
} while (treebuilder->context.current_node >= fe_index);
/* Remove the formatting element from the list */
- e = formatting_list_remove(treebuilder, formatting_element,
+ formatting_list_remove(treebuilder, formatting_element,
&ns, &type, &node, &index);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx, node);
@@ -2339,12 +2310,10 @@ hubbub_error process_0applet_button_marquee_object_in_body(
close_implied_end_tags(treebuilder, UNKNOWN);
do {
- hubbub_error e;
hubbub_ns ns;
void *node;
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -2411,13 +2380,11 @@ hubbub_error process_0generic_in_body(hubbub_treebuilder *treebuilder,
close_implied_end_tags(treebuilder, UNKNOWN);
while (treebuilder->context.current_node >= node) {
- hubbub_error e;
hubbub_ns ns;
void *node;
- e = element_stack_pop(treebuilder,
+ element_stack_pop(treebuilder,
&ns, &otype, &node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_caption.c b/src/treebuilder/in_caption.c
index 24f30e4..d38989c 100644
--- a/src/treebuilder/in_caption.c
+++ b/src/treebuilder/in_caption.c
@@ -76,7 +76,6 @@ hubbub_error handle_in_caption(hubbub_treebuilder *treebuilder,
}
if (handled || err == HUBBUB_REPROCESS) {
- hubbub_error e;
hubbub_ns ns;
element_type otype = UNKNOWN;
void *node;
@@ -88,8 +87,7 @@ hubbub_error handle_in_caption(hubbub_treebuilder *treebuilder,
while (otype != CAPTION) {
/** \todo parse error */
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_cell.c b/src/treebuilder/in_cell.c
index 0510126..416f988 100644
--- a/src/treebuilder/in_cell.c
+++ b/src/treebuilder/in_cell.c
@@ -21,7 +21,6 @@
*/
static inline void close_cell(hubbub_treebuilder *treebuilder)
{
- hubbub_error e;
hubbub_ns ns;
element_type otype = UNKNOWN;
void *node;
@@ -40,8 +39,7 @@ static inline void close_cell(hubbub_treebuilder *treebuilder)
/** \todo parse error */
while (otype != type) {
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -92,7 +90,6 @@ hubbub_error handle_in_cell(hubbub_treebuilder *treebuilder,
if (type == TH || type == TD) {
if (element_in_scope(treebuilder, type, true)) {
- hubbub_error e;
hubbub_ns ns;
element_type otype = UNKNOWN;
void *node;
@@ -101,9 +98,8 @@ hubbub_error handle_in_cell(hubbub_treebuilder *treebuilder,
/** \todo parse error */
while (otype != type) {
- e = element_stack_pop(treebuilder,
+ element_stack_pop(treebuilder,
&ns, &otype, &node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_column_group.c b/src/treebuilder/in_column_group.c
index ba0a4e1..9436fc6 100644
--- a/src/treebuilder/in_column_group.c
+++ b/src/treebuilder/in_column_group.c
@@ -80,14 +80,12 @@ hubbub_error handle_in_column_group(hubbub_treebuilder *treebuilder,
}
if (handled || err == HUBBUB_REPROCESS) {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
/* Pop the current node (which will be a colgroup) */
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_foreign_content.c b/src/treebuilder/in_foreign_content.c
index a78e59f..fa76a09 100644
--- a/src/treebuilder/in_foreign_content.c
+++ b/src/treebuilder/in_foreign_content.c
@@ -365,13 +365,11 @@ static void foreign_break_out(hubbub_treebuilder *treebuilder)
while (stack[treebuilder->context.current_node].ns !=
HUBBUB_NS_HTML) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_frameset.c b/src/treebuilder/in_frameset.c
index 928e4cc..6d908a9 100644
--- a/src/treebuilder/in_frameset.c
+++ b/src/treebuilder/in_frameset.c
@@ -71,7 +71,6 @@ hubbub_error handle_in_frameset(hubbub_treebuilder *treebuilder,
&token->data.tag.name);
if (type == FRAMESET) {
- hubbub_error e;
hubbub_ns ns;
void *node;
@@ -81,8 +80,7 @@ hubbub_error handle_in_frameset(hubbub_treebuilder *treebuilder,
break;
}
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_head.c b/src/treebuilder/in_head.c
index 8eb95d1..0e9dd60 100644
--- a/src/treebuilder/in_head.c
+++ b/src/treebuilder/in_head.c
@@ -186,13 +186,11 @@ hubbub_error handle_in_head(hubbub_treebuilder *treebuilder,
}
if (handled || err == HUBBUB_REPROCESS) {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_head_noscript.c b/src/treebuilder/in_head_noscript.c
index cf5061c..d13ca30 100644
--- a/src/treebuilder/in_head_noscript.c
+++ b/src/treebuilder/in_head_noscript.c
@@ -82,13 +82,11 @@ hubbub_error handle_in_head_noscript(hubbub_treebuilder *treebuilder,
}
if (handled || err == HUBBUB_REPROCESS) {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/in_row.c b/src/treebuilder/in_row.c
index 0c23bab..3bf9161 100644
--- a/src/treebuilder/in_row.c
+++ b/src/treebuilder/in_row.c
@@ -24,13 +24,11 @@ static void table_clear_stack(hubbub_treebuilder *treebuilder)
element_type cur_node = current_node(treebuilder);
while (cur_node != TR && cur_node != HTML) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -51,7 +49,6 @@ static void table_clear_stack(hubbub_treebuilder *treebuilder)
*/
static hubbub_error act_as_if_end_tag_tr(hubbub_treebuilder *treebuilder)
{
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
@@ -60,8 +57,7 @@ static hubbub_error act_as_if_end_tag_tr(hubbub_treebuilder *treebuilder)
table_clear_stack(treebuilder);
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(treebuilder->tree_handler->ctx,
node);
@@ -112,21 +108,17 @@ hubbub_error handle_in_row(hubbub_treebuilder *treebuilder,
treebuilder->context.current_node].node,
treebuilder->context.current_node);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
/* Revert changes */
- e = remove_node_from_dom(treebuilder,
+ remove_node_from_dom(treebuilder,
treebuilder->context.element_stack[
treebuilder->context.current_node].node);
- assert(e == HUBBUB_OK);
-
- e = element_stack_pop(treebuilder, &ns, &type,
+ element_stack_pop(treebuilder, &ns, &type,
&node);
- assert(e == HUBBUB_OK);
return err;
}
diff --git a/src/treebuilder/in_select.c b/src/treebuilder/in_select.c
index cfddf4a..ab40c6c 100644
--- a/src/treebuilder/in_select.c
+++ b/src/treebuilder/in_select.c
@@ -52,10 +52,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
err = handle_in_body(treebuilder, token);
} else if (type == OPTION) {
if (current_node(treebuilder) == OPTION) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -66,10 +64,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
true);
} else if (type == OPTGROUP) {
if (current_node(treebuilder) == OPTION) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -77,10 +73,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
}
if (current_node(treebuilder) == OPTGROUP) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -93,10 +87,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
type == TEXTAREA) {
if (element_in_scope(treebuilder, SELECT, true)) {
- hubbub_error e;
- e = element_stack_pop_until(treebuilder,
+ element_stack_pop_until(treebuilder,
SELECT);
- assert(e == HUBBUB_OK);
reset_insertion_mode(treebuilder);
} else {
/* fragment case */
@@ -120,10 +112,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
if (type == OPTGROUP) {
if (current_node(treebuilder) == OPTION &&
prev_node(treebuilder) == OPTGROUP) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -131,10 +121,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
}
if (current_node(treebuilder) == OPTGROUP) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -144,10 +132,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
}
} else if (type == OPTION) {
if (current_node(treebuilder) == OPTION) {
- hubbub_error e;
- e = element_stack_pop(treebuilder, &ns, &otype,
+ element_stack_pop(treebuilder, &ns, &otype,
&node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -157,10 +143,8 @@ hubbub_error handle_in_select(hubbub_treebuilder *treebuilder,
}
} else if (type == SELECT) {
if (element_in_scope(treebuilder, SELECT, true)) {
- hubbub_error e;
- e = element_stack_pop_until(treebuilder,
+ element_stack_pop_until(treebuilder,
SELECT);
- assert(e == HUBBUB_OK);
reset_insertion_mode(treebuilder);
} else {
/* fragment case */
diff --git a/src/treebuilder/in_select_in_table.c b/src/treebuilder/in_select_in_table.c
index b22fbc1..7a299b2 100644
--- a/src/treebuilder/in_select_in_table.c
+++ b/src/treebuilder/in_select_in_table.c
@@ -43,13 +43,10 @@ hubbub_error handle_in_select_in_table(hubbub_treebuilder *treebuilder,
element_in_scope(treebuilder, type,
true)) ||
token->type == HUBBUB_TOKEN_START_TAG) {
- hubbub_error e;
-
/** \todo fragment case */
- e = element_stack_pop_until(treebuilder,
+ element_stack_pop_until(treebuilder,
SELECT);
- assert(e == HUBBUB_OK);
reset_insertion_mode(treebuilder);
err = HUBBUB_REPROCESS;
}
diff --git a/src/treebuilder/in_table.c b/src/treebuilder/in_table.c
index f5ffdb2..b51fbe0 100644
--- a/src/treebuilder/in_table.c
+++ b/src/treebuilder/in_table.c
@@ -27,10 +27,7 @@ static inline void clear_stack_table_context(hubbub_treebuilder *treebuilder)
void *node;
while (type != TABLE && type != HTML) {
- hubbub_error e;
-
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -133,16 +130,14 @@ hubbub_error handle_in_table(hubbub_treebuilder *treebuilder,
err = insert_element(treebuilder, &token->data.tag,
true);
if (err != HUBBUB_OK) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
uint32_t index;
- e = formatting_list_remove(treebuilder,
+ formatting_list_remove(treebuilder,
treebuilder->context.formatting_list_end,
&ns, &type, &node, &index);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -196,12 +191,10 @@ hubbub_error handle_in_table(hubbub_treebuilder *treebuilder,
treebuilder->context.mode = IN_TABLE_BODY;
} else if (type == TABLE) {
- hubbub_error e;
/** \todo parse error */
/* This should match "</table>" handling */
- e = element_stack_pop_until(treebuilder, TABLE);
- assert(e == HUBBUB_OK);
+ element_stack_pop_until(treebuilder, TABLE);
reset_insertion_mode(treebuilder);
@@ -222,11 +215,9 @@ hubbub_error handle_in_table(hubbub_treebuilder *treebuilder,
&token->data.tag.name);
if (type == TABLE) {
- hubbub_error e;
/** \todo fragment case */
- e = element_stack_pop_until(treebuilder, TABLE);
- assert(e == HUBBUB_OK);
+ element_stack_pop_until(treebuilder, TABLE);
reset_insertion_mode(treebuilder);
} else if (type == BODY || type == CAPTION || type == COL ||
diff --git a/src/treebuilder/in_table_body.c b/src/treebuilder/in_table_body.c
index b99dd08..8d1a6ab 100644
--- a/src/treebuilder/in_table_body.c
+++ b/src/treebuilder/in_table_body.c
@@ -25,13 +25,11 @@ static void table_clear_stack(hubbub_treebuilder *treebuilder)
while (cur_node != TBODY && cur_node != TFOOT &&
cur_node != THEAD && cur_node != HTML) {
- hubbub_error e;
hubbub_ns ns;
element_type type;
void *node;
- e = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -55,7 +53,6 @@ static hubbub_error table_sub_start_or_table_end(hubbub_treebuilder *treebuilder
if (element_in_scope(treebuilder, TBODY, true) ||
element_in_scope(treebuilder, THEAD, true) ||
element_in_scope(treebuilder, TFOOT, true)) {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
@@ -65,8 +62,7 @@ static hubbub_error table_sub_start_or_table_end(hubbub_treebuilder *treebuilder
/* "Act as if an end tag with the same name as the current
* node had been seen" -- this behaviour should be identical
* to handling for (tbody/tfoot/thead) end tags in this mode */
- e = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(e == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -148,16 +144,14 @@ hubbub_error handle_in_table_body(hubbub_treebuilder *treebuilder,
/** \todo parse error */
/* Ignore the token */
} else {
- hubbub_error e;
hubbub_ns ns;
element_type otype;
void *node;
table_clear_stack(treebuilder);
- e = element_stack_pop(treebuilder, &ns,
+ element_stack_pop(treebuilder, &ns,
&otype, &node);
- assert(e == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
diff --git a/src/treebuilder/treebuilder.c b/src/treebuilder/treebuilder.c
index 9278dbc..0e7372a 100644
--- a/src/treebuilder/treebuilder.c
+++ b/src/treebuilder/treebuilder.c
@@ -618,10 +618,7 @@ hubbub_error reconstruct_active_formatting_list(hubbub_treebuilder *treebuilder)
error = element_stack_push(treebuilder, entry->details.ns,
entry->details.type, appended);
if (error != HUBBUB_OK) {
- hubbub_error err;
-
- err = remove_node_from_dom(treebuilder, appended);
- assert(err == HUBBUB_OK);
+ remove_node_from_dom(treebuilder, appended);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -668,13 +665,10 @@ cleanup:
hubbub_ns ns;
element_type type;
void *node;
- hubbub_error err;
- err = element_stack_pop(treebuilder, &ns, &type, &node);
- assert(err == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &type, &node);
- err = remove_node_from_dom(treebuilder, node);
- assert(err == HUBBUB_OK);
+ remove_node_from_dom(treebuilder, node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -737,15 +731,12 @@ void clear_active_formatting_list_to_marker(hubbub_treebuilder *treebuilder)
element_type type;
void *node;
uint32_t stack_index;
- hubbub_error error;
if (is_scoping_element(entry->details.type))
done = true;
- error = formatting_list_remove(treebuilder, entry,
+ formatting_list_remove(treebuilder, entry,
&ns, &type, &node, &stack_index);
- /* Can't fail. Ensure this. */
- assert(error == HUBBUB_OK);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -806,10 +797,7 @@ hubbub_error insert_element(hubbub_treebuilder *treebuilder,
treebuilder->context.form_element,
appended);
if (error != HUBBUB_OK) {
- hubbub_error err;
-
- err = remove_node_from_dom(treebuilder, appended);
- assert(err == HUBBUB_OK);
+ remove_node_from_dom(treebuilder, appended);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -823,10 +811,7 @@ hubbub_error insert_element(hubbub_treebuilder *treebuilder,
error = element_stack_push(treebuilder,
tag->ns, type, appended);
if (error != HUBBUB_OK) {
- hubbub_error err;
-
- err = remove_node_from_dom(treebuilder, appended);
- assert(err == HUBBUB_OK);
+ remove_node_from_dom(treebuilder, appended);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -859,7 +844,6 @@ void close_implied_end_tags(hubbub_treebuilder *treebuilder,
while (type == DD || type == DT || type == LI || type == OPTION ||
type == OPTGROUP || type == P || type == RP ||
type == RT) {
- hubbub_error error;
hubbub_ns ns;
element_type otype;
void *node;
@@ -867,8 +851,7 @@ void close_implied_end_tags(hubbub_treebuilder *treebuilder,
if (except != UNKNOWN && type == except)
break;
- error = element_stack_pop(treebuilder, &ns, &otype, &node);
- assert(error == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx,
@@ -1174,12 +1157,9 @@ hubbub_error element_stack_pop_until(hubbub_treebuilder *treebuilder,
element_type otype = UNKNOWN;
void *node;
hubbub_ns ns;
- hubbub_error error;
while (otype != type) {
- error = element_stack_pop(treebuilder, &ns, &otype, &node);
- /* No error can occur here. Ensure this. */
- assert(error == HUBBUB_OK);
+ element_stack_pop(treebuilder, &ns, &otype, &node);
treebuilder->tree_handler->unref_node(
treebuilder->tree_handler->ctx, node);