summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-12-21 22:29:49 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-12-21 22:29:49 +0000
commit551ef0fa451b0a0a19e7a42cd9c1915b070ae4c9 (patch)
treec42a259daf27cb77445b95c18d8e208acf34653a /src/core
parent83f3338663c4969eebefd8c2c43bd3fc43587fdd (diff)
downloadlibdom-551ef0fa451b0a0a19e7a42cd9c1915b070ae4c9.tar.gz
libdom-551ef0fa451b0a0a19e7a42cd9c1915b070ae4c9.tar.bz2
Fix build with GCC 4.6
svn path=/trunk/libdom/; revision=13317
Diffstat (limited to 'src/core')
-rw-r--r--src/core/element.c12
-rw-r--r--src/core/node.c10
2 files changed, 3 insertions, 19 deletions
diff --git a/src/core/element.c b/src/core/element.c
index 230087a..89c62a3 100644
--- a/src/core/element.c
+++ b/src/core/element.c
@@ -541,9 +541,6 @@ dom_exception _dom_element_set_attribute_ns(struct dom_element *element,
attrs = _dom_hash_get(element->ns_attributes, namespace);
/* The element has no such namespace */
if (attrs == NULL) {
- dom_document *doc;
- doc = dom_node_get_owner(element);
- assert(doc != NULL);
attrs = _dom_hash_create(CHAINS_NS_ATTRIBUTES,
&attributes_vtable, NULL);
if (attrs == NULL)
@@ -668,9 +665,6 @@ dom_exception _dom_element_set_attribute_node_ns(struct dom_element *element,
attrs = _dom_hash_get(element->ns_attributes, namespace);
/* The element has no such namespace */
if (attrs == NULL) {
- dom_document *doc;
- doc = dom_node_get_owner(element);
- assert(doc != NULL);
attrs = _dom_hash_create(CHAINS_NS_ATTRIBUTES,
&attributes_vtable, NULL);
if (attrs == NULL)
@@ -713,9 +707,7 @@ dom_exception _dom_element_get_elements_by_tag_name_ns(
struct dom_element *element, dom_string *namespace,
dom_string *localname, struct dom_nodelist **result)
{
- dom_document *doc;
dom_exception err;
- doc = element->base.owner;
/** \todo ensure XML feature is supported */
@@ -1705,10 +1697,6 @@ dom_exception _dom_element_get_id(struct dom_element *ele, dom_string **id)
if (ele->id_ns != NULL && ele->id_name != NULL) {
/* There is user specific ID attribute */
- dom_document *doc;
- doc = dom_node_get_owner(ele);
- assert(doc != NULL);
-
err = _dom_element_get_attribute_ns(ele, ele->id_ns,
ele->id_name, &ret);
if (err != DOM_NO_ERR) {
diff --git a/src/core/node.c b/src/core/node.c
index 1c36932..34c80e0 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -332,14 +332,12 @@ dom_exception _dom_node_get_node_name(dom_node_internal *node,
dom_string **result)
{
dom_string *node_name, *temp;
- dom_document *doc;
dom_exception err;
- doc = node->owner;
/* Document Node and DocumentType Node can have no owner */
assert(node->type == DOM_DOCUMENT_TYPE_NODE ||
node->type == DOM_DOCUMENT_NODE ||
- doc != NULL);
+ node->owner != NULL);
assert(node->name != NULL);
@@ -1091,11 +1089,9 @@ dom_exception _dom_node_clone_node(dom_node_internal *node, bool deep,
{
dom_node_internal *n, *child, *r;
dom_exception err;
- dom_document *doc;
dom_user_data *ud;
- doc = node->owner;
- assert(doc != NULL);
+ assert(node->owner != NULL);
err = dom_node_copy(node, &n);
if (err != DOM_NO_ERR) {
@@ -1476,7 +1472,7 @@ dom_exception _dom_node_set_text_content(dom_node_internal *node,
/* Add the (void *) casting to avoid gcc warning:
* dereferencing type-punned pointer will break
* strict-aliasing rules */
- err = dom_node_remove_child(node, n, (void *) &r);
+ err = dom_node_remove_child(node, p, (void *) &r);
if (err != DOM_NO_ERR)
return err;
}