[php-src] master: Use RETVAL_NEW_STR
| From: | Niels Dossche | Date: | Thu, 02 May 2024 18:04:07 +0000 |
| Subject: | [php-src] master: Use RETVAL_NEW_STR | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128306@lists.php.net to get a copy of this message | ||
Author: Niels Dossche (nielsdos)
Date: 2024-05-02T20:03:59+02:00
Commit: https://github.com/php/php-src/commit/be072d7be437329e824dfb5122ce7ae3fbf9463d
Raw diff: https://github.com/php/php-src/commit/be072d7be437329e824dfb5122ce7ae3fbf9463d.diff
Use RETVAL_NEW_STR
The strings are always new, not interned.
Changed paths:
M ext/bcmath/bcmath.c
Diff:
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 7f5a473472d7..277d956d3fd6 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -181,7 +181,7 @@ PHP_FUNCTION(bcadd)
bc_add (first, second, &result, scale);
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -230,7 +230,7 @@ PHP_FUNCTION(bcsub)
bc_sub (first, second, &result, scale);
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -279,7 +279,7 @@ PHP_FUNCTION(bcmul)
bc_multiply (first, second, &result, scale);
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -331,7 +331,7 @@ PHP_FUNCTION(bcdiv)
goto cleanup;
}
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -383,7 +383,7 @@ PHP_FUNCTION(bcmod)
goto cleanup;
}
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -454,7 +454,7 @@ PHP_FUNCTION(bcpowmod)
zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
goto cleanup;
case OK:
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
break;
EMPTY_SWITCH_DEFAULT_CASE();
}
@@ -518,7 +518,7 @@ PHP_FUNCTION(bcpow)
bc_raise(first, exponent, &result, scale);
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
bc_free_num(&first);
@@ -558,7 +558,7 @@ PHP_FUNCTION(bcsqrt)
}
if (bc_sqrt (&result, scale) != 0) {
- RETVAL_STR(bc_num2str_ex(result, scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, scale));
} else {
zend_argument_value_error(1, "must be greater than or equal to 0");
}
@@ -631,7 +631,7 @@ static void bcfloor_or_bcceil(INTERNAL_FUNCTION_PARAMETERS, bool is_floor)
}
bc_floor_or_ceil(num, is_floor, &result);
- RETVAL_STR(bc_num2str_ex(result, 0));
+ RETVAL_NEW_STR(bc_num2str_ex(result, 0));
cleanup: {
bc_free_num(&num);
@@ -692,7 +692,7 @@ PHP_FUNCTION(bcround)
}
bc_round(num, precision, mode, &result);
- RETVAL_STR(bc_num2str_ex(result, result->n_scale));
+ RETVAL_NEW_STR(bc_num2str_ex(result, result->n_scale));
cleanup: {
bc_free_num(&num);