Skip to content

Commit

Permalink
ZTS fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Coggeshall committed Aug 6, 2003
1 parent ea72aab commit 4c282be
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ext/tidy/tidy.c
Expand Up @@ -136,11 +136,12 @@ void _php_tidy_mem_free(void *mem) {

void _php_tidy_mem_panic(ctmbstr errmsg) {

TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for Tidy: %s", (char *)errmsg);
}


PHPTidyObj *php_tidy_new(TSRMLS_DC) {
PHPTidyObj *php_tidy_new() {

PHPTidyObj *intern;

Expand Down Expand Up @@ -1177,7 +1178,7 @@ PHP_FUNCTION(tidy_get_body) {


zval ** tidy_property_get_ptr(zval *obj, zval *member TSRMLS_DC) {
zval **p_ptr;
zval **p_ptr = NULL;
zval *p;

/* How to fix this memleak? */
Expand All @@ -1193,7 +1194,7 @@ PHP_FUNCTION(tidy_get_body) {

zval * tidy_property_read(zval *object, zval *member, zend_bool silent TSRMLS_DC) {

PHPTidyObj *obj = php_tidy_fetch_object(object);
PHPTidyObj *obj = php_tidy_fetch_object(object TSRMLS_CC);
zval *return_value, *temp;
TidyBuffer buf;
TidyNode tempnode;
Expand Down Expand Up @@ -1341,7 +1342,7 @@ PHP_FUNCTION(tidy_get_body) {

zend_bool _php_tidy_node_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) {

PHPTidyObj *obj = php_tidy_fetch_object(getThis());
PHPTidyObj *obj = php_tidy_fetch_object(getThis() TSRMLS_CC);
zend_internal_function *func = (zend_internal_function *)EG(function_state_ptr)->function;
PHPTidyObj *newobj;
TidyNode tempnode;
Expand Down Expand Up @@ -1497,7 +1498,7 @@ zend_bool _php_tidy_node_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
} else if(!strcmp(method, "get_attr_type")) {

if(ZEND_NUM_ARGS() != 1) {
zend_wrong_param_count(TSRMLS_CC);
zend_wrong_param_count(TSRMLS_C);
return TRUE;
}

Expand Down Expand Up @@ -1542,7 +1543,7 @@ zend_bool _php_tidy_node_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)

zend_bool _php_tidy_attr_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) {

PHPTidyObj *obj = php_tidy_fetch_object(getThis());
PHPTidyObj *obj = php_tidy_fetch_object(getThis() TSRMLS_CC);
TidyAttr tempattr;

if(!strcmp(method, "next")) {
Expand All @@ -1568,7 +1569,7 @@ zend_bool _php_tidy_attr_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)

int tidy_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) {

PHPTidyObj *obj = php_tidy_fetch_object(getThis());
PHPTidyObj *obj = php_tidy_fetch_object(getThis() TSRMLS_CC);

switch(obj->type) {

Expand All @@ -1588,7 +1589,7 @@ zend_bool _php_tidy_attr_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)

int tidy_get_class_name(zval *obj, char **class_name, zend_uint *name_len, int parent TSRMLS_DC) {

PHPTidyObj *object = php_tidy_fetch_object(obj);
PHPTidyObj *object = php_tidy_fetch_object(obj TSRMLS_CC);

switch(object->type) {

Expand Down Expand Up @@ -1618,8 +1619,8 @@ zend_bool _php_tidy_attr_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)

PHPTidyObj *obj1, *obj2;

obj1 = php_tidy_fetch_object(obj_one);
obj2 = php_tidy_fetch_object(obj_two);
obj1 = php_tidy_fetch_object(obj_one TSRMLS_CC);
obj2 = php_tidy_fetch_object(obj_two TSRMLS_CC);

if( (obj1->tdoc == obj2->tdoc) &&
(obj1->node == obj2->node) &&
Expand Down

0 comments on commit 4c282be

Please sign in to comment.