utf8.c: Use U8 instead of UV in several places
authorKarl Williamson <public@khwilliamson.com>
Sun, 1 Dec 2013 17:43:39 +0000 (10:43 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 3 Dec 2013 17:05:23 +0000 (10:05 -0700)
These temporaries are all known to fit into 8 bits; by using a U8 it
should be more obvious to an optimizing compiler, and so the bounds
checking need not be done.

utf8.c

index debe0e9..e33effe 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -2587,7 +2587,7 @@ Perl__to_utf8_upper_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, const bool
     }
     else if UTF8_IS_DOWNGRADEABLE_START(*p) {
        if (flags) {
-            UV c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
+            U8 c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
            result = toUPPER_LC(c);
        }
        else {
@@ -2654,7 +2654,7 @@ Perl__to_utf8_title_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, const bool
     }
     else if UTF8_IS_DOWNGRADEABLE_START(*p) {
        if (flags) {
-            UV c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
+            U8 c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
            result = toUPPER_LC(c);
        }
        else {
@@ -2719,7 +2719,7 @@ Perl__to_utf8_lower_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, const bool
     }
     else if UTF8_IS_DOWNGRADEABLE_START(*p) {
        if (flags) {
-            UV c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
+            U8 c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
            result = toLOWER_LC(c);
        }
        else {
@@ -2798,7 +2798,7 @@ Perl__to_utf8_fold_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, U8 flags, b
     }
     else if UTF8_IS_DOWNGRADEABLE_START(*p) {
        if (flags & FOLD_FLAGS_LOCALE) {
-            UV c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
+            U8 c = TWO_BYTE_UTF8_TO_NATIVE(*p, *(p+1));
            result = toFOLD_LC(c);
        }
        else {