Skip to content

Commit

Permalink
locale.c: Change two #define names
Browse files Browse the repository at this point in the history
They will soon have a more general meaning than currently.
  • Loading branch information
khwilliamson committed Nov 20, 2023
1 parent 3f1904a commit 43e8061
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions locale.c
Expand Up @@ -5458,8 +5458,8 @@ S_my_localeconv(pTHX_ const int item)
* is supposed to use to get the key names to fill the hash with. One
* element is always for the NUMERIC strings (or NULL if none to use), and
* the other element similarly for the MONETARY ones. */
# define NUMERIC_STRING_OFFSET 0
# define MONETARY_STRING_OFFSET 1
# define NUMERIC_OFFSET 0
# define MONETARY_OFFSET 1
const lconv_offset_t * strings[2] = { NULL, NULL };

/* This is a mask, with one bit to tell S_populate_hash_from_localeconv to
Expand Down Expand Up @@ -5531,14 +5531,14 @@ S_my_localeconv(pTHX_ const int item)
case RADIXCHAR:
locale = numeric_locale = PL_numeric_name;
index_bits = INDEX_TO_BIT(LC_NUMERIC_INDEX_);
strings[NUMERIC_STRING_OFFSET] = DECIMAL_POINT_ADDRESS;
strings[NUMERIC_OFFSET] = DECIMAL_POINT_ADDRESS;
integers = NULL;
break;

case THOUSEP:
index_bits = INDEX_TO_BIT(LC_NUMERIC_INDEX_);
locale = numeric_locale = PL_numeric_name;
strings[NUMERIC_STRING_OFFSET] = thousands_sep_string;
strings[NUMERIC_OFFSET] = thousands_sep_string;
integers = NULL;
break;

Expand All @@ -5552,7 +5552,7 @@ S_my_localeconv(pTHX_ const int item)
/* This item needs the values for both the currency symbol, and
* another one used to construct the nl_langino()-compatible
* return. */
strings[MONETARY_STRING_OFFSET] = CURRENCY_SYMBOL_ADDRESS;
strings[MONETARY_OFFSET] = CURRENCY_SYMBOL_ADDRESS;
integers = P_CS_PRECEDES_ADDRESS;
break;

Expand Down Expand Up @@ -5594,8 +5594,8 @@ S_my_localeconv(pTHX_ const int item)

/* We always pass both sets of strings. 'index_bits' tells
* S_populate_hash_from_localeconv which to actually look at */
strings[NUMERIC_STRING_OFFSET] = lconv_numeric_strings;
strings[MONETARY_STRING_OFFSET] = lconv_monetary_strings;
strings[NUMERIC_OFFSET] = lconv_numeric_strings;
strings[MONETARY_OFFSET] = lconv_monetary_strings;

/* And pass the integer values to populate; again 'index_bits' will
* say to use them or not */
Expand Down Expand Up @@ -5671,7 +5671,7 @@ S_my_localeconv(pTHX_ const int item)
continue;
}

locale = (i == NUMERIC_STRING_OFFSET)
locale = (i == NUMERIC_OFFSET)
? numeric_locale
: monetary_locale;

Expand Down Expand Up @@ -5865,7 +5865,7 @@ S_populate_hash_from_localeconv(pTHX_ HV * hv,
/* One iteration is only for the numeric string fields. Skip these
* unless we are compiled to care about those fields and the input
* parameters indicate we want their values */
if ( i == NUMERIC_STRING_OFFSET
if ( i == NUMERIC_OFFSET

# ifdef USE_LOCALE_NUMERIC

Expand All @@ -5879,7 +5879,7 @@ S_populate_hash_from_localeconv(pTHX_ HV * hv,

/* The other iteration is only for the monetary string fields. Again
* skip it unless we want those values */
if ( i == MONETARY_STRING_OFFSET
if ( i == MONETARY_OFFSET

# ifdef USE_LOCALE_MONETARY

Expand Down Expand Up @@ -5912,7 +5912,7 @@ S_populate_hash_from_localeconv(pTHX_ HV * hv,
}

/* Add any int fields to the HV* */
if (i == MONETARY_STRING_OFFSET && integers) {
if (i == MONETARY_OFFSET && integers) {
while (integers->name) {
const char value = *((const char *)( lcbuf_as_string
+ integers->offset));
Expand Down

0 comments on commit 43e8061

Please sign in to comment.