In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/430c976074344a2860603292d71247b4312c350c?hp=235c1d5fb08d2f9bf82de88220390de5210ac392>

- Log -----------------------------------------------------------------
commit 430c976074344a2860603292d71247b4312c350c
Author: Karl Williamson <[email protected]>
Date:   Fri Jul 25 14:57:33 2014 -0600

    utf8.c: Use slightly more efficient macro
    
    Lowercasing a Latin-1 range character results in a latin-1 range
    character, so we can use the more restrictive macros that is slightly
    more efficient than the general ones.  (This difference only is
    applicable on EBCDIC platforms, as the macros all expand to nothing on
    ASCII ones.

M       utf8.c

commit 63a63d815c2be027c1e8f91a5698c3498dd2b488
Author: Karl Williamson <[email protected]>
Date:   Fri Jul 25 14:56:46 2014 -0600

    perlop: Update to reflect 5.20 changes
    
    Some deprecations have become fatal in v5.20

M       pod/perlop.pod

commit c3e9d7a98ad8340994f5f9d9ddf6c792f0875b81
Author: Karl Williamson <[email protected]>
Date:   Fri Jul 25 14:44:46 2014 -0600

    perlop: Nits

M       pod/perlop.pod

commit 7ea906bb370ef79b0aee20cbb8768c72eb0d22c6
Author: Karl Williamson <[email protected]>
Date:   Fri Jul 25 11:31:26 2014 -0600

    perlop: Update text to reflect code changes
    
    The warning message is no longer misleading, so no need to point out
    anything about it.

M       pod/perlop.pod
-----------------------------------------------------------------------

Summary of changes:
 pod/perlop.pod | 27 ++++++++++++---------------
 utf8.c         |  6 ++++--
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/pod/perlop.pod b/pod/perlop.pod
index 0535bfd..f00c134 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -1434,10 +1434,12 @@ table:
    \c[      chr(27)
    \c]      chr(29)
    \c^      chr(30)
-   \c?      chr(127)
+   \c_      chr(31)
+   \c?      chr(127) # (on ASCII platforms)
 
 In other words, it's the character whose code point has had 64 xor'd with
-its uppercase.  C<\c?> is DELETE because C<ord("?") ^ 64> is 127, and
+its uppercase.  C<\c?> is DELETE on ASCII platforms because
+S<C<ord("?") ^ 64>> is 127, and
 C<\c@> is NULL because the ord of "@" is 64, so xor'ing 64 itself produces 0.
 
 Also, C<\c\I<X>> yields C< chr(28) . "I<X>"> for any I<X>, but cannot come at 
the
@@ -1446,14 +1448,15 @@ quote.
 
 On ASCII platforms, the resulting characters from the list above are the
 complete set of ASCII controls.  This isn't the case on EBCDIC platforms; see
-L<perlebcdic/OPERATOR DIFFERENCES> for the complete list of what these
-sequences mean on both ASCII and EBCDIC platforms.
+L<perlebcdic/OPERATOR DIFFERENCES> for a full discussion of the
+differences between these for ASCII versus EBCDIC platforms.
 
-Use of any other character following the "c" besides those listed above is
-discouraged, and some are deprecated with the intention of removing
-those in a later Perl version.  What happens for any of these
-other characters currently though, is that the value is derived by xor'ing
-with the seventh bit, which is 64.
+Use of any other character following the C<"c"> besides those listed above is
+discouraged, and as of Perl v5.20, the only characters actually allowed
+are the printable ASCII ones, minus the left brace C<"{">.  What happens
+for any of the allowed other characters is that the value is derived by
+xor'ing with the seventh bit, which is 64, and a warning raised if
+enabled.  Using the non-allowed characters generates a fatal error.
 
 To get platform independent controls, you can use C<\N{...}>.
 
@@ -1483,12 +1486,6 @@ the left with zeros to make three digits.  For larger 
ordinals, either use
 C<\o{}>, or convert to something else, such as to hex and use C<\x{}>
 instead.
 
-Having fewer than 3 digits may lead to a misleading warning message that says
-that what follows is ignored.  For example, C<"\128"> in the ASCII character 
set
-is equivalent to the two characters C<"\n8">, but the warning C<Illegal octal
-digit '8' ignored> will be thrown.  If C<"\n8"> is what you want, you can
-avoid this warning by padding your octal number with C<0>'s: C<"\0128">.
-
 =item [8]
 
 Several constructs above specify a character by a number.  That number
diff --git a/utf8.c b/utf8.c
index aa63504..bfde692 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1495,8 +1495,10 @@ S_to_lower_latin1(const U8 c, U8* p, STRLEN *lenp)
            *lenp = 1;
        }
        else {
-           *p = UTF8_TWO_BYTE_HI(converted);
-           *(p+1) = UTF8_TWO_BYTE_LO(converted);
+            /* Result is known to always be < 256, so can use the EIGHT_BIT
+             * macros */
+           *p = UTF8_EIGHT_BIT_HI(converted);
+           *(p+1) = UTF8_EIGHT_BIT_LO(converted);
            *lenp = 2;
        }
     }

--
Perl5 Master Repository

Reply via email to