summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-08-08 13:45:18 (GMT)
committerIlia Alshanetsky <iliaa@php.net>2011-08-08 13:45:18 (GMT)
commit3726c5c67a5e7000b0c9c4a495eacffa5be0738f (patch)
treefe42938687ea3cc790855728866f27c9d2ee0dac /ext/dom
parentca739da4236f5c1192f75ca8c374f60216992042 (diff)
downloadphp-3726c5c67a5e7000b0c9c4a495eacffa5be0738f.tar.gz
Removal of deadcode identified by coverity
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/attr.c2
-rw-r--r--ext/dom/document.c59
-rw-r--r--ext/dom/dom_iterators.c4
-rw-r--r--ext/dom/domimplementation.c7
-rw-r--r--ext/dom/element.c24
-rw-r--r--ext/dom/namednodemap.c12
-rw-r--r--ext/dom/node.c37
-rw-r--r--ext/dom/nodelist.c4
-rw-r--r--ext/dom/php_dom.c7
-rw-r--r--ext/dom/text.c2
-rw-r--r--ext/dom/xml_common.h6
-rw-r--r--ext/dom/xpath.c6
12 files changed, 81 insertions, 89 deletions
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 6397877..4b33576 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -228,7 +228,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 393f178..e0460a0 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -261,7 +261,7 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object((xmlNodePtr) dtdptr, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object((xmlNodePtr) dtdptr, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -311,7 +311,7 @@ int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(root, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(root, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -901,7 +901,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_element)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
dom_object *intern;
@@ -924,7 +924,7 @@ PHP_FUNCTION(dom_document_create_element)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_element */
@@ -934,7 +934,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_document_fragment)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
dom_object *intern;
@@ -951,7 +951,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_document_fragment */
@@ -961,7 +961,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_text_node)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
int ret, value_len;
@@ -979,7 +979,7 @@ PHP_FUNCTION(dom_document_create_text_node)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_text_node */
@@ -989,7 +989,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_comment)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
int ret, value_len;
@@ -1007,7 +1007,7 @@ PHP_FUNCTION(dom_document_create_comment)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_comment */
@@ -1017,7 +1017,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_cdatasection)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
int ret, value_len;
@@ -1035,7 +1035,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_cdatasection */
@@ -1045,7 +1045,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_processing_instruction)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp;
int ret, value_len, name_len = 0;
@@ -1070,7 +1070,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
node->doc = docp;
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_document_create_processing_instruction */
@@ -1080,7 +1080,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_attribute)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlAttrPtr node;
xmlDocPtr docp;
int ret, name_len;
@@ -1103,7 +1103,7 @@ PHP_FUNCTION(dom_document_create_attribute)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) node, &ret, intern);
}
/* }}} end dom_document_create_attribute */
@@ -1114,7 +1114,7 @@ Since:
*/
PHP_FUNCTION(dom_document_create_entity_reference)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *node;
xmlDocPtr docp = NULL;
dom_object *intern;
@@ -1137,7 +1137,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) node, &ret, intern);
}
/* }}} end dom_document_create_entity_reference */
@@ -1173,7 +1173,6 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_document_import_node)
{
- zval *rv = NULL;
zval *id, *node;
xmlDocPtr docp;
xmlNodePtr nodep, retnodep;
@@ -1219,7 +1218,7 @@ PHP_FUNCTION(dom_document_import_node)
}
}
- DOM_RET_OBJ(rv, (xmlNodePtr) retnodep, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) retnodep, &ret, intern);
}
/* }}} end dom_document_import_node */
@@ -1229,7 +1228,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_document_create_element_ns)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlDocPtr docp;
xmlNodePtr nodep = NULL;
xmlNsPtr nsptr = NULL;
@@ -1282,7 +1281,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
nodep->ns = nsptr;
- DOM_RET_OBJ(rv, nodep, &ret, intern);
+ DOM_RET_OBJ(nodep, &ret, intern);
}
/* }}} end dom_document_create_element_ns */
@@ -1292,7 +1291,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_document_create_attribute_ns)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlDocPtr docp;
xmlNodePtr nodep = NULL, root;
xmlNsPtr nsptr;
@@ -1347,7 +1346,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, nodep, &ret, intern);
+ DOM_RET_OBJ(nodep, &ret, intern);
}
/* }}} end dom_document_create_attribute_ns */
@@ -1384,7 +1383,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_document_get_element_by_id)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlDocPtr docp;
xmlAttrPtr attrp;
int ret, idname_len;
@@ -1400,7 +1399,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
attrp = xmlGetID(docp, (xmlChar *) idname);
if (attrp && attrp->parent) {
- DOM_RET_OBJ(rv, (xmlNodePtr) attrp->parent, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) attrp->parent, &ret, intern);
} else {
RETVAL_NULL();
}
@@ -1662,7 +1661,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int sourc
/* {{{ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) */
static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
- zval *id, *rv = NULL;
+ zval *id;
xmlDoc *docp = NULL, *newdoc;
dom_doc_propsptr doc_prop;
dom_object *intern;
@@ -1714,7 +1713,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
RETURN_TRUE;
} else {
- DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL);
+ DOM_RET_OBJ((xmlNodePtr) newdoc, &ret, NULL);
}
}
/* }}} end dom_parser_document */
@@ -2152,7 +2151,7 @@ PHP_FUNCTION(dom_document_relaxNG_validate_xml)
static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
- zval *id, *rv = NULL;
+ zval *id;
xmlDoc *docp = NULL, *newdoc;
dom_object *intern;
dom_doc_propsptr doc_prop;
@@ -2225,7 +2224,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
RETURN_TRUE;
} else {
- DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL);
+ DOM_RET_OBJ((xmlNodePtr) newdoc, &ret, NULL);
}
}
/* }}} */
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 35fedc8..72b6b03 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -251,7 +251,7 @@ err:
zval_ptr_dtor((zval**)&curobj);
if (curnode) {
MAKE_STD_ZVAL(curattr);
- curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC);
+ curattr = php_dom_create_object(curnode, &ret, curattr, objmap->baseobj TSRMLS_CC);
}
iterator->curobj = curattr;
@@ -330,7 +330,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
err:
if (curnode) {
MAKE_STD_ZVAL(curattr);
- curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC);
+ curattr = php_dom_create_object(curnode, &ret, curattr, objmap->baseobj TSRMLS_CC);
}
iterator->curobj = curattr;
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index c7ad1d7..a130cf4 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -91,7 +91,6 @@ Since: DOM Level 2
*/
PHP_METHOD(domimplementation, createDocumentType)
{
- zval *rv = NULL;
xmlDtd *doctype;
int ret, name_len = 0, publicid_len = 0, systemid_len = 0;
char *name = NULL, *publicid = NULL, *systemid = NULL;
@@ -141,7 +140,7 @@ PHP_METHOD(domimplementation, createDocumentType)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, (xmlNodePtr) doctype, &ret, NULL);
+ DOM_RET_OBJ((xmlNodePtr) doctype, &ret, NULL);
}
/* }}} end dom_domimplementation_create_document_type */
@@ -151,7 +150,7 @@ Since: DOM Level 2
*/
PHP_METHOD(domimplementation, createDocument)
{
- zval *node = NULL, *rv = NULL;
+ zval *node = NULL;
xmlDoc *docp;
xmlNode *nodep;
xmlDtdPtr doctype = NULL;
@@ -238,7 +237,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlFree(localname);
}
- DOM_RET_OBJ(rv, (xmlNodePtr) docp, &ret, NULL);
+ DOM_RET_OBJ((xmlNodePtr) docp, &ret, NULL);
if (doctobj != NULL) {
doctobj->document = ((dom_object *)((php_libxml_node_ptr *)docp->_private)->_private)->document;
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 66ad2af..5003e50 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -371,7 +371,7 @@ Since:
*/
PHP_FUNCTION(dom_element_set_attribute)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNode *nodep;
xmlNodePtr attr = NULL;
int ret, name_len, value_len, name_valid;
@@ -426,7 +426,7 @@ PHP_FUNCTION(dom_element_set_attribute)
RETURN_FALSE;
}
- DOM_RET_OBJ(rv, attr, &ret, intern);
+ DOM_RET_OBJ(attr, &ret, intern);
}
/* }}} end dom_element_set_attribute */
@@ -485,7 +485,7 @@ Since:
*/
PHP_FUNCTION(dom_element_get_attribute_node)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNodePtr nodep, attrp;
int name_len, ret;
dom_object *intern;
@@ -521,7 +521,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
attrp->ns = curns;
}
- DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
}
/* }}} end dom_element_get_attribute_node */
@@ -531,7 +531,7 @@ Since:
*/
PHP_FUNCTION(dom_element_set_attribute_node)
{
- zval *id, *node, *rv = NULL;
+ zval *id, *node;
xmlNode *nodep;
xmlAttr *attrp, *existattrp = NULL;
dom_object *intern, *attrobj, *oldobj;
@@ -583,7 +583,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
/* Returns old property if removed otherwise NULL */
if (existattrp != NULL) {
- DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) existattrp, &ret, intern);
} else {
RETVAL_NULL();
}
@@ -597,7 +597,7 @@ Since:
*/
PHP_FUNCTION(dom_element_remove_attribute_node)
{
- zval *id, *node, *rv = NULL;
+ zval *id, *node;
xmlNode *nodep;
xmlAttr *attrp;
dom_object *intern, *attrobj;
@@ -623,7 +623,7 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
xmlUnlinkNode((xmlNodePtr) attrp);
- DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
}
/* }}} end dom_element_remove_attribute_node */
@@ -925,7 +925,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_element_get_attribute_node_ns)
{
- zval *id, *rv = NULL;
+ zval *id;
xmlNodePtr elemp;
xmlAttrPtr attrp;
dom_object *intern;
@@ -944,7 +944,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
RETURN_NULL();
}
- DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
}
/* }}} end dom_element_get_attribute_node_ns */
@@ -955,7 +955,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_element_set_attribute_node_ns)
{
- zval *id, *node, *rv = NULL;
+ zval *id, *node;
xmlNode *nodep;
xmlNs *nsp;
xmlAttr *attrp, *existattrp = NULL;
@@ -1014,7 +1014,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
/* Returns old property if removed otherwise NULL */
if (existattrp != NULL) {
- DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern);
+ DOM_RET_OBJ((xmlNodePtr) existattrp, &ret, intern);
} else {
RETVAL_NULL();
}
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index 963371a..87842f8 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -126,7 +126,7 @@ Since:
*/
PHP_FUNCTION(dom_namednodemap_get_named_item)
{
- zval *id, *rv = NULL;
+ zval *id;
int ret, namedlen=0;
dom_object *intern;
xmlNodePtr itemnode = NULL;
@@ -166,7 +166,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
}
if (itemnode) {
- DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj);
+ DOM_RET_OBJ(itemnode, &ret, objmap->baseobj);
return;
} else {
RETVAL_NULL();
@@ -200,7 +200,7 @@ Since:
*/
PHP_FUNCTION(dom_namednodemap_item)
{
- zval *id, *rv = NULL;
+ zval *id;
long index;
int ret;
dom_object *intern;
@@ -243,7 +243,7 @@ PHP_FUNCTION(dom_namednodemap_item)
}
if (itemnode) {
- DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj);
+ DOM_RET_OBJ(itemnode, &ret, objmap->baseobj);
return;
}
}
@@ -258,7 +258,7 @@ Since: DOM Level 2
*/
PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
{
- zval *id, *rv = NULL;
+ zval *id;
int ret, namedlen=0, urilen=0;
dom_object *intern;
xmlNodePtr itemnode = NULL;
@@ -298,7 +298,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
}
if (itemnode) {
- DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj);
+ DOM_RET_OBJ(itemnode, &ret, objmap->baseobj);
return;
} else {
RETVAL_NULL();
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 839c797..690c887 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -429,7 +429,7 @@ int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -498,7 +498,7 @@ int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(first, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(first, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -535,7 +535,7 @@ int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(last, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(last, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -569,7 +569,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
return SUCCESS;
}
- if (NULL == (*retval = php_dom_create_object(prevsib, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(prevsib, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -602,7 +602,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
- if (NULL == (*retval = php_dom_create_object(nextsib, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object(nextsib, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -674,7 +674,7 @@ int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
- if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -998,7 +998,7 @@ Since:
*/
PHP_FUNCTION(dom_node_insert_before)
{
- zval *id, *node, *ref = NULL, *rv = NULL;
+ zval *id, *node, *ref = NULL;
xmlNodePtr child, new_child, parentp, refp;
dom_object *intern, *childobj, *refpobj;
int ret, stricterror;
@@ -1087,7 +1087,7 @@ PHP_FUNCTION(dom_node_insert_before)
xmlUnlinkNode((xmlNodePtr) lastattr);
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
} else {
- DOM_RET_OBJ(rv, child, &ret, intern);
+ DOM_RET_OBJ(child, &ret, intern);
return;
}
}
@@ -1129,7 +1129,7 @@ PHP_FUNCTION(dom_node_insert_before)
xmlUnlinkNode((xmlNodePtr) lastattr);
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
} else {
- DOM_RET_OBJ(rv, child, &ret, intern);
+ DOM_RET_OBJ(child, &ret, intern);
return;
}
}
@@ -1148,7 +1148,7 @@ PHP_FUNCTION(dom_node_insert_before)
dom_reconcile_ns(parentp->doc, new_child);
- DOM_RET_OBJ(rv, new_child, &ret, intern);
+ DOM_RET_OBJ(new_child, &ret, intern);
}
/* }}} end dom_node_insert_before */
@@ -1212,9 +1212,6 @@ PHP_FUNCTION(dom_node_replace_child)
}
if (foundoldchild) {
- xmlNodePtr node;
- zval *rv = NULL;
-
if (newchild->type == XML_DOCUMENT_FRAG_NODE) {
xmlNodePtr prevsib, nextsib;
prevsib = oldchild->prev;
@@ -1232,10 +1229,10 @@ PHP_FUNCTION(dom_node_replace_child)
newchildobj->document = intern->document;
php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL TSRMLS_CC);
}
- node = xmlReplaceNode(oldchild, newchild);
+ xmlReplaceNode(oldchild, newchild);
dom_reconcile_ns(nodep->doc, newchild);
}
- DOM_RET_OBJ(rv, oldchild, &ret, intern);
+ DOM_RET_OBJ(oldchild, &ret, intern);
return;
} else {
php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
@@ -1283,9 +1280,8 @@ PHP_FUNCTION(dom_node_remove_child)
while (children) {
if (children == child) {
- zval *rv = NULL;
xmlUnlinkNode(child);
- DOM_RET_OBJ(rv, child, &ret, intern);
+ DOM_RET_OBJ(child, &ret, intern);
return;
}
children = children->next;
@@ -1302,7 +1298,7 @@ Since:
*/
PHP_FUNCTION(dom_node_append_child)
{
- zval *id, *node, *rv = NULL;
+ zval *id, *node;
xmlNodePtr child, nodep, new_child = NULL;
dom_object *intern, *childobj;
int ret, stricterror;
@@ -1393,7 +1389,7 @@ PHP_FUNCTION(dom_node_append_child)
dom_reconcile_ns(nodep->doc, new_child);
- DOM_RET_OBJ(rv, new_child, &ret, intern);
+ DOM_RET_OBJ(new_child, &ret, intern);
}
/* }}} end dom_node_append_child */
@@ -1431,7 +1427,6 @@ Since:
*/
PHP_FUNCTION(dom_node_clone_node)
{
- zval *rv = NULL;
zval *id;
xmlNode *n, *node;
int ret;
@@ -1483,7 +1478,7 @@ PHP_FUNCTION(dom_node_clone_node)
intern = NULL;
}
- DOM_RET_OBJ(rv, node, &ret, intern);
+ DOM_RET_OBJ(node, &ret, intern);
}
/* }}} end dom_node_clone_node */
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index f7d7d15..5b968c0 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -104,7 +104,7 @@ Since:
*/
PHP_FUNCTION(dom_nodelist_item)
{
- zval *id, *rv = NULL;
+ zval *id;
long index;
int ret;
dom_object *intern;
@@ -163,7 +163,7 @@ PHP_FUNCTION(dom_nodelist_item)
}
if (itemnode) {
- DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj);
+ DOM_RET_OBJ(itemnode, &ret, objmap->baseobj);
return;
}
}
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index afbf1b9..88726c7 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -212,7 +212,7 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece,
zend_hash_init(doc_props->classmap, 0, NULL, NULL, 0);
}
if (ce) {
- return zend_hash_update(doc_props->classmap, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL);
+ return zend_hash_update(doc_props->classmap, basece->name, basece->name_length + 1, &ce, sizeof(zend_class_entry *), NULL);
} else {
zend_hash_del(doc_props->classmap, basece->name, basece->name_length + 1);
}
@@ -484,7 +484,6 @@ void *php_dom_export_node(zval *object TSRMLS_DC) /* {{{ */
Get a simplexml_element object from dom to allow for processing */
PHP_FUNCTION(dom_import_simplexml)
{
- zval *rv = NULL;
zval *node;
xmlNodePtr nodep = NULL;
php_libxml_node_object *nodeobj;
@@ -498,7 +497,7 @@ PHP_FUNCTION(dom_import_simplexml)
nodep = php_libxml_import_node(node TSRMLS_CC);
if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) {
- DOM_RET_OBJ(rv, (xmlNodePtr) nodep, &ret, (dom_object *)nodeobj);
+ DOM_RET_OBJ((xmlNodePtr) nodep, &ret, (dom_object *)nodeobj);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
RETURN_NULL();
@@ -1233,7 +1232,7 @@ void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) /* {{{
/* }}} */
/* {{{ php_dom_create_object */
-PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wrapper_in, zval *return_value, dom_object *domobj TSRMLS_DC)
+PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *return_value, dom_object *domobj TSRMLS_DC)
{
zval *wrapper;
zend_class_entry *ce;
diff --git a/ext/dom/text.c b/ext/dom/text.c
index b418345..b175e57 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -196,7 +196,7 @@ PHP_FUNCTION(dom_text_split_text)
nnode->type = XML_TEXT_NODE;
}
- return_value = php_dom_create_object(nnode, &ret, NULL, return_value, intern TSRMLS_CC);
+ return_value = php_dom_create_object(nnode, &ret, return_value, intern TSRMLS_CC);
}
/* }}} end dom_text_split_text */
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index 075d9ff..1f47eb6 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -54,7 +54,7 @@ typedef struct _dom_object {
PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry;
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj);
-PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *in, zval* return_value, dom_object *domobj TSRMLS_DC);
+PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval* return_value, dom_object *domobj TSRMLS_DC);
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define DOM_XMLNS_NAMESPACE \
@@ -78,8 +78,8 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
} \
}
-#define DOM_RET_OBJ(zval, obj, ret, domobject) \
- if (NULL == (zval = php_dom_create_object(obj, ret, zval, return_value, domobject TSRMLS_CC))) { \
+#define DOM_RET_OBJ(obj, ret, domobject) \
+ if (!php_dom_create_object(obj, ret, return_value, domobject TSRMLS_CC)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
RETURN_FALSE; \
}
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index ba2b972..251f2f7 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -164,7 +164,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
node->parent = nsparent;
node->ns = curns;
}
- child = php_dom_create_object(node, &ret, NULL, child, (dom_object *)intern TSRMLS_CC);
+ child = php_dom_create_object(node, &ret, child, (dom_object *)intern TSRMLS_CC);
add_next_index_zval(args[i], child);
}
}
@@ -329,7 +329,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
}
ALLOC_ZVAL(*retval);
- if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
+ if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
@@ -492,7 +492,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
node->parent = nsparent;
node->ns = curns;
}
- child = php_dom_create_object(node, &ret, NULL, child, (dom_object *)intern TSRMLS_CC);
+ child = php_dom_create_object(node, &ret, child, (dom_object *)intern TSRMLS_CC);
add_next_index_zval(retval, child);
}
}