com php-src: Use Fast ZPP: ext/standard/formatted_print.c
| From: | Dmitry Stogov | Date: | Tue, 05 May 2015 18:38:52 +0000 |
| Subject: | com php-src: Use Fast ZPP: ext/standard/formatted_print.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86606@lists.php.net to get a copy of this message | ||
Commit: d7351a5c7497103795c75f6c8d99bebc79c2abd9
Author: Dmitry Stogov <dmitry@zend.com> Tue, 5 May 2015 21:38:52 +0300
Parents: f6663c72019c4a4e73a2c7073a938829c7b34b09
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d7351a5c7497103795c75f6c8d99bebc79c2abd9
Log:
Use Fast ZPP
Changed paths:
M ext/standard/formatted_print.c
Diff:
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 4c0eeee..15afba3 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -383,7 +383,7 @@ php_sprintf_getnumber(char *buffer, size_t *pos)
*
*/
static zend_string *
-php_formatted_print(int param_count, int use_array, int format_offset)
+php_formatted_print(zend_execute_data *execute_data, int use_array, int format_offset)
{
zval *newargs = NULL;
zval *args, *z_format;
@@ -395,9 +395,15 @@ php_formatted_print(int param_count, int use_array, int format_offset)
int always_sign;
size_t format_len;
- if (zend_parse_parameters(param_count, "+", &args, &argc) == FAILURE) {
- return NULL;
+#ifndef FAST_ZPP
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
+ return;
}
+#else
+ ZEND_PARSE_PARAMETERS_START(1, -1)
+ Z_PARAM_VARIADIC('+', args, argc)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
/* verify the number of args */
if ((use_array && argc != (2 + format_offset))
@@ -670,7 +676,7 @@ PHP_FUNCTION(user_sprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
+ if ((result=php_formatted_print(execute_data, 0, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -683,7 +689,7 @@ PHP_FUNCTION(vsprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
+ if ((result=php_formatted_print(execute_data, 1, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -697,7 +703,7 @@ PHP_FUNCTION(user_printf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
+ if ((result=php_formatted_print(execute_data, 0, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -713,7 +719,7 @@ PHP_FUNCTION(vprintf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
+ if ((result=php_formatted_print(execute_data, 1, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -740,7 +746,7 @@ PHP_FUNCTION(fprintf)
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1))==NULL) {
+ if ((result=php_formatted_print(execute_data, 0, 1))==NULL) {
RETURN_FALSE;
}
@@ -769,7 +775,7 @@ PHP_FUNCTION(vfprintf)
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1))==NULL) {
+ if ((result=php_formatted_print(execute_data, 1, 1))==NULL) {
RETURN_FALSE;
}