com php-src: cleanup: ext/reflection/php_reflection.c mai n/network.c
| From: | Dmitry Stogov | Date: | Wed, 13 Aug 2014 08:36:10 +0000 |
| Subject: | com php-src: cleanup: ext/reflection/php_reflection.c mai n/network.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79826@lists.php.net to get a copy of this message | ||
Commit: b8517e410ce4209d05f911d35d9ec77a2cc191c9
Author: Dmitry Stogov <dmitry@zend.com> Wed, 13 Aug 2014 12:36:10 +0400
Parents: da3aeeed39f24e34e9318d7123ff84f0c5a98e61
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b8517e410ce4209d05f911d35d9ec77a2cc191c9
Log:
cleanup
Changed paths:
M ext/reflection/php_reflection.c
M main/network.c
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index fd7569b..4248de8 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1799,8 +1799,7 @@ ZEND_METHOD(reflection_function, getFileName)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
-// TODO: we have to duplicate it, becaise it may be in opcache SHM ???
- RETURN_STR(STR_DUP(fptr->op_array.filename, 0));
+ RETURN_STR(STR_COPY(fptr->op_array.filename));
}
RETURN_FALSE;
}
@@ -1854,8 +1853,7 @@ ZEND_METHOD(reflection_function, getDocComment)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) {
-// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
- RETURN_STR(STR_DUP(fptr->op_array.doc_comment, 0));
+ RETURN_STR(STR_COPY(fptr->op_array.doc_comment));
}
RETURN_FALSE;
}
@@ -3451,8 +3449,6 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
zend_class_entry *ce;
zend_string *name;
zval *variable_ptr, *value;
-//??? int refcount;
-//??? zend_uchar is_ref;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &name, &value) ==
FAILURE) {
return;
@@ -3467,13 +3463,8 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
"Class %s does not have a property named %s", ce->name->val, name->val);
return;
}
-//??? refcount = Z_REFCOUNT_PP(variable_ptr);
-//??? is_ref = Z_ISREF_PP(variable_ptr);
- zval_dtor(variable_ptr);
- ZVAL_DUP(variable_ptr, value);
-//??? Z_SET_REFCOUNT_PP(variable_ptr, refcount);
-//??? Z_SET_ISREF_TO_PP(variable_ptr, is_ref);
-
+ zval_ptr_dtor(variable_ptr);
+ ZVAL_COPY(variable_ptr, value);
}
/* }}} */
@@ -3566,8 +3557,7 @@ ZEND_METHOD(reflection_class, getFileName)
}
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->type == ZEND_USER_CLASS) {
-// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
- RETURN_STR(STR_DUP(ce->info.user.filename, 0));
+ RETURN_STR(STR_COPY(ce->info.user.filename));
}
RETURN_FALSE;
}
diff --git a/main/network.c b/main/network.c
index ce88bf4..d2bc35b 100644
--- a/main/network.c
+++ b/main/network.c
@@ -563,7 +563,6 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, long ad
if (n == 0) {
if (errstr) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to resolve `%s': %s", tmp,
errstr);
-//??? STR_FREE(errstr);
efree(errstr);
}
goto out;
@@ -590,7 +589,6 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, long ad
php_network_freeaddresses(psal);
out:
-//??? STR_FREE(tmp);
efree(tmp);
return ret;
}