diff options
author | Stanislav Malyshev <stas@php.net> | 2013-10-20 22:32:20 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2013-10-20 22:32:20 -0700 |
commit | ef9069b4ef71ecf1b514e7f8544f0d470e00dca5 (patch) | |
tree | 0d76d997d40e710754eb39b6483a8395a62064ae /ext/intl/locale | |
parent | 42cb9ac7a6b0a8df2ae9d44d33cd6e33b973de8e (diff) | |
download | php-git-ef9069b4ef71ecf1b514e7f8544f0d470e00dca5.tar.gz |
fix const warnings in intl methods
Diffstat (limited to 'ext/intl/locale')
-rw-r--r-- | ext/intl/locale/locale_methods.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 915f4d5af4..21b5847f2d 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -121,7 +121,7 @@ static int16_t findOffset(const char* const* list, const char* key) } /*}}}*/ -static char* getPreferredTag(char* gf_tag) +static char* getPreferredTag(const char* gf_tag) { char* result = NULL; int grOffset = 0; @@ -175,7 +175,7 @@ static int getStrrtokenPos(char* str, int savedPos) * returns -1 if no singleton * strtok equivalent search for singleton */ -static int getSingletonPos(char* str) +static int getSingletonPos(const char* str) { int result =-1; int i=0; @@ -251,7 +251,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default) * common code shared by get_primary_language,get_script or get_region or get_variant * result = 0 if error, 1 if successful , -1 if no value */ -static char* get_icu_value_internal( char* loc_name , char* tag_name, int* result , int fromParseLocale) +static char* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale) { char* tag_value = NULL; int32_t tag_value_len = 512; @@ -281,7 +281,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul /* Handle singletons */ if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){ - return loc_name; + return (char *)loc_name; } } @@ -370,7 +370,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; char* tag_value = NULL; @@ -465,10 +465,10 @@ PHP_FUNCTION(locale_get_primary_language ) }}} */ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; - char* disp_loc_name = NULL; + const char* disp_loc_name = NULL; int disp_loc_name_len = 0; int free_loc_name = 0; @@ -561,7 +561,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME efree( mod_loc_name ); } if (free_loc_name) { - efree(disp_loc_name); + efree((void *)disp_loc_name); disp_loc_name = NULL; } RETURN_FALSE; @@ -572,7 +572,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME efree( mod_loc_name ); } if (free_loc_name) { - efree(disp_loc_name); + efree((void *)disp_loc_name); disp_loc_name = NULL; } /* Convert display locale name from UTF-16 to UTF-8. */ @@ -666,10 +666,10 @@ PHP_FUNCTION( locale_get_keywords ) UEnumeration* e = NULL; UErrorCode status = U_ZERO_ERROR; - const char* kw_key = NULL; + const char* kw_key = NULL; int32_t kw_key_len = 0; - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; /* @@ -716,7 +716,7 @@ PHP_FUNCTION( locale_get_keywords ) kw_value = erealloc( kw_value , kw_value_len+1); } if (U_FAILURE(status)) { - intl_error_set( NULL, FAILURE, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC ); if( kw_value){ efree( kw_value ); } @@ -974,12 +974,12 @@ PHP_FUNCTION(locale_compose) * e.g. for locale='en_US-x-prv1-prv2-prv3' * returns a pointer to the string 'prv1-prv2-prv3' */ -static char* get_private_subtags(char* loc_name) +static char* get_private_subtags(const char* loc_name) { char* result =NULL; int singletonPos = 0; int len =0; - char* mod_loc_name =NULL; + const char* mod_loc_name =NULL; if( loc_name && (len = strlen(loc_name)>0 ) ){ mod_loc_name = loc_name ; @@ -1019,7 +1019,7 @@ static char* get_private_subtags(char* loc_name) /* {{{ code used by locale_parse */ -static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC) +static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC) { char* key_value = NULL; char* cur_key_name = NULL; @@ -1084,7 +1084,7 @@ static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS */ PHP_FUNCTION(locale_parse) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; int grOffset = 0; @@ -1128,8 +1128,8 @@ PHP_FUNCTION(locale_parse) */ PHP_FUNCTION(locale_get_all_variants) { - char* loc_name = NULL; - int loc_name_len = 0; + const char* loc_name = NULL; + int loc_name_len = 0; int result = 0; char* token = NULL; @@ -1182,10 +1182,10 @@ PHP_FUNCTION(locale_get_all_variants) /*{{{ * Converts to lower case and also replaces all hyphens with the underscore */ -static int strToMatch(char* str ,char *retstr) +static int strToMatch(const char* str ,char *retstr) { char* anchor = NULL; - char* anchor1 = NULL; + const char* anchor1 = NULL; int result = 0; int len = 0; @@ -1225,7 +1225,7 @@ PHP_FUNCTION(locale_filter_matches) { char* lang_tag = NULL; int lang_tag_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; int loc_range_len = 0; int result = 0; @@ -1401,7 +1401,7 @@ static void array_cleanup( char* arr[] , int arr_size) * returns the lookup result to lookup_loc_range_src_php * internal function */ -static char* lookup_loc_range(char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC) +static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC) { int i = 0; int cur_arr_len = 0; @@ -1523,7 +1523,7 @@ PHP_FUNCTION(locale_lookup) { char* fallback_loc = NULL; int fallback_loc_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; int loc_range_len = 0; zval* arr = NULL; |