Skip to content

Commit b7db5c8

Browse files
committed
ext/tidy: Remove TIDY_SET_CONTEXT macro
1 parent d40e320 commit b7db5c8

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

ext/tidy/tidy.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050
/* {{{ ext/tidy macros */
5151
#define FIX_BUFFER(bptr) do { if ((bptr)->size) { (bptr)->bp[(bptr)->size-1] = '\0'; } } while(0)
5252

53-
#define TIDY_SET_CONTEXT \
54-
zval *object = getThis();
55-
5653
#define TIDY_FETCH_OBJECT \
5754
PHPTidyObj *obj; \
5855
zval *object; \
@@ -70,11 +67,10 @@
7067

7168
#define TIDY_FETCH_ONLY_OBJECT \
7269
PHPTidyObj *obj; \
73-
TIDY_SET_CONTEXT; \
7470
if (zend_parse_parameters_none() != SUCCESS) { \
7571
RETURN_THROWS(); \
7672
} \
77-
obj = Z_TIDY_P(object); \
73+
obj = Z_TIDY_P(ZEND_THIS); \
7874

7975
#define TIDY_SET_DEFAULT_CONFIG(_doc) \
8076
if (TG(default_config) && TG(default_config)[0]) { \
@@ -1368,8 +1364,7 @@ PHP_METHOD(tidy, __construct)
13681364
Z_PARAM_BOOL(use_include_path)
13691365
ZEND_PARSE_PARAMETERS_END();
13701366

1371-
TIDY_SET_CONTEXT;
1372-
obj = Z_TIDY_P(object);
1367+
obj = Z_TIDY_P(ZEND_THIS);
13731368

13741369
if (inputfile) {
13751370
if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
@@ -1415,8 +1410,7 @@ PHP_METHOD(tidy, parseFile)
14151410
Z_PARAM_BOOL(use_include_path)
14161411
ZEND_PARSE_PARAMETERS_END();
14171412

1418-
TIDY_SET_CONTEXT;
1419-
obj = Z_TIDY_P(object);
1413+
obj = Z_TIDY_P(ZEND_THIS);
14201414

14211415
if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
14221416
php_error_docref(NULL, E_WARNING, "Cannot load \"%s\" into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (using include path)" : "");
@@ -1455,8 +1449,7 @@ PHP_METHOD(tidy, parseString)
14551449
RETURN_THROWS();
14561450
}
14571451

1458-
TIDY_SET_CONTEXT;
1459-
obj = Z_TIDY_P(object);
1452+
obj = Z_TIDY_P(ZEND_THIS);
14601453

14611454
RETURN_BOOL(php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht, 2) == SUCCESS
14621455
&& php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == SUCCESS);

0 commit comments

Comments
 (0)