Convert all php_error_docref0 to php_error_docref

Closes GH-4394
This commit is contained in:
George Peter Banyard 2019-07-13 02:05:17 +02:00 committed by Peter Kokot
parent 33994ebd95
commit 1c1de0c41a
10 changed files with 22 additions and 24 deletions

View file

@ -251,14 +251,14 @@ DBA_FIRSTKEY_FUNC(lmdb)
rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn)); rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn));
if (rc) { if (rc) {
php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc)); php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return NULL; return NULL;
} }
rc = mdb_cursor_open(LMDB_IT(txn), LMDB_IT(dbi), &LMDB_IT(cur)); rc = mdb_cursor_open(LMDB_IT(txn), LMDB_IT(dbi), &LMDB_IT(cur));
if (rc) { if (rc) {
mdb_txn_abort(LMDB_IT(txn)); 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; return NULL;
} }
@ -268,7 +268,7 @@ DBA_FIRSTKEY_FUNC(lmdb)
mdb_cursor_close(LMDB_IT(cur)); mdb_cursor_close(LMDB_IT(cur));
LMDB_IT(cur) = NULL; LMDB_IT(cur) = NULL;
if (MDB_NOTFOUND != rc) { 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; return NULL;
} }
@ -291,7 +291,7 @@ DBA_NEXTKEY_FUNC(lmdb)
rc = mdb_txn_renew(LMDB_IT(txn)); rc = mdb_txn_renew(LMDB_IT(txn));
if (rc) { if (rc) {
php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc)); php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return NULL; return NULL;
} }
@ -301,7 +301,7 @@ DBA_NEXTKEY_FUNC(lmdb)
mdb_cursor_close(LMDB_IT(cur)); mdb_cursor_close(LMDB_IT(cur));
LMDB_IT(cur) = NULL; LMDB_IT(cur) = NULL;
if (MDB_NOTFOUND != rc) { 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; return NULL;
} }
@ -327,7 +327,7 @@ DBA_SYNC_FUNC(lmdb)
rc = mdb_env_sync(LMDB_IT(env), 1); rc = mdb_env_sync(LMDB_IT(env), 1);
if (rc) { if (rc) {
php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc)); php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return FAILURE; return FAILURE;
} }

View file

@ -287,7 +287,7 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (idna_info != NULL) { if (idna_info != NULL) {
if (variant == INTL_IDN_VARIANT_2003) { 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 " "4 arguments were provided, but INTL_IDNA_VARIANT_2003 only "
"takes 3 - extra argument ignored"); "takes 3 - extra argument ignored");
} else { } else {

View file

@ -505,7 +505,7 @@ U_CFUNC void timezone_register_IntlTimeZone_class(void)
TimeZone_ce_ptr = zend_register_internal_class(&ce); TimeZone_ce_ptr = zend_register_internal_class(&ce);
if (!TimeZone_ce_ptr) { if (!TimeZone_ce_ptr) {
//can't happen now without bigger problems before //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."); "IntlTimeZone: class registration has failed.");
return; return;
} }

View file

@ -241,7 +241,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
( zend_binary_strcmp( "id", sizeof( "id" ) - 1, ( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) 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 ); retval = &EG( uninitialized_zval );
} }
else else
@ -271,7 +271,7 @@ static zval *Transliterator_write_property( zval *object, zval *member, zval *va
( zend_binary_strcmp( "id", sizeof( "id" ) - 1, ( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) 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 else
{ {

View file

@ -339,7 +339,7 @@ PHP_FUNCTION( transliterator_transliterate )
if( res == FAILURE ) if( res == FAILURE )
{ {
zend_string *message = intl_error_get_message( NULL ); 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) ); "transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), ZSTR_VAL(message) );
zend_string_free( message ); zend_string_free( message );
ZVAL_UNDEF(&tmp_object); ZVAL_UNDEF(&tmp_object);

View 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) void err_msg_dispose(struct err_s *err)
{ {
if (err->msg != NULL) { 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) { if (err->should_free) {
efree(err->msg); efree(err->msg);
} }

View file

@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
#define LONG_CHECK_VALID_INT(l) \ #define LONG_CHECK_VALID_INT(l) \
do { \ do { \
if ((l) < INT_MIN && (l) > INT_MAX) { \ 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)); \ "the boundaries of a native integer", (l)); \
return; \ return; \
} \ } \
@ -292,14 +292,14 @@ PHP_FUNCTION(socket_cmsg_space)
LONG_CHECK_VALID_INT(n); LONG_CHECK_VALID_INT(n);
if (n < 0) { if (n < 0) {
php_error_docref0(NULL, E_WARNING, "The third argument " php_error_docref(NULL, E_WARNING, "The third argument "
"cannot be negative"); "cannot be negative");
return; return;
} }
entry = get_ancillary_reg_entry(level, type); entry = get_ancillary_reg_entry(level, type);
if (entry == NULL) { 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); "not supported by PHP", level, type);
return; return;
} }
@ -307,7 +307,7 @@ PHP_FUNCTION(socket_cmsg_space)
if (entry->var_el_size > 0 && n > (zend_long)((ZEND_LONG_MAX - entry->size - if (entry->var_el_size > 0 && n > (zend_long)((ZEND_LONG_MAX - entry->size -
CMSG_SPACE(0) - 15L) / entry->var_el_size)) { CMSG_SPACE(0) - 15L) / entry->var_el_size)) {
/* the -15 is to account for any padding CMSG_SPACE may add after the data */ /* 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); "third argument (" ZEND_LONG_FMT ") is too large", n);
return; return;
} }
@ -331,7 +331,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
case IPV6_PKTINFO: case IPV6_PKTINFO:
#ifdef PHP_WIN32 #ifdef PHP_WIN32
if (Z_TYPE_P(arg4) == IS_ARRAY) { 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"); "support sticky IPV6_PKTINFO");
return FAILURE; return FAILURE;
} else { } else {

View 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 (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) { 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; " "substitution is supported for multi-byte encodings other than UTF-8; "
"functionality is equivalent to htmlspecialchars"); "functionality is equivalent to htmlspecialchars");
} }

View file

@ -1163,9 +1163,9 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
} }
/* }}} */ /* }}} */
/* {{{ php_error_docref0 */ /* {{{ php_error_docref */
/* See: CODING_STANDARDS.md for details. */ /* Generate an error which links to docref or the php.net documentation if docref is NULL */
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, ...)
{ {
va_list args; va_list args;

View 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 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 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); PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...) PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, 4, 5); 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 #endif
END_EXTERN_C() END_EXTERN_C()
#define php_error_docref php_error_docref0
#define zenderror phperror #define zenderror phperror
#define zendlex phplex #define zendlex phplex