diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-14 12:06:07 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-14 12:11:11 +0100 |
commit | 422d1665a2a744421b5911cbe8541370509bc4f5 (patch) | |
tree | fe173f4da139019d71a7bc88ffacfa8cd8f870dc | |
parent | 1b2aba285db488852844c2eac484d35569ec4442 (diff) | |
download | php-git-422d1665a2a744421b5911cbe8541370509bc4f5.tar.gz |
Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.
The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.
Also drop the unused convert_to_explicit_type macros.
-rw-r--r-- | Zend/zend_exceptions.c | 2 | ||||
-rw-r--r-- | Zend/zend_operators.h | 66 | ||||
-rw-r--r-- | ext/dba/dba.c | 4 | ||||
-rw-r--r-- | ext/imap/php_imap.c | 60 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_format.c | 4 | ||||
-rw-r--r-- | ext/intl/timezone/timezone_methods.cpp | 2 | ||||
-rw-r--r-- | ext/ldap/ldap.c | 8 | ||||
-rw-r--r-- | ext/mbstring/php_mbregex.c | 2 | ||||
-rw-r--r-- | ext/mysqli/mysqli_api.c | 6 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps_codec.c | 8 | ||||
-rw-r--r-- | ext/oci8/oci8_statement.c | 4 | ||||
-rw-r--r-- | ext/pdo_pgsql/pgsql_statement.c | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 2 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 12 | ||||
-rw-r--r-- | ext/readline/readline.c | 2 | ||||
-rw-r--r-- | ext/snmp/snmp.c | 6 | ||||
-rw-r--r-- | ext/sockets/multicast.c | 12 | ||||
-rw-r--r-- | ext/sockets/sockets.c | 14 | ||||
-rw-r--r-- | ext/standard/array.c | 6 | ||||
-rwxr-xr-x | ext/standard/basic_functions.c | 6 | ||||
-rw-r--r-- | ext/standard/file.c | 2 | ||||
-rw-r--r-- | ext/standard/pack.c | 2 | ||||
-rw-r--r-- | ext/standard/var.c | 2 | ||||
-rw-r--r-- | ext/xml/xml.c | 2 | ||||
-rw-r--r-- | ext/xsl/xsltprocessor.c | 2 | ||||
-rw-r--r-- | main/output.c | 2 |
26 files changed, 95 insertions, 145 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index b52b1ab113..59c62ada7a 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -478,7 +478,7 @@ ZEND_METHOD(ErrorException, getSeverity) static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */ { /* the trivial way would be to do - * convert_to_string_ex(arg); + * convert_to_string(arg); * append it and kill the now tmp arg. * but that could cause some E_NOTICE and also damn long lines. */ diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index d543b7b03c..1b02c75499 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -444,64 +444,14 @@ ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len); ZEND_API void ZEND_FASTCALL zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); -#define convert_to_ex_master(pzv, lower_type, upper_type) \ - if (Z_TYPE_P(pzv)!=upper_type) { \ - convert_to_##lower_type(pzv); \ - } - -#define convert_to_explicit_type(pzv, type) \ - do { \ - switch (type) { \ - case IS_NULL: \ - convert_to_null(pzv); \ - break; \ - case IS_LONG: \ - convert_to_long(pzv); \ - break; \ - case IS_DOUBLE: \ - convert_to_double(pzv); \ - break; \ - case _IS_BOOL: \ - convert_to_boolean(pzv); \ - break; \ - case IS_ARRAY: \ - convert_to_array(pzv); \ - break; \ - case IS_OBJECT: \ - convert_to_object(pzv); \ - break; \ - case IS_STRING: \ - convert_to_string(pzv); \ - break; \ - default: \ - assert(0); \ - break; \ - } \ - } while (0); - -#define convert_to_explicit_type_ex(pzv, str_type) \ - if (Z_TYPE_P(pzv) != str_type) { \ - convert_to_explicit_type(pzv, str_type); \ - } - -#define convert_to_boolean_ex(pzv) do { \ - if (Z_TYPE_INFO_P(pzv) > IS_TRUE) { \ - convert_to_boolean(pzv); \ - } else if (Z_TYPE_INFO_P(pzv) < IS_FALSE) { \ - ZVAL_FALSE(pzv); \ - } \ - } while (0) -#define convert_to_long_ex(pzv) convert_to_ex_master(pzv, long, IS_LONG) -#define convert_to_double_ex(pzv) convert_to_ex_master(pzv, double, IS_DOUBLE) -#define convert_to_string_ex(pzv) convert_to_ex_master(pzv, string, IS_STRING) -#define convert_to_array_ex(pzv) convert_to_ex_master(pzv, array, IS_ARRAY) -#define convert_to_object_ex(pzv) convert_to_ex_master(pzv, object, IS_OBJECT) -#define convert_to_null_ex(pzv) convert_to_ex_master(pzv, null, IS_NULL) - -#define convert_scalar_to_number_ex(pzv) \ - if (Z_TYPE_P(pzv)!=IS_LONG && Z_TYPE_P(pzv)!=IS_DOUBLE) { \ - convert_scalar_to_number(pzv); \ - } +#define convert_to_null_ex(zv) convert_to_null(zv) +#define convert_to_boolean_ex(zv) convert_to_boolean(zv) +#define convert_to_long_ex(zv) convert_to_long(zv) +#define convert_to_double_ex(zv) convert_to_double(zv) +#define convert_to_string_ex(zv) convert_to_string(zv) +#define convert_to_array_ex(zv) convert_to_array(zv) +#define convert_to_object_ex(zv) convert_to_object(zv) +#define convert_scalar_to_number_ex(zv) convert_scalar_to_number(zv) #if defined(ZEND_WIN32) && !defined(ZTS) && defined(_MSC_VER) /* This performance improvement of tolower() on Windows gives 10-18% on bench.php */ diff --git a/ext/dba/dba.c b/ext/dba/dba.c index b3c9f4eeb2..b7bfecc77c 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -114,8 +114,8 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free) group = zend_hash_get_current_data_ex(Z_ARRVAL_P(key), &pos); zend_hash_move_forward_ex(Z_ARRVAL_P(key), &pos); name = zend_hash_get_current_data_ex(Z_ARRVAL_P(key), &pos); - convert_to_string_ex(group); - convert_to_string_ex(name); + convert_to_string(group); + convert_to_string(name); if (Z_STRLEN_P(group) == 0) { *key_str = Z_STRVAL_P(name); *key_free = NULL; diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 399b7a5165..152e21731f 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3048,47 +3048,47 @@ PHP_FUNCTION(imap_mail_compose) env = mail_newenvelope(); if ((pvalue = zend_hash_str_find(envelope, "remail", sizeof("remail") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); env->remail = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(envelope, "return_path", sizeof("return_path") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->return_path, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "date", sizeof("date") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); env->date = (unsigned char*)cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(envelope, "from", sizeof("from") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->from, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "reply_to", sizeof("reply_to") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->reply_to, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "in_reply_to", sizeof("in_reply_to") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); env->in_reply_to = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(envelope, "subject", sizeof("subject") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); env->subject = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(envelope, "to", sizeof("to") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->to, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "cc", sizeof("cc") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->cc, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "bcc", sizeof("bcc") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); PHP_RFC822_PARSE_ADRLIST(&env->bcc, pvalue); } if ((pvalue = zend_hash_str_find(envelope, "message_id", sizeof("message_id") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); env->message_id=cpystr(Z_STRVAL_P(pvalue)); } @@ -3098,7 +3098,7 @@ PHP_FUNCTION(imap_mail_compose) SEPARATE_ARRAY(pvalue); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pvalue), env_data) { custom_headers_param = mail_newbody_parameter(); - convert_to_string_ex(env_data); + convert_to_string(env_data); custom_headers_param->value = (char *) fs_get(Z_STRLEN_P(env_data) + 1); custom_headers_param->attribute = NULL; memcpy(custom_headers_param->value, Z_STRVAL_P(env_data), Z_STRLEN_P(env_data) + 1); @@ -3140,7 +3140,7 @@ PHP_FUNCTION(imap_mail_compose) } } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); tmp_param = mail_newbody_parameter(); tmp_param->value = cpystr(Z_STRVAL_P(pvalue)); tmp_param->attribute = cpystr("CHARSET"); @@ -3155,7 +3155,7 @@ PHP_FUNCTION(imap_mail_compose) if (key == NULL) continue; disp_param = mail_newbody_parameter(); disp_param->attribute = cpystr(ZSTR_VAL(key)); - convert_to_string_ex(disp_data); + convert_to_string(disp_data); disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1); memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1); disp_param->next = tmp_param; @@ -3165,19 +3165,19 @@ PHP_FUNCTION(imap_mail_compose) } } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "subtype", sizeof("subtype") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->subtype = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "id", sizeof("id") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->id = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "description", sizeof("description") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->description = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition.type", sizeof("disposition.type") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->disposition.type = (char *) fs_get(Z_STRLEN_P(pvalue) + 1); memcpy(bod->disposition.type, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1); } @@ -3189,7 +3189,7 @@ PHP_FUNCTION(imap_mail_compose) if (key == NULL) continue; disp_param = mail_newbody_parameter(); disp_param->attribute = cpystr(ZSTR_VAL(key)); - convert_to_string_ex(disp_data); + convert_to_string(disp_data); disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1); memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1); disp_param->next = tmp_param; @@ -3202,7 +3202,7 @@ PHP_FUNCTION(imap_mail_compose) bod->nested.msg = mail_newmsg(); } else { if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1); memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1); bod->contents.text.size = Z_STRLEN_P(pvalue); @@ -3219,7 +3219,7 @@ PHP_FUNCTION(imap_mail_compose) bod->size.bytes = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->md5 = cpystr(Z_STRVAL_P(pvalue)); } } else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) { @@ -3251,7 +3251,7 @@ PHP_FUNCTION(imap_mail_compose) } } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); tmp_param = mail_newbody_parameter(); tmp_param->value = (char *) fs_get(Z_STRLEN_P(pvalue) + 1); memcpy(tmp_param->value, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1); @@ -3267,7 +3267,7 @@ PHP_FUNCTION(imap_mail_compose) if (key == NULL) continue; disp_param = mail_newbody_parameter(); disp_param->attribute = cpystr(ZSTR_VAL(key)); - convert_to_string_ex(disp_data); + convert_to_string(disp_data); disp_param->value = (char *)fs_get(Z_STRLEN_P(disp_data) + 1); memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1); disp_param->next = tmp_param; @@ -3277,19 +3277,19 @@ PHP_FUNCTION(imap_mail_compose) } } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "subtype", sizeof("subtype") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->subtype = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "id", sizeof("id") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->id = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "description", sizeof("description") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->description = cpystr(Z_STRVAL_P(pvalue)); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition.type", sizeof("disposition.type") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->disposition.type = (char *) fs_get(Z_STRLEN_P(pvalue) + 1); memcpy(bod->disposition.type, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1); } @@ -3301,7 +3301,7 @@ PHP_FUNCTION(imap_mail_compose) if (key == NULL) continue; disp_param = mail_newbody_parameter(); disp_param->attribute = cpystr(ZSTR_VAL(key)); - convert_to_string_ex(disp_data); + convert_to_string(disp_data); disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1); memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1); disp_param->next = tmp_param; @@ -3314,7 +3314,7 @@ PHP_FUNCTION(imap_mail_compose) bod->nested.msg = mail_newmsg(); } else { if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1); memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1); bod->contents.text.size = Z_STRLEN_P(pvalue); @@ -3331,7 +3331,7 @@ PHP_FUNCTION(imap_mail_compose) bod->size.bytes = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) { - convert_to_string_ex(pvalue); + convert_to_string(pvalue); bod->md5 = cpystr(Z_STRVAL_P(pvalue)); } } diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index aa9c5915ad..f467d42c1c 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -59,7 +59,7 @@ PHP_FUNCTION( numfmt_format ) switch(type) { case FORMAT_TYPE_INT32: - convert_to_long_ex(number); + convert_to_long(number); formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { @@ -91,7 +91,7 @@ PHP_FUNCTION( numfmt_format ) break; case FORMAT_TYPE_DOUBLE: - convert_to_double_ex(number); + convert_to_double(number); formatted_len = unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo)); if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) { intl_error_reset(INTL_DATA_ERROR_P(nfo)); diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 3a2d28ada6..06b807f82f 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -158,7 +158,7 @@ int_offset: } } else if (Z_TYPE_P(arg) == IS_DOUBLE) { double_offset: - convert_to_long_ex(arg); + convert_to_long(arg); goto int_offset; } else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) { zend_long lval; diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index dde62b3810..c4f840b823 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -3157,7 +3157,7 @@ PHP_FUNCTION(ldap_set_option) { int val; - convert_to_long_ex(newval); + convert_to_long(newval); if (ZEND_LONG_EXCEEDS_INT(Z_LVAL_P(newval))) { zend_argument_value_error(3, "is too large"); RETURN_THROWS(); @@ -3172,7 +3172,7 @@ PHP_FUNCTION(ldap_set_option) { struct timeval timeout; - convert_to_long_ex(newval); + convert_to_long(newval); timeout.tv_sec = Z_LVAL_P(newval); timeout.tv_usec = 0; if (ldap_set_option(ldap, LDAP_OPT_NETWORK_TIMEOUT, (void *) &timeout)) { @@ -3184,7 +3184,7 @@ PHP_FUNCTION(ldap_set_option) { int timeout; - convert_to_long_ex(newval); + convert_to_long(newval); timeout = 1000 * Z_LVAL_P(newval); /* Convert to milliseconds */ if (ldap_set_option(ldap, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) { RETURN_FALSE; @@ -3196,7 +3196,7 @@ PHP_FUNCTION(ldap_set_option) { struct timeval timeout; - convert_to_long_ex(newval); + convert_to_long(newval); timeout.tv_sec = Z_LVAL_P(newval); timeout.tv_usec = 0; if (ldap_set_option(ldap, LDAP_OPT_TIMEOUT, (void *) &timeout)) { diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index e87a7c6131..0b556d3263 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1102,7 +1102,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp arg_replace_fci.retval = &retval; if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache) == SUCCESS && !Z_ISUNDEF(retval)) { - convert_to_string_ex(&retval); + convert_to_string(&retval); smart_str_appendl(&out_buf, Z_STRVAL(retval), Z_STRLEN(retval)); smart_str_free(&eval_buf); zval_ptr_dtor(&retval); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 4f6b6c881f..1670a65054 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -858,12 +858,12 @@ PHP_FUNCTION(mysqli_stmt_execute) stmt->stmt->params[i].buffer_length = Z_STRLEN_P(param); break; case MYSQL_TYPE_DOUBLE: - convert_to_double_ex(param); + convert_to_double(param); stmt->stmt->params[i].buffer = &Z_DVAL_P(param); break; case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_LONG: - convert_to_long_ex(param); + convert_to_long(param); stmt->stmt->params[i].buffer = &Z_LVAL_P(param); break; default: @@ -1714,7 +1714,7 @@ PHP_FUNCTION(mysqli_options) } break; case IS_LONG: - convert_to_long_ex(mysql_value); + convert_to_long(mysql_value); break; default: break; diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index 4de730777f..ebe0c5a9d8 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -603,7 +603,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie */ if (d >= (double) ZEND_LONG_MAX || d < (double) ZEND_LONG_MIN) { stmt->send_types_to_server = *resend_types_next_time = 1; - convert_to_string_ex(tmp_data); + convert_to_string(tmp_data); } else { convert_to_long(tmp_data); } @@ -647,7 +647,7 @@ mysqlnd_stmt_execute_store_types(MYSQLND_STMT_DATA * stmt, zval * copies, zend_u current_type = MYSQL_TYPE_VAR_STRING; /* don't change stmt->param_bind[i].type to MYSQL_TYPE_VAR_STRING - we force convert_to_long_ex in all cases, thus the type will be right in the next switch. + we force convert_to_long in all cases, thus the type will be right in the next switch. if the type is however not long, then we will do a goto in the next switch. We want to preserve the original bind type given by the user. Thus, we do these hacks. */ @@ -714,7 +714,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval if (Z_TYPE_P(tmp_data) == IS_STRING) { goto use_string; } - convert_to_long_ex(tmp_data); + convert_to_long(tmp_data); } *data_size += 4 + is_longlong; break; @@ -771,7 +771,7 @@ mysqlnd_stmt_execute_store_param_values(MYSQLND_STMT_DATA * stmt, zval * copies, } else { switch (stmt->param_bind[i].type) { case MYSQL_TYPE_DOUBLE: - convert_to_double_ex(data); + convert_to_double(data); float8store(*p, Z_DVAL_P(data)); (*p) += 8; break; diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index e16e38713d..852439e114 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1832,7 +1832,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le bind->array.element_lengths[i] = sizeof(oci_phpsized_int); } if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - convert_to_long_ex(entry); + convert_to_long(entry); ((oci_phpsized_int *)bind->array.elements)[i] = (oci_phpsized_int) Z_LVAL_P(entry); zend_hash_move_forward(hash); } else { @@ -1873,7 +1873,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le bind->array.element_lengths[i] = sizeof(double); } if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - convert_to_double_ex(entry); + convert_to_double(entry); ((double *)bind->array.elements)[i] = (double) Z_DVAL_P(entry); zend_hash_move_forward(hash); } else { diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 3a8b49041d..c17585f47e 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -380,7 +380,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * S->param_lengths[param->paramno] = 1; S->param_formats[param->paramno] = 0; } else { - convert_to_string_ex(parameter); + convert_to_string(parameter); S->param_values[param->paramno] = Z_STRVAL_P(parameter); S->param_lengths[param->paramno] = Z_STRLEN_P(parameter); S->param_formats[param->paramno] = 0; diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index ca069ec300..97363ff0fe 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -496,7 +496,7 @@ static int php_sqlite3_collation_callback(void *context, php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback"); } else if (!Z_ISUNDEF(retval)) { if (Z_TYPE(retval) != IS_LONG) { - convert_to_long_ex(&retval); + convert_to_long(&retval); } ret = 0; if (Z_LVAL(retval) > 0) { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 4685c7cd74..9b3471b192 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3613,7 +3613,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type) if (PQsetnonblocking(pgsql, 0)) { php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode"); } - convert_to_boolean_ex(return_value); + convert_to_boolean(return_value); } /* }}} */ @@ -4721,7 +4721,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con case IS_DOUBLE: ZVAL_DOUBLE(&new_val, Z_DVAL_P(val)); - convert_to_long_ex(&new_val); + convert_to_long(&new_val); break; case IS_LONG: @@ -4837,7 +4837,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con case IS_DOUBLE: ZVAL_DOUBLE(&new_val, Z_DVAL_P(val)); - convert_to_string_ex(&new_val); + convert_to_string(&new_val); break; case IS_NULL: @@ -4868,14 +4868,14 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val)); - convert_to_long_ex(&new_val); + convert_to_long(&new_val); } } break; case IS_DOUBLE: ZVAL_DOUBLE(&new_val, Z_DVAL_P(val)); - convert_to_long_ex(&new_val); + convert_to_long(&new_val); break; case IS_LONG: @@ -5140,7 +5140,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con case IS_DOUBLE: ZVAL_DOUBLE(&new_val, Z_DVAL_P(val)); - convert_to_string_ex(&new_val); + convert_to_string(&new_val); break; case IS_NULL: diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 647eb0977f..2b001e8ebd 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -414,7 +414,7 @@ static char *_readline_command_generator(const char *text, int state) while ((entry = zend_hash_get_current_data(myht)) != NULL) { zend_hash_move_forward(myht); - convert_to_string_ex(entry); + convert_to_string(entry); if (strncmp (Z_STRVAL_P(entry), text, strlen(text)) == 0) { return (strdup(Z_STRVAL_P(entry))); } diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 0925d345cc..e217f95961 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -705,7 +705,7 @@ static int php_snmp_parse_oid( objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht), 0); objid_query->array_output = ( (st & SNMP_CMD_SET) ? FALSE : TRUE ); ZEND_HASH_FOREACH_VAL(oid_ht, tmp_oid) { - convert_to_string_ex(tmp_oid); + convert_to_string(tmp_oid); objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid); if (st & SNMP_CMD_SET) { if (type_str) { @@ -720,7 +720,7 @@ static int php_snmp_parse_oid( idx_type++; } if (idx_type < type_ht->nNumUsed) { - convert_to_string_ex(tmp_type); + convert_to_string(tmp_type); if (Z_STRLEN_P(tmp_type) != 1) { zend_value_error("Type must be a single character"); efree(objid_query->vars); @@ -747,7 +747,7 @@ static int php_snmp_parse_oid( idx_value++; } if (idx_value < value_ht->nNumUsed) { - convert_to_string_ex(tmp_value); + convert_to_string(tmp_value); objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value); idx_value++; } else { diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 321efdc403..86ec5c14b6 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -159,7 +159,7 @@ mcast_req_fun: ; php_sockaddr_storage group = {0}; socklen_t glen; - convert_to_array_ex(arg4); + convert_to_array(arg4); opt_ht = Z_ARRVAL_P(arg4); if (php_get_address_from_array(opt_ht, "group", php_sock, &group, @@ -195,7 +195,7 @@ mcast_req_fun: ; socklen_t glen, slen; - convert_to_array_ex(arg4); + convert_to_array(arg4); opt_ht = Z_ARRVAL_P(arg4); if (php_get_address_from_array(opt_ht, "group", php_sock, &group, @@ -272,12 +272,12 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock, goto dosockopt; case IP_MULTICAST_LOOP: - convert_to_boolean_ex(arg4); + convert_to_boolean(arg4); ipv4_mcast_ttl_lback = (unsigned char) (Z_TYPE_P(arg4) == IS_TRUE); goto ipv4_loop_ttl; case IP_MULTICAST_TTL: - convert_to_long_ex(arg4); + convert_to_long(arg4); if (Z_LVAL_P(arg4) < 0L || Z_LVAL_P(arg4) > 255L) { zend_argument_value_error(4, "must be between 0 and 255"); return FAILURE; @@ -337,11 +337,11 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock, goto dosockopt; case IPV6_MULTICAST_LOOP: - convert_to_boolean_ex(arg4); + convert_to_boolean(arg4); ov = (int) Z_TYPE_P(arg4) == IS_TRUE; goto ipv6_loop_hops; case IPV6_MULTICAST_HOPS: - convert_to_long_ex(arg4); + convert_to_long(arg4); if (Z_LVAL_P(arg4) < -1L || Z_LVAL_P(arg4) > 255L) { zend_argument_value_error(4, "must be between -1 and 255"); return FAILURE; diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index a9d0e4b885..76e63f04ad 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1877,7 +1877,7 @@ PHP_FUNCTION(socket_set_option) const char l_onoff_key[] = "l_onoff"; const char l_linger_key[] = "l_linger"; - convert_to_array_ex(arg4); + convert_to_array(arg4); opt_ht = Z_ARRVAL_P(arg4); if ((l_onoff = zend_hash_str_find(opt_ht, l_onoff_key, sizeof(l_onoff_key) - 1)) == NULL) { @@ -1889,8 +1889,8 @@ PHP_FUNCTION(socket_set_option) RETURN_THROWS(); } - convert_to_long_ex(l_onoff); - convert_to_long_ex(l_linger); + convert_to_long(l_onoff); + convert_to_long(l_linger); lv.l_onoff = (unsigned short)Z_LVAL_P(l_onoff); lv.l_linger = (unsigned short)Z_LVAL_P(l_linger); @@ -1905,7 +1905,7 @@ PHP_FUNCTION(socket_set_option) const char sec_key[] = "sec"; const char usec_key[] = "usec"; - convert_to_array_ex(arg4); + convert_to_array(arg4); opt_ht = Z_ARRVAL_P(arg4); if ((sec = zend_hash_str_find(opt_ht, sec_key, sizeof(sec_key) - 1)) == NULL) { @@ -1917,8 +1917,8 @@ PHP_FUNCTION(socket_set_option) RETURN_THROWS(); } - convert_to_long_ex(sec); - convert_to_long_ex(usec); + convert_to_long(sec); + convert_to_long(usec); #ifndef PHP_WIN32 tv.tv_sec = Z_LVAL_P(sec); tv.tv_usec = Z_LVAL_P(usec); @@ -1946,7 +1946,7 @@ PHP_FUNCTION(socket_set_option) default: default_case: - convert_to_long_ex(arg4); + convert_to_long(arg4); ov = Z_LVAL_P(arg4); optlen = sizeof(ov); diff --git a/ext/standard/array.c b/ext/standard/array.c index 4c20dfbecf..e4707031b7 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3303,7 +3303,7 @@ PHP_FUNCTION(array_splice) if (ZEND_NUM_ARGS() == 4) { /* Make sure the last argument, if passed, is an array */ - convert_to_array_ex(repl_array); + convert_to_array(repl_array); } /* Don't create the array of removed elements if it's not going @@ -3501,10 +3501,10 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */ dest_zval = dest_entry; if (Z_TYPE_P(dest_zval) == IS_NULL) { - convert_to_array_ex(dest_zval); + convert_to_array(dest_zval); add_next_index_null(dest_zval); } else { - convert_to_array_ex(dest_zval); + convert_to_array(dest_zval); } ZVAL_UNDEF(&tmp); if (Z_TYPE_P(src_zval) == IS_OBJECT) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c30c93a968..0d4ef2dad8 100755 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1170,7 +1170,7 @@ PHP_FUNCTION(getopt) int optname_int = atoi(optname); if ((args = zend_hash_index_find(Z_ARRVAL_P(return_value), optname_int)) != NULL) { if (Z_TYPE_P(args) != IS_ARRAY) { - convert_to_array_ex(args); + convert_to_array(args); } zend_hash_next_index_insert(Z_ARRVAL_P(args), &val); } else { @@ -1180,7 +1180,7 @@ PHP_FUNCTION(getopt) /* other strings */ if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) { if (Z_TYPE_P(args) != IS_ARRAY) { - convert_to_array_ex(args); + convert_to_array(args); } zend_hash_next_index_insert(Z_ARRVAL_P(args), &val); } else { @@ -2393,7 +2393,7 @@ PHP_FUNCTION(register_tick_function) } if (Z_TYPE(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE(tick_fe.arguments[0]) != IS_OBJECT) { - convert_to_string_ex(&tick_fe.arguments[0]); + convert_to_string(&tick_fe.arguments[0]); } if (!BG(user_tick_functions)) { diff --git a/ext/standard/file.c b/ext/standard/file.c index c9cf1d29b0..6335b5a9af 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -654,7 +654,7 @@ PHP_FUNCTION(file_put_contents) case IS_DOUBLE: case IS_FALSE: case IS_TRUE: - convert_to_string_ex(data); + convert_to_string(data); case IS_STRING: if (Z_STRLEN_P(data)) { diff --git a/ext/standard/pack.c b/ext/standard/pack.c index e14bbbcedb..b14eb64d29 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -84,7 +84,7 @@ static void php_pack(zval *val, size_t size, int *map, char *output) size_t i; char *v; - convert_to_long_ex(val); + convert_to_long(val); v = (char *) &Z_LVAL_P(val); for (i = 0; i < size; i++) { diff --git a/ext/standard/var.c b/ext/standard/var.c index ae8665e658..f88aa21fe8 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1208,7 +1208,7 @@ PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, co zend_string *lcname; ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(classes), entry) { - convert_to_string_ex(entry); + convert_to_string(entry); lcname = zend_string_tolower(Z_STR_P(entry)); zend_hash_add_empty_element(class_hash, lcname); zend_string_release_ex(lcname, 0); diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 3064545739..eebccca19c 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -437,7 +437,7 @@ static void xml_set_handler(zval *handler, zval *data) /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */ if (Z_TYPE_P(data) != IS_ARRAY && Z_TYPE_P(data) != IS_OBJECT) { - convert_to_string_ex(data); + convert_to_string(data); if (Z_STRLEN_P(data) == 0) { ZVAL_UNDEF(handler); return; diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 9498ba576c..11216c8d18 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -277,7 +277,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string"); valuePush(ctxt, xmlXPathNewString((const xmlChar *) "")); } else { - convert_to_string_ex(&retval); + convert_to_string(&retval); valuePush(ctxt, xmlXPathNewString((xmlChar *) Z_STRVAL(retval))); } zval_ptr_dtor(&retval); diff --git a/main/output.c b/main/output.c index bdeca894f2..eef8ad3bfc 100644 --- a/main/output.c +++ b/main/output.c @@ -970,7 +970,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl /* user handler may have returned TRUE */ status = PHP_OUTPUT_HANDLER_NO_DATA; if (Z_TYPE(retval) != IS_FALSE && Z_TYPE(retval) != IS_TRUE) { - convert_to_string_ex(&retval); + convert_to_string(&retval); if (Z_STRLEN(retval)) { context->out.data = estrndup(Z_STRVAL(retval), Z_STRLEN(retval)); context->out.used = Z_STRLEN(retval); |