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 /ext/sockets | |
| 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.
Diffstat (limited to 'ext/sockets')
| -rw-r--r-- | ext/sockets/multicast.c | 12 | ||||
| -rw-r--r-- | ext/sockets/sockets.c | 14 |
2 files changed, 13 insertions, 13 deletions
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); |
