@@ -121,7 +121,7 @@ static int16_t findOffset(const char* const* list, const char* key)
121
121
}
122
122
/*}}}*/
123
123
124
- static char * getPreferredTag (char * gf_tag )
124
+ static char * getPreferredTag (const char * gf_tag )
125
125
{
126
126
char * result = NULL ;
127
127
int grOffset = 0 ;
@@ -175,7 +175,7 @@ static int getStrrtokenPos(char* str, int savedPos)
175
175
* returns -1 if no singleton
176
176
* strtok equivalent search for singleton
177
177
*/
178
- static int getSingletonPos (char * str )
178
+ static int getSingletonPos (const char * str )
179
179
{
180
180
int result = -1 ;
181
181
int i = 0 ;
@@ -251,7 +251,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
251
251
* common code shared by get_primary_language,get_script or get_region or get_variant
252
252
* result = 0 if error, 1 if successful , -1 if no value
253
253
*/
254
- static char * get_icu_value_internal ( char * loc_name , char * tag_name , int * result , int fromParseLocale )
254
+ static char * get_icu_value_internal ( const char * loc_name , char * tag_name , int * result , int fromParseLocale )
255
255
{
256
256
char * tag_value = NULL ;
257
257
int32_t tag_value_len = 512 ;
@@ -281,7 +281,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
281
281
/* Handle singletons */
282
282
if ( strcmp (tag_name , LOC_LANG_TAG )== 0 ){
283
283
if ( strlen (loc_name )> 1 && (isIDPrefix (loc_name ) == 1 ) ){
284
- return loc_name ;
284
+ return ( char * ) loc_name ;
285
285
}
286
286
}
287
287
@@ -370,7 +370,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
370
370
static void get_icu_value_src_php ( char * tag_name , INTERNAL_FUNCTION_PARAMETERS )
371
371
{
372
372
373
- char * loc_name = NULL ;
373
+ const char * loc_name = NULL ;
374
374
int loc_name_len = 0 ;
375
375
376
376
char * tag_value = NULL ;
@@ -465,10 +465,10 @@ PHP_FUNCTION(locale_get_primary_language )
465
465
}}} */
466
466
static void get_icu_disp_value_src_php ( char * tag_name , INTERNAL_FUNCTION_PARAMETERS )
467
467
{
468
- char * loc_name = NULL ;
468
+ const char * loc_name = NULL ;
469
469
int loc_name_len = 0 ;
470
470
471
- char * disp_loc_name = NULL ;
471
+ const char * disp_loc_name = NULL ;
472
472
int disp_loc_name_len = 0 ;
473
473
int free_loc_name = 0 ;
474
474
@@ -561,7 +561,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
561
561
efree ( mod_loc_name );
562
562
}
563
563
if (free_loc_name ) {
564
- efree (disp_loc_name );
564
+ efree (( void * ) disp_loc_name );
565
565
disp_loc_name = NULL ;
566
566
}
567
567
RETURN_FALSE ;
@@ -572,7 +572,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
572
572
efree ( mod_loc_name );
573
573
}
574
574
if (free_loc_name ) {
575
- efree (disp_loc_name );
575
+ efree (( void * ) disp_loc_name );
576
576
disp_loc_name = NULL ;
577
577
}
578
578
/* Convert display locale name from UTF-16 to UTF-8. */
@@ -666,10 +666,10 @@ PHP_FUNCTION( locale_get_keywords )
666
666
UEnumeration * e = NULL ;
667
667
UErrorCode status = U_ZERO_ERROR ;
668
668
669
- const char * kw_key = NULL ;
669
+ const char * kw_key = NULL ;
670
670
int32_t kw_key_len = 0 ;
671
671
672
- char * loc_name = NULL ;
672
+ const char * loc_name = NULL ;
673
673
int loc_name_len = 0 ;
674
674
675
675
/*
@@ -716,7 +716,7 @@ PHP_FUNCTION( locale_get_keywords )
716
716
kw_value = erealloc ( kw_value , kw_value_len + 1 );
717
717
}
718
718
if (U_FAILURE (status )) {
719
- intl_error_set ( NULL , FAILURE , "locale_get_keywords: Error encountered while getting the keyword value for the keyword" , 0 TSRMLS_CC );
719
+ intl_error_set ( NULL , U_ILLEGAL_ARGUMENT_ERROR , "locale_get_keywords: Error encountered while getting the keyword value for the keyword" , 0 TSRMLS_CC );
720
720
if ( kw_value ){
721
721
efree ( kw_value );
722
722
}
@@ -974,12 +974,12 @@ PHP_FUNCTION(locale_compose)
974
974
* e.g. for locale='en_US-x-prv1-prv2-prv3'
975
975
* returns a pointer to the string 'prv1-prv2-prv3'
976
976
*/
977
- static char * get_private_subtags (char * loc_name )
977
+ static char * get_private_subtags (const char * loc_name )
978
978
{
979
979
char * result = NULL ;
980
980
int singletonPos = 0 ;
981
981
int len = 0 ;
982
- char * mod_loc_name = NULL ;
982
+ const char * mod_loc_name = NULL ;
983
983
984
984
if ( loc_name && (len = strlen (loc_name )> 0 ) ){
985
985
mod_loc_name = loc_name ;
@@ -1019,7 +1019,7 @@ static char* get_private_subtags(char* loc_name)
1019
1019
1020
1020
/* {{{ code used by locale_parse
1021
1021
*/
1022
- static int add_array_entry (char * loc_name , zval * hash_arr , char * key_name TSRMLS_DC )
1022
+ static int add_array_entry (const char * loc_name , zval * hash_arr , char * key_name TSRMLS_DC )
1023
1023
{
1024
1024
char * key_value = NULL ;
1025
1025
char * cur_key_name = NULL ;
@@ -1084,7 +1084,7 @@ static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS
1084
1084
*/
1085
1085
PHP_FUNCTION (locale_parse )
1086
1086
{
1087
- char * loc_name = NULL ;
1087
+ const char * loc_name = NULL ;
1088
1088
int loc_name_len = 0 ;
1089
1089
int grOffset = 0 ;
1090
1090
@@ -1128,8 +1128,8 @@ PHP_FUNCTION(locale_parse)
1128
1128
*/
1129
1129
PHP_FUNCTION (locale_get_all_variants )
1130
1130
{
1131
- char * loc_name = NULL ;
1132
- int loc_name_len = 0 ;
1131
+ const char * loc_name = NULL ;
1132
+ int loc_name_len = 0 ;
1133
1133
1134
1134
int result = 0 ;
1135
1135
char * token = NULL ;
@@ -1182,10 +1182,10 @@ PHP_FUNCTION(locale_get_all_variants)
1182
1182
/*{{{
1183
1183
* Converts to lower case and also replaces all hyphens with the underscore
1184
1184
*/
1185
- static int strToMatch (char * str ,char * retstr )
1185
+ static int strToMatch (const char * str ,char * retstr )
1186
1186
{
1187
1187
char * anchor = NULL ;
1188
- char * anchor1 = NULL ;
1188
+ const char * anchor1 = NULL ;
1189
1189
int result = 0 ;
1190
1190
int len = 0 ;
1191
1191
@@ -1225,7 +1225,7 @@ PHP_FUNCTION(locale_filter_matches)
1225
1225
{
1226
1226
char * lang_tag = NULL ;
1227
1227
int lang_tag_len = 0 ;
1228
- char * loc_range = NULL ;
1228
+ const char * loc_range = NULL ;
1229
1229
int loc_range_len = 0 ;
1230
1230
1231
1231
int result = 0 ;
@@ -1401,7 +1401,7 @@ static void array_cleanup( char* arr[] , int arr_size)
1401
1401
* returns the lookup result to lookup_loc_range_src_php
1402
1402
* internal function
1403
1403
*/
1404
- static char * lookup_loc_range (char * loc_range , HashTable * hash_arr , int canonicalize TSRMLS_DC )
1404
+ static char * lookup_loc_range (const char * loc_range , HashTable * hash_arr , int canonicalize TSRMLS_DC )
1405
1405
{
1406
1406
int i = 0 ;
1407
1407
int cur_arr_len = 0 ;
@@ -1523,7 +1523,7 @@ PHP_FUNCTION(locale_lookup)
1523
1523
{
1524
1524
char * fallback_loc = NULL ;
1525
1525
int fallback_loc_len = 0 ;
1526
- char * loc_range = NULL ;
1526
+ const char * loc_range = NULL ;
1527
1527
int loc_range_len = 0 ;
1528
1528
1529
1529
zval * arr = NULL ;
0 commit comments