This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Use fcns instead of macros
authorKarl Williamson <khw@cpan.org>
Tue, 2 Jan 2018 01:33:59 +0000 (18:33 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 31 Jan 2018 05:27:25 +0000 (22:27 -0700)
Here the macros being used expand into the functions being called,
without adding any value to using the macros, and making things slightly
less clear.

locale.c

index 7e51913..c0d9463 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -547,10 +547,10 @@ S_new_ctype(pTHX_ const char *newctype)
         unsigned int bad_count = 0;         /* Count of bad characters */
 
         for (i = 0; i < 256; i++) {
-            if (isUPPER_LC((U8) i))
-                PL_fold_locale[i] = (U8) toLOWER_LC((U8) i);
-            else if (isLOWER_LC((U8) i))
-                PL_fold_locale[i] = (U8) toUPPER_LC((U8) i);
+            if (isupper(i))
+                PL_fold_locale[i] = (U8) tolower(i);
+            else if (islower(i))
+                PL_fold_locale[i] = (U8) toupper(i);
             else
                 PL_fold_locale[i] = (U8) i;