Skip to content

Commit 09c0455

Browse files
committed
Consistently check zend_result in the same way
1 parent e736d7c commit 09c0455

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/tidy/tidy.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#define TIDY_FETCH_OBJECT \
5555
PHPTidyObj *obj; \
5656
zval *object; \
57-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, tidy_ce_doc) == FAILURE) { \
57+
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, tidy_ce_doc) != SUCCESS) { \
5858
RETURN_THROWS(); \
5959
} \
6060
obj = Z_TIDY_P(object); \
@@ -69,7 +69,7 @@
6969
#define TIDY_FETCH_ONLY_OBJECT \
7070
PHPTidyObj *obj; \
7171
TIDY_SET_CONTEXT; \
72-
if (zend_parse_parameters_none() == FAILURE) { \
72+
if (zend_parse_parameters_none() != SUCCESS) { \
7373
RETURN_THROWS(); \
7474
} \
7575
obj = Z_TIDY_P(object); \
@@ -1019,7 +1019,7 @@ PHP_FUNCTION(tidy_parse_string)
10191019
obj = Z_TIDY_P(return_value);
10201020

10211021
if (php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht) != SUCCESS
1022-
|| php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == FAILURE) {
1022+
|| php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) != SUCCESS) {
10231023
zval_ptr_dtor(return_value);
10241024
RETURN_FALSE;
10251025
}
@@ -1087,7 +1087,7 @@ PHP_FUNCTION(tidy_parse_file)
10871087
obj = Z_TIDY_P(return_value);
10881088

10891089
if (php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht) != SUCCESS
1090-
|| php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) {
1090+
|| php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) != SUCCESS) {
10911091
zval_ptr_dtor(return_value);
10921092
RETVAL_FALSE;
10931093
}
@@ -1141,7 +1141,7 @@ PHP_FUNCTION(tidy_diagnose)
11411141
/* {{{ Get release date (version) for Tidy library */
11421142
PHP_FUNCTION(tidy_get_release)
11431143
{
1144-
if (zend_parse_parameters_none() == FAILURE) {
1144+
if (zend_parse_parameters_none() != SUCCESS) {
11451145
RETURN_THROWS();
11461146
}
11471147

@@ -1165,7 +1165,7 @@ PHP_FUNCTION(tidy_get_opt_doc)
11651165
TidyOption opt;
11661166
zval *object;
11671167

1168-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
1168+
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, tidy_ce_doc, &optname, &optname_len) != SUCCESS) {
11691169
RETURN_THROWS();
11701170
}
11711171

@@ -1309,7 +1309,7 @@ PHP_FUNCTION(tidy_getopt)
13091309
TidyOptionType optt;
13101310
zval *object;
13111311

1312-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
1312+
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, tidy_ce_doc, &optname, &optname_len) != SUCCESS) {
13131313
RETURN_THROWS();
13141314
}
13151315

@@ -1425,7 +1425,7 @@ PHP_METHOD(tidy, parseFile)
14251425
}
14261426

14271427
if (php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht) != SUCCESS
1428-
|| php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) {
1428+
|| php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) != SUCCESS) {
14291429
RETVAL_FALSE;
14301430
} else {
14311431
RETVAL_TRUE;

0 commit comments

Comments
 (0)