summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-11-15 19:54:19 +0300
committerDmitry Stogov <dmitry@zend.com>2018-11-15 19:54:19 +0300
commit0f7f1498be549f5988bf9d8150f35bedf70741c5 (patch)
treeb9cada88f6a43fbcf2b1316ed8386a3249b0fa4a /ext/simplexml
parent8f2f80668e6988ac8907920d177e531a98dcb8b0 (diff)
downloadphp-git-0f7f1498be549f5988bf9d8150f35bedf70741c5.tar.gz
Use ZEND_THIS macro to hide implementation details in extensions code.
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/simplexml.c28
-rw-r--r--ext/simplexml/sxe.c14
2 files changed, 21 insertions, 21 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 37dc604d51..15618244ff 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1293,7 +1293,7 @@ SXE_METHOD(xpath)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* attributes don't have attributes */
@@ -1378,7 +1378,7 @@ SXE_METHOD(registerXPathNamespace)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
if (!sxe->xpath) {
sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
}
@@ -1412,7 +1412,7 @@ SXE_METHOD(asXML)
RETURN_FALSE;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@@ -1441,7 +1441,7 @@ SXE_METHOD(asXML)
}
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@@ -1543,7 +1543,7 @@ SXE_METHOD(getNamespaces)
array_init(return_value);
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@@ -1590,7 +1590,7 @@ SXE_METHOD(getDocNamespaces)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
if(from_root){
node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr);
}else{
@@ -1620,7 +1620,7 @@ SXE_METHOD(children)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* attributes don't have attributes */
@@ -1642,7 +1642,7 @@ SXE_METHOD(getName)
xmlNodePtr node;
int namelen;
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@@ -1669,7 +1669,7 @@ SXE_METHOD(attributes)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
@@ -1703,7 +1703,7 @@ SXE_METHOD(addChild)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
@@ -1769,7 +1769,7 @@ SXE_METHOD(addAttribute)
return;
}
- sxe = Z_SXEOBJ_P(&EX(This));
+ sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@@ -1921,7 +1921,7 @@ static int sxe_object_cast(zval *readobj, zval *writeobj, int type)
Returns the string content */
SXE_METHOD(__toString)
{
- if (sxe_object_cast_ex(&EX(This), return_value, IS_STRING) != SUCCESS) {
+ if (sxe_object_cast_ex(ZEND_THIS, return_value, IS_STRING) != SUCCESS) {
zval_ptr_dtor(return_value);
RETURN_EMPTY_STRING();
}
@@ -1978,7 +1978,7 @@ static int sxe_count_elements(zval *object, zend_long *count) /* {{{ */
SXE_METHOD(count)
{
zend_long count = 0;
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -2255,7 +2255,7 @@ PHP_FUNCTION(simplexml_load_string)
SimpleXMLElement constructor */
SXE_METHOD(__construct)
{
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
char *data, *ns = NULL;
size_t data_len, ns_len = 0;
xmlDocPtr docp;
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index 290ae9d849..362f43a3d2 100644
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -43,7 +43,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
return;
}
- php_sxe_rewind_iterator(Z_SXEOBJ_P(&EX(This)));
+ php_sxe_rewind_iterator(Z_SXEOBJ_P(ZEND_THIS));
}
/* }}} */
@@ -51,7 +51,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
Check whether iteration is valid */
PHP_METHOD(ce_SimpleXMLIterator, valid)
{
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -65,7 +65,7 @@ PHP_METHOD(ce_SimpleXMLIterator, valid)
Get current element */
PHP_METHOD(ce_SimpleXMLIterator, current)
{
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
@@ -87,7 +87,7 @@ PHP_METHOD(ce_SimpleXMLIterator, key)
{
xmlNodePtr curnode;
php_sxe_object *intern;
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -115,7 +115,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
return;
}
- php_sxe_move_forward_iterator(Z_SXEOBJ_P(&EX(This)));
+ php_sxe_move_forward_iterator(Z_SXEOBJ_P(ZEND_THIS));
}
/* }}} */
@@ -123,7 +123,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
Check whether element has children (elements) */
PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
{
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
php_sxe_object *child;
xmlNodePtr node;
@@ -151,7 +151,7 @@ PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
Get child element iterator */
PHP_METHOD(ce_SimpleXMLIterator, getChildren)
{
- php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
zval *data;
if (zend_parse_parameters_none() == FAILURE) {