diff --git a/locale.c b/locale.c index ef759e09d6d6..80ec0607ac2b 100644 --- a/locale.c +++ b/locale.c @@ -1439,7 +1439,7 @@ S_parse_LC_ALL_string(pTHX_ const char * string, * will be C for each ignored category and "" for the others. Then the * caller can individually set each category, and get the right answer. */ if (single_component && ! isNAME_C_OR_POSIX(string)) { - for (locale_category_index i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { + for (unsigned int i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { OVERRIDE_AND_SAVEPV(string, strlen(string), output[i], i, override); } @@ -1585,8 +1585,8 @@ S_parse_LC_ALL_string(pTHX_ const char * string, # endif - { /* Here is the name=value notation */ - for (locale_category_index i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { + { + for (unsigned int i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { if (! seen[i]) { error = incomplete; goto failure; @@ -1612,7 +1612,7 @@ S_parse_LC_ALL_string(pTHX_ const char * string, failure: /* Don't leave memory dangling that we allocated before the failure */ - for (locale_category_index i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { + for (unsigned int i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { if (seen[i]) { Safefree(output[i]); output[i] = NULL; @@ -1753,7 +1753,7 @@ S_posix_setlocale_with_complications(pTHX_ const int cat, for result */ caller_line); - for (all_individual_category_indexes(i)) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { Safefree(new_locales[i]); } @@ -2938,7 +2938,7 @@ S_bool_setlocale_2008_i(pTHX_ /* Loop, using the previous iteration's result as the basis for the * next one. (The first time we effectively use the locale in * force upon entry to this function.) */ - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { new_obj = newlocale(category_masks[i], new_locales[i], basis_obj); @@ -2967,7 +2967,7 @@ S_bool_setlocale_2008_i(pTHX_ } /* Success for all categories. */ - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { update_PL_curlocales_i(i, new_locales[i], caller_line); Safefree(new_locales[i]); } @@ -3120,7 +3120,7 @@ S_update_PL_curlocales_i(pTHX_ # ifdef LC_ALL else { /* LC_ALL */ - for (locale_category_index i = 0; i <= LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i <= LC_ALL_INDEX_; i++) { Safefree(PL_curlocales[i]); PL_curlocales[i] = NULL; } @@ -3325,7 +3325,7 @@ S_calculate_LC_ALL_string(pTHX_ const char ** category_locales_list, /* The total length then is just the sum of the above boiler-plate plus the * total strlen()s of the locale name of each individual category. */ - for (locale_category_index i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { + for (unsigned int i = 0; i < LOCALE_CATEGORIES_COUNT_; i++) { const char * entry = ENTRY(i, locales_list, format); total_len += strlen(entry); @@ -4397,7 +4397,7 @@ S_new_LC_ALL(pTHX_ const char *unused, bool force) /* LC_ALL updates all the things we care about. */ - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { if (update_functions[i]) { const char * this_locale = querylocale_i(i); update_functions[i](aTHX_ this_locale, force); @@ -7133,7 +7133,7 @@ S_give_perl_locale_control(pTHX_ # else - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { void_setlocale_i_with_caller(i, locales[i], __FILE__, caller_line); } @@ -7174,7 +7174,7 @@ S_output_check_environment_warning(pTHX_ const char * const language, lc_all ? lc_all : "unset", lc_all ? '"' : ')'); - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { const char * value = PerlEnv_getenv(category_names[i]); PerlIO_printf(Perl_error_log, "\t%s = %c%s%c,\n", @@ -7530,7 +7530,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) # endif //for (unsigned int i = 0; i <= LC_ALL_INDEX_; i++) { - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { assert(category_name_lengths[i] == strlen(category_names[i])); } @@ -7548,7 +7548,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) wcrtomb(NULL, L'\0', &PL_wcrtomb_ps); # endif # ifdef EMULATE_THREAD_SAFE_LOCALES - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { PL_restore_locale[i] = NULL; } # endif @@ -7637,7 +7637,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) # endif # ifdef USE_PL_CURLOCALES - for (locale_category_index i = 0; i <= LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i <= LC_ALL_INDEX_; i++) { PL_curlocales[i] = savepv("C"); } @@ -9353,7 +9353,7 @@ Perl_switch_to_global_locale(pTHX) /* Set the global to what was our per-thread state */ POSIX_SETLOCALE_LOCK; - for (locale_category_index i = 0; i < LC_ALL_INDEX_; i++) { + for (unsigned int i = 0; i < LC_ALL_INDEX_; i++) { posix_setlocale(categories[i], cur_thread_locales[i]); } POSIX_SETLOCALE_UNLOCK;