Skip to content

Commit c3fe03b

Browse files
committed
Zend: Remove unused parameter from zend_dval_to_lval_cap()
The `zend_string *s` parameter became unused after commit f754ffa (GH-20746) removed the `zend_oob_string_to_long_error()` calls. This fixes an unused-parameter compiler warning and updates a stale comment in zend_operators.c that incorrectly stated this function can emit warnings.
1 parent d54e510 commit c3fe03b

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

Zend/zend_operators.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,10 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval *
428428
* behaviour.
429429
*/
430430
if (op_str == NULL) {
431-
/* zend_dval_to_lval_cap() can emit a warning so always do the copy here */
431+
/* zend_incompatible_string_to_long_error() needs op_str, so always do the copy here */
432432
op_str = zend_string_copy(Z_STR_P(op));
433433
}
434-
lval = zend_dval_to_lval_cap(dval, op_str);
434+
lval = zend_dval_to_lval_cap(dval);
435435
if (!zend_is_long_compatible(dval, lval)) {
436436
zend_incompatible_string_to_long_error(op_str);
437437
if (UNEXPECTED(EG(exception))) {
@@ -994,7 +994,7 @@ ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_stri
994994
* behaviour.
995995
*/
996996
/* Most usages are expected to not be (int) casts */
997-
lval = zend_dval_to_lval_cap(dval, Z_STR_P(op));
997+
lval = zend_dval_to_lval_cap(dval);
998998
if (UNEXPECTED(is_strict)) {
999999
if (!zend_is_long_compatible(dval, lval)) {
10001000
zend_incompatible_string_to_long_error(Z_STR_P(op));

Zend/zend_operators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static zend_always_inline zend_long zend_dval_to_lval_silent(double d)
146146
}
147147

148148
/* Used to convert a string float to integer during an (int) cast */
149-
static zend_always_inline zend_long zend_dval_to_lval_cap(double d, const zend_string *s)
149+
static zend_always_inline zend_long zend_dval_to_lval_cap(double d)
150150
{
151151
if (UNEXPECTED(!zend_finite(d))) {
152152
return 0;

ext/dom/php_dom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,7 @@ static bool dom_nodemap_or_nodelist_process_offset_as_named(zval *offset, zend_l
22692269
if (0 == (is_numeric_string_type = is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), lval, &dval, true))) {
22702270
return true;
22712271
} else if (is_numeric_string_type == IS_DOUBLE) {
2272-
*lval = zend_dval_to_lval_cap(dval, Z_STR_P(offset));
2272+
*lval = zend_dval_to_lval_cap(dval);
22732273
}
22742274
} else {
22752275
*lval = zval_get_long(offset);

ext/tidy/tidy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ static bool php_tidy_set_tidy_opt(TidyDoc doc, const char *optname, zval *value,
755755
}
756756
uint8_t type = is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), &lval, &dval, true);
757757
if (type == IS_DOUBLE) {
758-
lval = zend_dval_to_lval_cap(dval, str);
758+
lval = zend_dval_to_lval_cap(dval);
759759
type = IS_LONG;
760760
}
761761
if (type == IS_LONG) {

0 commit comments

Comments
 (0)