This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Use abbreviations consistently
authorKarl Williamson <khw@cpan.org>
Sun, 20 May 2018 23:09:37 +0000 (17:09 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 29 Jun 2018 04:53:47 +0000 (22:53 -0600)
Elsewhere in this function some abbreviations were introduced and used.
This is the one area not using them.

utf8.c

diff --git a/utf8.c b/utf8.c
index 4684fdb..e3bda6e 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -387,8 +387,8 @@ Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, const UV flags, HV** msgs)
        STRLEN len  = OFFUNISKIP(uv);
        U8 *p = d+len-1;
        while (p > d) {
-           *p-- = I8_TO_NATIVE_UTF8((uv & UTF_CONTINUATION_MASK) | UTF_CONTINUATION_MARK);
-           uv >>= UTF_ACCUMULATION_SHIFT;
+           *p-- = I8_TO_NATIVE_UTF8((uv & MASK) | MARK);
+           uv >>= SHIFT;
        }
        *p = I8_TO_NATIVE_UTF8((uv & UTF_START_MASK(len)) | UTF_START_MARK(len));
        return d+len;