diff options
Diffstat (limited to 'ext/intl/resourcebundle/resourcebundle_class.c')
-rw-r--r-- | ext/intl/resourcebundle/resourcebundle_class.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 7c1a5c28b8..dc1212431a 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -79,13 +79,11 @@ static zend_object_value ResourceBundle_object_create( zend_class_entry *ce TSRM /* {{{ ResourceBundle_ctor */ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char * bundlename; - int bundlename_len = 0; - char * locale; - int locale_len = 0; - zend_bool fallback = 1; - - char * pbuf; + const char *bundlename; + int bundlename_len = 0; + const char *locale; + int locale_len = 0; + zend_bool fallback = 1; zval *object = return_value; ResourceBundle_object *rb = (ResourceBundle_object *) zend_object_store_get_object( object TSRMLS_CC); @@ -104,7 +102,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); if (locale == NULL) { - locale = INTL_G(default_locale); + locale = intl_locale_get_default(TSRMLS_C); } if (fallback) { @@ -117,6 +115,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) { + char *pbuf; intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC); spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource " "'%s' without fallback from %s to %s", @@ -164,7 +163,6 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ { int32_t meindex = 0; char * mekey = NULL; - long mekeylen; zend_bool is_numeric = 0; char *pbuf; ResourceBundle_object *rb; @@ -178,7 +176,6 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ rb->child = ures_getByIndex( rb->me, meindex, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else if(Z_TYPE_P(offset) == IS_STRING) { mekey = Z_STRVAL_P(offset); - mekeylen = Z_STRLEN_P(offset); rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else { intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR, |