diff options
author | Karl Williamson <khw@cpan.org> | 2022-10-08 06:49:01 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-10-10 13:22:11 -0600 |
commit | f41910bf9320ae3f1312f3e832504e8b03da3f00 (patch) | |
tree | f0d730d52ec211c288eda17a6020e4c41dd35d5d /regexec.c | |
parent | 7a615b719074d2537dcc9f9c87ef4b4795182579 (diff) | |
download | perl-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 'regexec.c')
-rw-r--r-- | regexec.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4623,7 +4623,7 @@ S_setup_EXACTISH_ST(pTHX_ const regnode * const text_node, if ( (op == EXACTF && utf8_target) || (op == EXACTFL && IN_UTF8_CTYPE_LOCALE)) { - if (op == EXACTFL && PL_in_utf8_turkic_locale) { + if (op == EXACTFL && IN_UTF8_TURKIC_LOCALE) { op = TURKISH; } else { @@ -10823,7 +10823,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const } else /* Failing that, hardcode the two tests for a Turkic locale */ - if ( UNLIKELY(PL_in_utf8_turkic_locale) + if ( UNLIKELY(IN_UTF8_TURKIC_LOCALE) && isALPHA_FOLD_EQ(*p, 'i')) { /* Turkish locales have these hard-coded rules @@ -10854,7 +10854,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const /* In a Turkic locale under folding, hard-code the I i case pair * matches; these wouldn't have the ANYOF_HAS_EXTRA_RUNTIME_MATCHES * flag set unless [Ii] were match possibilities */ - if (UNLIKELY(PL_in_utf8_turkic_locale) && ! match) { + if (UNLIKELY(IN_UTF8_TURKIC_LOCALE) && ! match) { if (utf8_target) { if (c == LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE) { if (ANYOF_BITMAP_TEST(n, 'i')) { |