summaryrefslogtreecommitdiff
path: root/ext/intl/intl_error.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-04-02 18:52:32 +0200
committerNikita Popov <nikic@php.net>2015-04-06 11:27:34 +0200
commit122d759618a42bff105971b923fbbb5be02e34b9 (patch)
treefd4487414ffa3f120c77b19b9eb7dc409659c57e /ext/intl/intl_error.c
parent884b0365dbe718f667d048dbc3d1cd9d9f12ab84 (diff)
downloadphp-git-122d759618a42bff105971b923fbbb5be02e34b9.tar.gz
Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to report FAILURE errors using a TypeException instead of a Warning, like it would happen in strict mode. Adds a zend_parse_parameters_throw() convenience function, which invokes zpp with this flag. Converts all cases I could identify, where we currently have throwing zpp usage in constructors and replaces them with this API. Error handling is still replaced to EH_THROW in some cases to handle other, domain-specific errors in constructors.
Diffstat (limited to 'ext/intl/intl_error.c')
-rw-r--r--ext/intl/intl_error.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index a946705a76..adbdd5afb8 100644
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -101,7 +101,7 @@ void intl_error_reset( intl_error* err )
/* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
* Set last error message to msg copying it if needed.
*/
-void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
+void intl_error_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
{
if( !msg )
return;
@@ -122,7 +122,7 @@ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
err->free_custom_error_message = copyMsg;
/* Set user's error text message */
- err->custom_error_message = copyMsg ? estrdup( msg ) : msg;
+ err->custom_error_message = copyMsg ? estrdup( msg ) : (char *) msg;
}
/* }}} */
@@ -180,7 +180,7 @@ UErrorCode intl_error_get_code( intl_error* err )
/* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
+void intl_error_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg )
{
intl_error_set_code( err, code );
intl_error_set_custom_msg( err, msg, copyMsg );
@@ -190,7 +190,7 @@ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
/* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
+void intl_errors_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg )
{
intl_errors_set_code( err, code );
intl_errors_set_custom_msg( err, msg, copyMsg );
@@ -210,7 +210,7 @@ void intl_errors_reset( intl_error* err )
/* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
*/
-void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
+void intl_errors_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
{
if(err) {
intl_error_set_custom_msg( err, msg, copyMsg );