From bc861f8b3e5281e063a0785717f6d0a3e9c68f30 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 5 Feb 2024 07:37:07 -0700 Subject: [PATCH] locale.c: Use macro created in previous commit This is a more general macro than these others, which can be rewritten more simply in terms of it. --- locale.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/locale.c b/locale.c index 429171a3b76e..ec3411351ace 100644 --- a/locale.c +++ b/locale.c @@ -505,19 +505,11 @@ S_wsetlocale(const int category, const wchar_t * wlocale) i <= (locale_category_index) (n); \ i = (locale_category_index) ((int) i + 1)) #define for_all_individual_category_indexes(i) \ - for (locale_category_index i = (locale_category_index) 0; \ - i < LC_ALL_INDEX_; \ - i = (locale_category_index) ((int) i + 1)) - + for_category_indexes_between(i, 0, LC_ALL_INDEX_ - 1) #define for_all_but_0th_individual_category_indexes(i) \ - for (locale_category_index i = (locale_category_index) 1; \ - i < LC_ALL_INDEX_; \ - i = (locale_category_index) ((int) i + 1)) - + for_category_indexes_between(i, 1, LC_ALL_INDEX_ - 1) #define for_all_category_indexes(i) \ - for (locale_category_index i = (locale_category_index) 0; \ - i <= LC_ALL_INDEX_; \ - i = (locale_category_index) ((int) i + 1)) + for_category_indexes_between(i, 0, LC_ALL_INDEX_) #ifdef USE_LOCALE # if defined(USE_FAKE_LC_ALL_POSITIONAL_NOTATION) && defined(LC_ALL)