Skip to content

Commit c5f091e

Browse files
committed
Remove DOM_GET_THIS macro
This macro is trivial, it's more obvious to use ZEND_THIS directly.
1 parent f5c1359 commit c5f091e

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

ext/dom/xml_common.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
8181
#define DOM_RET_OBJ(obj, ret, domobject) \
8282
*ret = php_dom_create_object(obj, return_value, domobject)
8383

84-
#define DOM_GET_THIS(zval) \
85-
do { zval = ZEND_THIS; } while (0)
86-
8784
#define DOM_GET_THIS_OBJ(__ptr, __id, __prtype, __intern) \
88-
DOM_GET_THIS(__id); \
85+
__id = ZEND_THIS; \
8986
DOM_GET_OBJ(__ptr, __id, __prtype, __intern);
9087

9188
#endif

ext/dom/xpath.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,11 @@ PHP_METHOD(domxpath, evaluate)
503503
/* {{{ proto void dom_xpath_register_php_functions() */
504504
PHP_METHOD(domxpath, registerPhpFunctions)
505505
{
506-
zval *id;
506+
zval *id = ZEND_THIS;
507507
dom_xpath_object *intern;
508508
zval *array_value, *entry, new_string;
509509
zend_string *name;
510510

511-
DOM_GET_THIS(id);
512-
513511
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
514512
intern = Z_XPATHOBJ_P(id);
515513
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {

ext/xsl/xsltprocessor.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,12 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
745745
PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
746746
{
747747

748-
zval *id;
748+
zval *id = ZEND_THIS;
749749
zval *array_value, *entry, new_string;
750750
xsl_object *intern;
751751
char *namespace;
752752
size_t namespace_len;
753753
zend_string *string_key, *name, *value;
754-
DOM_GET_THIS(id);
755754

756755
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
757756
intern = Z_XSL_P(id);
@@ -790,15 +789,13 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
790789
*/
791790
PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
792791
{
793-
zval *id;
792+
zval *id = ZEND_THIS;
794793
char *namespace;
795794
size_t namespace_len = 0;
796795
zval *value;
797796
zend_string *name;
798797
xsl_object *intern;
799798

800-
DOM_GET_THIS(id);
801-
802799
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
803800
RETURN_THROWS();
804801
}
@@ -815,14 +812,12 @@ PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
815812
*/
816813
PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
817814
{
818-
zval *id;
815+
zval *id = ZEND_THIS;
819816
size_t namespace_len = 0;
820817
char *namespace;
821818
zend_string *name;
822819
xsl_object *intern;
823820

824-
DOM_GET_THIS(id);
825-
826821
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
827822
RETURN_THROWS();
828823
}
@@ -839,13 +834,11 @@ PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
839834
*/
840835
PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
841836
{
842-
zval *id;
837+
zval *id = ZEND_THIS;
843838
xsl_object *intern;
844839
zval *array_value, *entry, new_string;
845840
zend_string *name;
846841

847-
DOM_GET_THIS(id);
848-
849842
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
850843
intern = Z_XSL_P(id);
851844

@@ -878,11 +871,10 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
878871
/* {{{ proto bool xsl_xsltprocessor_set_profiling(string filename) */
879872
PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
880873
{
881-
zval *id;
874+
zval *id = ZEND_THIS;
882875
xsl_object *intern;
883876
char *filename = NULL;
884877
size_t filename_len;
885-
DOM_GET_THIS(id);
886878

887879
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p!", &filename, &filename_len) == SUCCESS) {
888880
intern = Z_XSL_P(id);
@@ -904,11 +896,10 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
904896
/* {{{ proto int xsl_xsltprocessor_set_security_prefs(int securityPrefs) */
905897
PHP_FUNCTION(xsl_xsltprocessor_set_security_prefs)
906898
{
907-
zval *id;
899+
zval *id = ZEND_THIS;
908900
xsl_object *intern;
909901
zend_long securityPrefs, oldSecurityPrefs;
910902

911-
DOM_GET_THIS(id);
912903
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &securityPrefs) == FAILURE) {
913904
RETURN_THROWS();
914905
}
@@ -924,10 +915,9 @@ PHP_FUNCTION(xsl_xsltprocessor_set_security_prefs)
924915
/* {{{ proto int xsl_xsltprocessor_get_security_prefs() */
925916
PHP_FUNCTION(xsl_xsltprocessor_get_security_prefs)
926917
{
927-
zval *id;
918+
zval *id = ZEND_THIS;
928919
xsl_object *intern;
929920

930-
DOM_GET_THIS(id);
931921
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "") == SUCCESS) {
932922
intern = Z_XSL_P(id);
933923
RETURN_LONG(intern->securityPrefs);

0 commit comments

Comments
 (0)