From 447585d028eb275b5f6eb1cea8627a01a64886eb Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 1 Sep 2014 10:59:21 +0200 Subject: gcc2 fixes. --- src/html/html_collection.c | 2 +- src/html/html_table_element.c | 35 ++++++++++++++++++----------------- src/html/html_tablecell_element.c | 3 ++- src/html/html_tablerow_element.c | 3 ++- 4 files changed, 23 insertions(+), 20 deletions(-) (limited to 'src/html') diff --git a/src/html/html_collection.c b/src/html/html_collection.c index 43a26c5..90e35a0 100644 --- a/src/html/html_collection.c +++ b/src/html/html_collection.c @@ -219,6 +219,7 @@ dom_exception dom_html_collection_named_item(dom_html_collection *col, if (n->type == DOM_ELEMENT_NODE && col->ic(n, col->ctx) == true) { dom_string *id = NULL; + dom_string *id_name = NULL; err = _dom_element_get_id((struct dom_element *) n, &id); @@ -238,7 +239,6 @@ dom_exception dom_html_collection_named_item(dom_html_collection *col, dom_string_unref(id); /* Check for Name attr if id not matched/found */ - dom_string *id_name = NULL; err = _dom_element_get_attribute((dom_element *)n, doc->memoised[hds_name], &id_name); if(err != DOM_NO_ERR) { diff --git a/src/html/html_table_element.c b/src/html/html_table_element.c index db1e5e0..d387e8d 100644 --- a/src/html/html_table_element.c +++ b/src/html/html_table_element.c @@ -207,10 +207,12 @@ dom_exception dom_html_table_element_set_caption( dom_node_internal *check_node = ((dom_node_internal *)caption); dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner); dom_exception exp; - if(check_node == NULL) { + dom_node *new_caption; + + if (check_node == NULL) { return DOM_HIERARCHY_REQUEST_ERR; } - if(!dom_string_caseless_isequal(doc->memoised[hds_CAPTION], + if (!dom_string_caseless_isequal(doc->memoised[hds_CAPTION], check_node->name)) { return DOM_HIERARCHY_REQUEST_ERR; } @@ -220,8 +222,6 @@ dom_exception dom_html_table_element_set_caption( return exp; /* Create a new caption */ - dom_node *new_caption; - return dom_node_append_child(table, caption, &new_caption); } @@ -262,6 +262,7 @@ dom_exception dom_html_table_element_set_t_head( dom_node_internal *check_node = ((dom_node_internal *)t_head); dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner); dom_exception exp; + dom_node *new_t_head; if (check_node == NULL) { return DOM_HIERARCHY_REQUEST_ERR; @@ -274,8 +275,6 @@ dom_exception dom_html_table_element_set_t_head( if(exp != DOM_NO_ERR) return exp; - dom_node *new_t_head; - return dom_node_append_child(table, t_head, &new_t_head); @@ -318,6 +317,7 @@ dom_exception dom_html_table_element_set_t_foot( dom_node_internal *check_node = ((dom_node_internal *)t_foot); /*< temporary node to check for raised exceptions */ dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner); dom_exception exp; + dom_node *new_t_foot; if(check_node == NULL) { return DOM_HIERARCHY_REQUEST_ERR; @@ -331,8 +331,6 @@ dom_exception dom_html_table_element_set_t_foot( if(exp != DOM_NO_ERR) return exp; - dom_node *new_t_foot; - return dom_node_append_child(table, t_foot, &new_t_foot); @@ -728,14 +726,15 @@ dom_exception dom_html_table_element_insert_row( *row = (dom_html_element *)new_row; } } else { + uint32_t window_len = 0, section_len; + dom_html_table_section_element *t_head; + dom_html_table_section_element *t_foot; + dom_node_internal *n; + if(index ==-1) { index = (int32_t)len; } - dom_html_table_section_element *t_head; - dom_html_table_section_element *t_foot; - uint32_t window_len = 0, section_len; - exp = dom_html_table_element_get_t_head(element, &t_head); if (exp != DOM_NO_ERR) return exp; @@ -763,7 +762,7 @@ dom_exception dom_html_table_element_insert_row( window_len += section_len; - dom_node_internal *n = (dom_node_internal *)element; + n = (dom_node_internal *)element; dom_html_collection_unref(rows); @@ -846,15 +845,17 @@ dom_exception dom_html_table_element_delete_row( dom_html_collection_unref(rows); return DOM_INDEX_SIZE_ERR; } else { + uint32_t window_len = 0, section_len; + dom_html_table_section_element *t_head; + dom_html_table_section_element *t_foot; + dom_node_internal *n; + if(index ==-1) { index = (int32_t)len-1; } dom_html_collection_unref(rows); - dom_html_table_section_element *t_head; - dom_html_table_section_element *t_foot; - uint32_t window_len = 0, section_len; exp = dom_html_table_element_get_t_head(element, &t_head); if(exp != DOM_NO_ERR) return exp; @@ -876,7 +877,7 @@ dom_exception dom_html_table_element_delete_row( index-window_len); } window_len += section_len; - dom_node_internal *n = (dom_node_internal *)element; + n = (dom_node_internal *)element; for (n = n->first_child; n != NULL; n = n->next) { if((n->type == DOM_ELEMENT_NODE) && diff --git a/src/html/html_tablecell_element.c b/src/html/html_tablecell_element.c index 83ebb0c..403e796 100644 --- a/src/html/html_tablecell_element.c +++ b/src/html/html_tablecell_element.c @@ -183,13 +183,14 @@ dom_exception dom_html_table_cell_element_get_cell_index( dom_node_internal *n = ((dom_node_internal *)table_cell)->parent; dom_html_document *doc = (dom_html_document *)(n->owner); int32_t cnt = 0; + dom_node_internal *root; while(n != NULL) { if(dom_string_caseless_isequal(doc->memoised[hds_TR],n->name)) { break; } n = n->parent; } - dom_node_internal *root = n; + root = n; while(n != NULL) { if(n == (dom_node_internal *)table_cell) { break; diff --git a/src/html/html_tablerow_element.c b/src/html/html_tablerow_element.c index 0e4c3a8..e4d3514 100644 --- a/src/html/html_tablerow_element.c +++ b/src/html/html_tablerow_element.c @@ -201,9 +201,10 @@ dom_exception dom_html_table_row_element_get_row_index( (dom_string_caseless_isequal(parent->name, doc->memoised[hds_TBODY]) || dom_string_caseless_isequal(parent->name, doc->memoised[hds_TFOOT]))) { uint32_t len; - n = parent->parent; dom_html_table_section_element *t_head; dom_html_collection *rows; + + n = parent->parent; exp = dom_html_table_element_get_t_head( (dom_html_table_element *)(parent->parent), &t_head); -- cgit v1.2.3