In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d7bcd45a8b00fa6be02a62e097629473b2a9becc?hp=393dcb6c04b49721349bf7dc3ca104cf64600045>

- Log -----------------------------------------------------------------
commit d7bcd45a8b00fa6be02a62e097629473b2a9becc
Author: Karl Williamson <[email protected]>
Date:   Wed Oct 2 16:43:50 2019 -0600

    utf8.h: Add comment

commit 009097b13d65a5e37b729c12f1bb088e7c3c7316
Author: Karl Williamson <[email protected]>
Date:   Wed Oct 2 16:40:44 2019 -0600

    utf8.h: Remove redundant cast
    
    The called macro does the cast already

commit cb15eeb248da9580d55c2a91ed5932642006573d
Author: Karl Williamson <[email protected]>
Date:   Wed Oct 2 16:37:17 2019 -0600

    utf8.h: Make sure macros not called with a ptr
    
    By doing an '| 0' with a parameter in a macro expansion, a C syntax
    error will be generated.  This is free protection.

commit 703512f58a2dc33b998199d89fec7b009f3be7aa
Author: Karl Williamson <[email protected]>
Date:   Wed Oct 2 16:23:39 2019 -0600

    t/TEST: Test most of CPAN on EBCDIC
    
    CPAN was mostly skipped before because so many distros raised errors,
    but that is no longer true, so just skip about 10 that have big
    problems, and test the rest

-----------------------------------------------------------------------

Summary of changes:
 t/TEST | 20 +++++++++++++++++---
 utf8.h | 22 ++++++++++++----------
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/t/TEST b/t/TEST
index a9c844f605..05cc065fa2 100755
--- a/t/TEST
+++ b/t/TEST
@@ -421,9 +421,23 @@ sub _tests_from_manifest {
                my $t = $1;
                my $extension = $2;
 
-               # XXX Generates way too many error lines currently.  Skip for
-               # v5.22
-               next if $t =~ /^cpan/ && ord("A") != 65;
+               next if ord "A" != 65
+                    && defined $extension
+                    && $extension =~ m! \b (?:
+                                               Archive-Tar/
+                                             | Config-Perl-V/
+                                             | CPAN-Meta/
+                                             | CPAN-Meta-YAML/
+                                             | Digest-SHA/
+                                             | ExtUtils-MakeMaker/
+                                             | HTTP-Tiny/
+                                             | IO-Compress/
+                                             | JSON-PP/
+                                             | libnet/
+                                             | MIME-Base64/
+                                             | podlators/
+                                           )
+                                      !x;
 
                if (!$::core || $t =~ m!^lib/[a-z]!) {
                    if (defined $extension) {
diff --git a/utf8.h b/utf8.h
index 0769d81a0a..472527c4a1 100644
--- a/utf8.h
+++ b/utf8.h
@@ -195,11 +195,11 @@ adding no time nor space requirements to the 
implementation.
 */
 
 #ifdef PERL_SMALL_MACRO_BUFFER
-#define NATIVE_TO_LATIN1(ch)     ((U8)(ch))
-#define LATIN1_TO_NATIVE(ch)     ((U8)(ch))
+#  define NATIVE_TO_LATIN1(ch)     ((U8)(ch))
+#  define LATIN1_TO_NATIVE(ch)     ((U8)(ch))
 #else
-#define NATIVE_TO_LATIN1(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
-#define LATIN1_TO_NATIVE(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#  define NATIVE_TO_LATIN1(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) 
| 0)))
+#  define LATIN1_TO_NATIVE(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) 
| 0)))
 #endif
 
 /* I8 is an intermediate version of UTF-8 used only in UTF-EBCDIC.  We thus
@@ -212,12 +212,12 @@ adding no time nor space requirements to the 
implementation.
 #define NATIVE_UTF8_TO_I8(ch) ((U8) (ch))
 #define I8_TO_NATIVE_UTF8(ch) ((U8) (ch))
 #else
-#define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
-#define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
+#define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
 #endif
 
-#define UNI_TO_NATIVE(ch)        ((UV) (ch))
-#define NATIVE_TO_UNI(ch)        ((UV) (ch))
+#define UNI_TO_NATIVE(ch)        ((UV) ((ch) | 0))
+#define NATIVE_TO_UNI(ch)        ((UV) ((ch) | 0))
 
 /*
 
@@ -355,7 +355,9 @@ C<cp> is Unicode if above 255; otherwise is platform-native.
 
 #endif /* EBCDIC vs ASCII */
 
-/* 2**UTF_ACCUMULATION_SHIFT - 1 */
+/* 2**UTF_ACCUMULATION_SHIFT - 1.  This masks out all but the bits that carry
+ * real information in a continuation byte.  This turns out to be 0x3F in
+ * UTF-8, 0x1F in UTF-EBCDIC. */
 #define UTF_CONTINUATION_MASK  ((U8) ((1U << UTF_ACCUMULATION_SHIFT) - 1))
 
 /* Internal macro to be used only in this file to aid in constructing other
@@ -475,7 +477,7 @@ encoded as UTF-8.  C<cp> is a native (ASCII or EBCDIC) code 
point if less than
  * code point in process of being generated */
 #define UTF8_ACCUMULATE(old, new) (__ASSERT_(FITS_IN_8_BITS(new))              
\
                                    ((old) << UTF_ACCUMULATION_SHIFT)           
\
-                                   | ((NATIVE_UTF8_TO_I8((U8)new))             
\
+                                   | ((NATIVE_UTF8_TO_I8(new))                 
\
                                        & UTF_CONTINUATION_MASK))
 
 /* This works in the face of malformed UTF-8. */

-- 
Perl5 Master Repository

Reply via email to