Skip to content

Commit

Permalink
locale.c: Use macro created in previous commit
Browse files Browse the repository at this point in the history
This is a more general macro than these others, which can be rewritten
more simply in terms of it.
  • Loading branch information
khwilliamson committed Feb 7, 2024
1 parent 6c316c0 commit bc861f8
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc861f8

Please sign in to comment.