Discussion:
com php-src: RETVAL_STRINGL takes only two variables: ext/standard/type.c
Lior Kaplan
2014-07-22 16:38:35 UTC
Permalink
Commit: 2334785f98a0a7270e07b4b66d21f6d0191e9bf5
Author: Lior Kaplan <***@gmail.com> Tue, 22 Jul 2014 06:28:20 +0300
Parents: 1953438ca024dfce48a3dbae51cf642909fb9211
Branches: phpng

Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2334785f98a0a7270e07b4b66d21f6d0191e9bf5

Log:
RETVAL_STRINGL takes only two variables

Follow up for commit f4cfaf36

Changed paths:
M ext/standard/type.c


Diff:
diff --git a/ext/standard/type.c b/ext/standard/type.c
index ab32246..d72a17d 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(gettype)

res_len = sizeof("object of type ")-1 + Z_OBJCE_P(arg)->name_length;
spprintf(&result, 0, "object of type %s", Z_OBJCE_P(arg)->name);
- RETVAL_STRINGL(result, res_len, 0);
+ RETVAL_STRINGL(result, res_len);
}
*/
break;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dmitry Stogov
2014-07-22 16:49:08 UTC
Permalink
Hi Lior,

Thanks for your fixes, however not all of them are proper.
RETVAL_STRING(..., 1) may be simple converted into RETVAL_STRING(...).
But RTVAL_STRING(..., 0) may be converted into RETVAL_STRING(...);
efree(...); or may be more optimal code that avoids double reallocation.

I'll review your last patches and fix found problems.

Thanks. Dmitry.
Post by Lior Kaplan
Commit: 2334785f98a0a7270e07b4b66d21f6d0191e9bf5
Parents: 1953438ca024dfce48a3dbae51cf642909fb9211
Branches: phpng
http://git.php.net/?p=php-src.git;a=commitdiff;h=2334785f98a0a7270e07b4b66d21f6d0191e9bf5
RETVAL_STRINGL takes only two variables
Follow up for commit f4cfaf36
M ext/standard/type.c
diff --git a/ext/standard/type.c b/ext/standard/type.c
index ab32246..d72a17d 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(gettype)
res_len = sizeof("object of type ")-1 +
Z_OBJCE_P(arg)->name_length;
spprintf(&result, 0, "object of type %s",
Z_OBJCE_P(arg)->name);
- RETVAL_STRINGL(result, res_len, 0);
+ RETVAL_STRINGL(result, res_len);
}
*/
break;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lior Kaplan
2014-07-22 17:00:03 UTC
Permalink
I've tried to do the minimum change on each line.

Any optimization would be welcomed...

Thanks,

Kaplan
Post by Dmitry Stogov
Hi Lior,
Thanks for your fixes, however not all of them are proper.
RETVAL_STRING(..., 1) may be simple converted into RETVAL_STRING(...).
But RTVAL_STRING(..., 0) may be converted into RETVAL_STRING(...);
efree(...); or may be more optimal code that avoids double reallocation.
I'll review your last patches and fix found problems.
Thanks. Dmitry.
Post by Lior Kaplan
Commit: 2334785f98a0a7270e07b4b66d21f6d0191e9bf5
Parents: 1953438ca024dfce48a3dbae51cf642909fb9211
Branches: phpng
http://git.php.net/?p=php-src.git;a=commitdiff;h=2334785f98a0a7270e07b4b66d21f6d0191e9bf5
RETVAL_STRINGL takes only two variables
Follow up for commit f4cfaf36
M ext/standard/type.c
diff --git a/ext/standard/type.c b/ext/standard/type.c
index ab32246..d72a17d 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(gettype)
res_len = sizeof("object of type ")-1 +
Z_OBJCE_P(arg)->name_length;
spprintf(&result, 0, "object of type %s",
Z_OBJCE_P(arg)->name);
- RETVAL_STRINGL(result, res_len, 0);
+ RETVAL_STRINGL(result, res_len);
}
*/
break;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...