summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-10-08 06:49:01 -0600
committerKarl Williamson <khw@cpan.org>2022-10-10 13:22:11 -0600
commitf41910bf9320ae3f1312f3e832504e8b03da3f00 (patch)
treef0d730d52ec211c288eda17a6020e4c41dd35d5d /utf8.c
parent7a615b719074d2537dcc9f9c87ef4b4795182579 (diff)
downloadperl-f41910bf9320ae3f1312f3e832504e8b03da3f00.tar.gz
handy.h: Set macro to false if can't ever be true
It's unlikely that perl will be compiled with out the LC_CTYPE locale category being enabled. But if it isn't, there is no sense in having per-interpreter variables for various conditions in it, and no sense having code that tests those variables. This commit changes a macro to always yield 'false' when this is disabled, adds a new similar macro, and changes some occurrences that test for a variable to use the macros instead of the variables. That way the compiler knows these to conditions can never be true.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index 28d8dae2dc..4de26a0211 100644
--- a/utf8.c
+++ b/utf8.c
@@ -3167,7 +3167,7 @@ Perl__to_uni_fold_flags(pTHX_ UV c, U8* p, STRLEN *lenp, U8 flags)
/* Treat a non-Turkic UTF-8 locale as not being in locale at all,
* except for potentially warning */
CHECK_AND_WARN_PROBLEMATIC_LOCALE_;
- if (IN_UTF8_CTYPE_LOCALE && ! PL_in_utf8_turkic_locale) {
+ if (IN_UTF8_CTYPE_LOCALE && ! IN_UTF8_TURKIC_LOCALE) {
flags &= ~FOLD_FLAGS_LOCALE;
}
else {
@@ -3720,7 +3720,7 @@ S_turkic_uc(pTHX_ const U8 * const p, const U8 * const e,
if (flags & (locale_flags)) { \
CHECK_AND_WARN_PROBLEMATIC_LOCALE_; \
if (IN_UTF8_CTYPE_LOCALE) { \
- if (UNLIKELY(PL_in_utf8_turkic_locale)) { \
+ if (UNLIKELY(IN_UTF8_TURKIC_LOCALE)) { \
UV ret = turkic(p, e, ustrp, lenp); \
if (ret) return ret; \
} \
@@ -4299,7 +4299,7 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, UV l1, bool u1,
if (flags & FOLDEQ_LOCALE) {
if (IN_UTF8_CTYPE_LOCALE) {
- if (UNLIKELY(PL_in_utf8_turkic_locale)) {
+ if (UNLIKELY(IN_UTF8_TURKIC_LOCALE)) {
flags_for_folder |= FOLD_FLAGS_LOCALE;
}
else {