[PHP-CVS] cvs: php-src(PHP_5_3) /ext/intl intl_data.h intl_error.c
stasSun May 10 19:10:37 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/intl intl_data.h intl_error.c Log: little errors cleanup http://cvs.php.net/viewvc.cgi/php-src/ext/intl/intl_data.h?r1=1.1.2.4r2=1.1.2.5diff_format=u Index: php-src/ext/intl/intl_data.h diff -u php-src/ext/intl/intl_data.h:1.1.2.4 php-src/ext/intl/intl_data.h:1.1.2.5 --- php-src/ext/intl/intl_data.h:1.1.2.4Thu Jan 29 21:49:49 2009 +++ php-src/ext/intl/intl_data.hSun May 10 19:10:36 2009 @@ -50,7 +50,7 @@ intl_error_set_code( NULL, (err) TSRMLS_CC ); \ if( U_FAILURE((err)) ) \ { \ -intl_errors_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ +intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ RETURN_FALSE; \ } http://cvs.php.net/viewvc.cgi/php-src/ext/intl/intl_error.c?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/intl/intl_error.c diff -u php-src/ext/intl/intl_error.c:1.1.2.2 php-src/ext/intl/intl_error.c:1.1.2.3 --- php-src/ext/intl/intl_error.c:1.1.2.2 Mon Aug 11 19:47:59 2008 +++ php-src/ext/intl/intl_error.c Sun May 10 19:10:36 2009 @@ -173,7 +173,9 @@ */ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC ) { - intl_error_set_code( err, code TSRMLS_CC ); + if(err) { + intl_error_set_code( err, code TSRMLS_CC ); + } intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); } /* }}} */ @@ -182,7 +184,9 @@ */ void intl_errors_reset( intl_error* err TSRMLS_DC ) { - intl_error_reset( err TSRMLS_CC ); + if(err) { + intl_error_reset( err TSRMLS_CC ); + } intl_error_reset( NULL TSRMLS_CC ); } /* }}} */ @@ -191,7 +195,9 @@ */ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ) { - intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + if(err) { + intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + } intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC ); } /* }}} */ @@ -200,7 +206,9 @@ */ void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ) { - intl_error_set_code( err, err_code TSRMLS_CC ); + if(err) { + intl_error_set_code( err, err_code TSRMLS_CC ); + } intl_error_set_code( NULL, err_code TSRMLS_CC ); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/intl intl_data.h
stasThu Jan 29 21:49:51 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/intl intl_data.h Log: fix // comments http://cvs.php.net/viewvc.cgi/php-src/ext/intl/intl_data.h?r1=1.1.2.3r2=1.1.2.4diff_format=u Index: php-src/ext/intl/intl_data.h diff -u php-src/ext/intl/intl_data.h:1.1.2.3 php-src/ext/intl/intl_data.h:1.1.2.4 --- php-src/ext/intl/intl_data.h:1.1.2.3Tue Jul 22 20:23:47 2008 +++ php-src/ext/intl/intl_data.hThu Jan 29 21:49:49 2009 @@ -45,7 +45,7 @@ obj = (oclass##_object *) zend_object_store_get_object( object TSRMLS_CC ); \ intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \ -// Check status by error code, if error - exit +/* Check status by error code, if error - exit */ #define INTL_CHECK_STATUS(err, msg) \ intl_error_set_code( NULL, (err) TSRMLS_CC ); \ if( U_FAILURE((err)) ) \ @@ -54,7 +54,7 @@ RETURN_FALSE; \ } -// Check status in object, if error - exit +/* Check status in object, if error - exit */ #define INTL_METHOD_CHECK_STATUS(obj, msg) \ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ @@ -63,7 +63,7 @@ RETURN_FALSE; \ } -// Check status, if error - destroy value and exit +/* Check status, if error - destroy value and exit */ #define INTL_CTOR_CHECK_STATUS(obj, msg) \ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/intl intl_data.h
stasMon Jul 14 06:42:11 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/intl intl_data.h Log: - increase max locale to 80 - add some macros http://cvs.php.net/viewvc.cgi/php-src/ext/intl/intl_data.h?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/intl/intl_data.h diff -u php-src/ext/intl/intl_data.h:1.1.2.1 php-src/ext/intl/intl_data.h:1.1.2.2 --- php-src/ext/intl/intl_data.h:1.1.2.1Mon Jul 7 22:51:02 2008 +++ php-src/ext/intl/intl_data.hMon Jul 14 06:42:11 2008 @@ -45,6 +45,16 @@ obj = (oclass##_object *) zend_object_store_get_object( object TSRMLS_CC ); \ intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \ +// Check status by error code, if error - exit +#define INTL_CHECK_STATUS(err, msg) \ +intl_error_set_code( NULL, (err) TSRMLS_CC ); \ +if( U_FAILURE((err)) ) \ +{ \ +intl_errors_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ +RETURN_FALSE; \ +} + +// Check status in object, if error - exit #define INTL_METHOD_CHECK_STATUS(obj, msg) \ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ @@ -53,6 +63,17 @@ RETURN_FALSE; \ } +// Check status, if error - destroy value and exit +#define INTL_CTOR_CHECK_STATUS(obj, msg, val) \ +intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ +if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ +{ \ +intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \ + zval_dtor((val)); \ + ZVAL_NULL((val)); \ +RETURN_NULL(); \ +} + #define INTL_METHOD_RETVAL_UTF8(obj, ustring, ulen, free_it) \ { \ char *u8value; \ @@ -65,19 +86,19 @@ RETVAL_STRINGL(u8value, u8len, 0); \ } -#define INTL_MAX_LOCALE_LEN 64 +#define INTL_MAX_LOCALE_LEN 80 #define INTL_CHECK_LOCALE_LEN(locale_len) \ if((locale_len) INTL_MAX_LOCALE_LEN) { \ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \ - Locale string too long, should be no longer than 64 characters, 0 TSRMLS_CC );\ + Locale string too long, should be no longer than 80 characters, 0 TSRMLS_CC );\ RETURN_NULL(); \ } #define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \ if((locale_len) INTL_MAX_LOCALE_LEN) {