From 2a2a278304af82ceea4e6d4694e202ca4a4ba975 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 16 Nov 2023 05:54:48 -0700 Subject: [PATCH] locale.c: Add braces, indent code 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. This commit also fixes white space on another line --- locale.c | 57 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/locale.c b/locale.c index 315393f7c893..ea374ff4717d 100644 --- a/locale.c +++ b/locale.c @@ -5313,7 +5313,7 @@ Perl_localeconv(pTHX) } -#if defined(HAS_LOCALECONV) +#if defined(HAS_LOCALECONV) HV * S_my_localeconv(pTHX_ const int item) @@ -5519,44 +5519,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() */