}
/*}}}*/
-static char* getPreferredTag(char* gf_tag)
+static char* getPreferredTag(const char* gf_tag)
{
char* result = NULL;
int grOffset = 0;
* 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;
* 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;
/* 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;
}
}
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;
}}} */
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;
efree( mod_loc_name );
}
if (free_loc_name) {
- efree(disp_loc_name);
+ efree((void *)disp_loc_name);
disp_loc_name = NULL;
}
RETURN_FALSE;
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. */
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;
/*
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 );
}
* 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 ;
/* {{{ 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;
*/
PHP_FUNCTION(locale_parse)
{
- char* loc_name = NULL;
+ const char* loc_name = NULL;
int loc_name_len = 0;
int grOffset = 0;
*/
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;
/*{{{
* 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;
{
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;
* 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;
{
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;