Skip to content

Commit

Permalink
locale.c: Add braces, indent code only
Browse files Browse the repository at this point in the history
Prior to this commit, the 'switch' immediately followed the 'if' without
a left brace for the 'if'.  This conserved indentation and was feasible
because the scopes were identical..  But a future commit will want to have the scope of the 'if' be larger than that of the 'switch', so add the braces for the 'if' and indent the 'switch' code.
  • Loading branch information
khwilliamson committed Nov 17, 2023
1 parent f87a4c5 commit 55182ce
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions locale.c
Expand Up @@ -5530,44 +5530,47 @@ S_my_localeconv(pTHX_ const int item)
*
* For each, set up the appropriate parameters for the call below to
* S_populate_hash_from_localeconv() */
if (item != 0) switch (item) {
default:
locale_panic_(Perl_form(aTHX_
"Unexpected item passed to my_localeconv: %d", item));
break;
if (item != 0) {
switch (item) {
default:
locale_panic_(Perl_form(aTHX_
"Unexpected item passed to my_localeconv: %d", item));
break;

# ifdef USE_LOCALE_NUMERIC

case RADIXCHAR:
locale = numeric_locale = PL_numeric_name;
index_bits = INDEX_TO_BIT(LC_NUMERIC_INDEX_);
strings[NUMERIC_STRING_OFFSET] = DECIMAL_POINT_ADDRESS;
integers = NULL;
break;
case RADIXCHAR:
locale = numeric_locale = PL_numeric_name;
index_bits = INDEX_TO_BIT(LC_NUMERIC_INDEX_);
strings[NUMERIC_STRING_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;
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;
integers = NULL;
break;

# endif
# ifdef USE_LOCALE_MONETARY

case CRNCYSTR:
index_bits = INDEX_TO_BIT(LC_MONETARY_INDEX_);
locale = monetary_locale = querylocale_i(LC_MONETARY_INDEX_);
case CRNCYSTR:
index_bits = INDEX_TO_BIT(LC_MONETARY_INDEX_);
locale = monetary_locale = querylocale_i(LC_MONETARY_INDEX_);

/* 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;
integers = P_CS_PRECEDES_ADDRESS;
break;
/* 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;
integers = P_CS_PRECEDES_ADDRESS;
break;

# endif

} /* End of switch() */
} /* End of switch() */
}

else /* End of for just one item to emulate nl_langinfo() */

Expand Down

0 comments on commit 55182ce

Please sign in to comment.