Skip to content

Commit

Permalink
locale.c: Make a mask be 1, 2, or 3.
Browse files Browse the repository at this point in the history
This makes the two bits that ever get set in this mask to be positions 0
and 1.
  • Loading branch information
khwilliamson committed Nov 13, 2023
1 parent 1c8ebe6 commit eb89238
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions locale.c
Expand Up @@ -5455,12 +5455,13 @@ S_my_localeconv(pTHX_ const int item)

/* This is a mask, with one bit to tell S_populate_hash_from_localeconv to
* populate the NUMERIC items; another bit for the MONETARY ones. This way
* it can choose which (or both) to populate from */
* it can choose which (or both) to populate from. */
U32 index_bits = 0;

/* This converts from a locale index to its bit position in the above mask.
* */
# define INDEX_TO_BIT(i) (1 << (i))
# define INDEX_TO_BIT(i) (1 << ((i) - LC_NUMERIC_INDEX_))
STATIC_ASSERT_STMT(LC_MONETARY_INDEX_ == LC_NUMERIC_INDEX_ + 1);

/* The two categories can have disparate locales. Initialize them to C and
* override later whichever one(s) we pay attention to */
Expand Down

0 comments on commit eb89238

Please sign in to comment.