]> granicus.if.org Git - php/commitdiff
Convert all php_error_docref0 to php_error_docref
authorGeorge Peter Banyard <girgias@php.net>
Sat, 13 Jul 2019 00:05:17 +0000 (02:05 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sat, 13 Jul 2019 00:05:17 +0000 (02:05 +0200)
Closes GH-4394

ext/dba/dba_lmdb.c
ext/intl/idn/idn.c
ext/intl/timezone/timezone_class.cpp
ext/intl/transliterator/transliterator_class.c
ext/intl/transliterator/transliterator_methods.c
ext/sockets/conversions.c
ext/sockets/sendrecvmsg.c
ext/standard/html.c
main/main.c
main/php.h

index 058c4c3d28a38a5e3ddb4f312db7bbb46981baf0..4bc085177d4d7cccf859a4e168dea6c7d5773cd7 100644 (file)
@@ -251,14 +251,14 @@ DBA_FIRSTKEY_FUNC(lmdb)
 
        rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn));
        if (rc) {
-               php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+               php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                return NULL;
        }
 
        rc = mdb_cursor_open(LMDB_IT(txn), LMDB_IT(dbi), &LMDB_IT(cur));
        if (rc) {
                mdb_txn_abort(LMDB_IT(txn));
-               php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+               php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                return NULL;
        }
 
@@ -268,7 +268,7 @@ DBA_FIRSTKEY_FUNC(lmdb)
                mdb_cursor_close(LMDB_IT(cur));
                LMDB_IT(cur) = NULL;
                if (MDB_NOTFOUND != rc) {
-                       php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+                       php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                }
                return NULL;
        }
@@ -291,7 +291,7 @@ DBA_NEXTKEY_FUNC(lmdb)
 
        rc = mdb_txn_renew(LMDB_IT(txn));
        if (rc) {
-               php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+               php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                return NULL;
        }
 
@@ -301,7 +301,7 @@ DBA_NEXTKEY_FUNC(lmdb)
                mdb_cursor_close(LMDB_IT(cur));
                LMDB_IT(cur) = NULL;
                if (MDB_NOTFOUND != rc) {
-                       php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+                       php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                }
                return NULL;
        }
@@ -327,7 +327,7 @@ DBA_SYNC_FUNC(lmdb)
 
        rc = mdb_env_sync(LMDB_IT(env), 1);
        if (rc) {
-                       php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+                       php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
                        return FAILURE;
        }
 
index 1bd0d069bf70c180b883b2b6c7d49a28ac46cbbb..55fbe56c9a30ec440877cde907962cf85c32c1ba 100644 (file)
@@ -287,7 +287,7 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
 
        if (idna_info != NULL) {
                if (variant == INTL_IDN_VARIANT_2003) {
-                       php_error_docref0(NULL, E_NOTICE,
+                       php_error_docref(NULL, E_NOTICE,
                                "4 arguments were provided, but INTL_IDNA_VARIANT_2003 only "
                                "takes 3 - extra argument ignored");
                } else {
index 695cc7d3ea1e5cffdea33a4965eba2e659be7051..b261f81f817d887d8c8576b1bdc0ae7e9fbce4cf 100644 (file)
@@ -505,7 +505,7 @@ U_CFUNC void timezone_register_IntlTimeZone_class(void)
        TimeZone_ce_ptr = zend_register_internal_class(&ce);
        if (!TimeZone_ce_ptr) {
                //can't happen now without bigger problems before
-               php_error_docref0(NULL, E_ERROR,
+               php_error_docref(NULL, E_ERROR,
                        "IntlTimeZone: class registration has failed.");
                return;
        }
index d5aac5df169a080a973f0f5a65f1820fce6e7861..4417fba4f0510e1d6af1efa5d3cd23c98bef2ad7 100644 (file)
@@ -241,7 +241,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
                ( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
                Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
        {
-               php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
+               php_error_docref(NULL, E_WARNING, "The property \"id\" is read-only" );
                retval = &EG( uninitialized_zval );
        }
        else
@@ -271,7 +271,7 @@ static zval *Transliterator_write_property( zval *object, zval *member, zval *va
                ( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
                Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
        {
-               php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
+               php_error_docref(NULL, E_WARNING, "The property \"id\" is read-only" );
        }
        else
        {
index 50dd344671a52c867b7eacbc54c4dcbd42755f25..f1518d80a167d0b65c89d492c772daf71c0d013d 100644 (file)
@@ -339,7 +339,7 @@ PHP_FUNCTION( transliterator_transliterate )
                        if( res == FAILURE )
                        {
                                zend_string *message = intl_error_get_message( NULL );
-                               php_error_docref0( NULL, E_WARNING, "Could not create "
+                               php_error_docref(NULL, E_WARNING, "Could not create "
                                        "transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), ZSTR_VAL(message) );
                                zend_string_free( message );
                                ZVAL_UNDEF(&tmp_object);
index cbddc9d096fb997e561d3f57446fbb62a3a4c546..b7dae45407cdd50c1380182156b03a5ebbbeacd3 100644 (file)
@@ -199,7 +199,7 @@ static void do_to_zval_err(res_context *ctx, const char *fmt, ...)
 void err_msg_dispose(struct err_s *err)
 {
        if (err->msg != NULL) {
-               php_error_docref0(NULL, err->level, "%s", err->msg);
+               php_error_docref(NULL, err->level, "%s", err->msg);
                if (err->should_free) {
                        efree(err->msg);
                }
index 27bee1edce327dd0ff277dd3ae6c17495a39f039..ce3cb79605ca201f33a34b28c292534c044e2b88 100644 (file)
@@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
 #define LONG_CHECK_VALID_INT(l) \
        do { \
                if ((l) < INT_MIN && (l) > INT_MAX) { \
-                       php_error_docref0(NULL, E_WARNING, "The value " ZEND_LONG_FMT " does not fit inside " \
+                       php_error_docref(NULL, E_WARNING, "The value " ZEND_LONG_FMT " does not fit inside " \
                                        "the boundaries of a native integer", (l)); \
                        return; \
                } \
@@ -292,14 +292,14 @@ PHP_FUNCTION(socket_cmsg_space)
        LONG_CHECK_VALID_INT(n);
 
        if (n < 0) {
-               php_error_docref0(NULL, E_WARNING, "The third argument "
+               php_error_docref(NULL, E_WARNING, "The third argument "
                                "cannot be negative");
                return;
        }
 
        entry = get_ancillary_reg_entry(level, type);
        if (entry == NULL) {
-               php_error_docref0(NULL, E_WARNING, "The pair level " ZEND_LONG_FMT "/type " ZEND_LONG_FMT " is "
+               php_error_docref(NULL, E_WARNING, "The pair level " ZEND_LONG_FMT "/type " ZEND_LONG_FMT " is "
                                "not supported by PHP", level, type);
                return;
        }
@@ -307,7 +307,7 @@ PHP_FUNCTION(socket_cmsg_space)
        if (entry->var_el_size > 0 && n > (zend_long)((ZEND_LONG_MAX - entry->size -
                        CMSG_SPACE(0) - 15L) / entry->var_el_size)) {
                /* the -15 is to account for any padding CMSG_SPACE may add after the data */
-               php_error_docref0(NULL, E_WARNING, "The value for the "
+               php_error_docref(NULL, E_WARNING, "The value for the "
                                "third argument (" ZEND_LONG_FMT ") is too large", n);
                return;
        }
@@ -331,7 +331,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
        case IPV6_PKTINFO:
 #ifdef PHP_WIN32
                if (Z_TYPE_P(arg4) == IS_ARRAY) {
-                       php_error_docref0(NULL, E_WARNING, "Windows does not "
+                       php_error_docref(NULL, E_WARNING, "Windows does not "
                                        "support sticky IPV6_PKTINFO");
                        return FAILURE;
                } else {
index 0de467978844efb317d740eaf9db771e6e49a022..a724338e4ad707b4015ce682046c26be0bb63d60 100644 (file)
@@ -1187,7 +1187,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle
 
        if (all) { /* replace with all named entities */
                if (CHARSET_PARTIAL_SUPPORT(charset)) {
-                       php_error_docref0(NULL, E_STRICT, "Only basic entities "
+                       php_error_docref(NULL, E_STRICT, "Only basic entities "
                                "substitution is supported for multi-byte encodings other than UTF-8; "
                                "functionality is equivalent to htmlspecialchars");
                }
index 18d0b43d3660609c5b483722c25dfe623c6709e4..48e0e1a7f761dc57f682e679a8094d5b69db2e1f 100644 (file)
@@ -1163,9 +1163,9 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
 }
 /* }}} */
 
-/* {{{ php_error_docref0 */
-/* See: CODING_STANDARDS.md for details. */
-PHPAPI ZEND_COLD void php_error_docref0(const char *docref, int type, const char *format, ...)
+/* {{{ php_error_docref */
+/* Generate an error which links to docref or the php.net documentation if docref is NULL */
+PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...)
 {
        va_list args;
 
index 4bc054539c6ca0ed392f4b0f082088e0f4cb385c..f8b1a3ca8e4a6c68f0b64fc58ecff142edfcab72 100644 (file)
@@ -339,7 +339,7 @@ static inline ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling() {}
 PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int type, const char *format, va_list args) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
 
 /* PHPAPI void php_error(int type, const char *format, ...); */
-PHPAPI ZEND_COLD void php_error_docref0(const char *docref, int type, const char *format, ...)
+PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...)
        PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
 PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...)
        PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
@@ -350,8 +350,6 @@ PHPAPI ZEND_COLD void php_win32_docref2_from_error(DWORD error, const char *para
 #endif
 END_EXTERN_C()
 
-#define php_error_docref php_error_docref0
-
 #define zenderror phperror
 #define zendlex phplex