This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SV_UTF8_NO_ENCODING is no longer used
authorKarl Williamson <khw@cpan.org>
Wed, 28 Dec 2016 03:52:20 +0000 (20:52 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 3 Jan 2017 04:46:42 +0000 (21:46 -0700)
It once had meaning under 'use encoding';

sv.h
toke.c

diff --git a/sv.h b/sv.h
index ee65879..e311ff2 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1806,10 +1806,10 @@ Like C<sv_utf8_upgrade>, but doesn't do magic on C<sv>.
 #define SvSHARED_HASH(sv) (0 + SvSHARED_HEK_FROM_PV(SvPVX_const(sv))->hek_hash)
 
 /* flag values for sv_*_flags functions */
+#define SV_UTF8_NO_ENCODING    0       /* No longer used */
 #define SV_IMMEDIATE_UNREF     1
 #define SV_GMAGIC              2
 #define SV_COW_DROP_PV         4
-#define SV_UTF8_NO_ENCODING    8
 #define SV_NOSTEAL             16
 #define SV_CONST_RETURN                32
 #define SV_MUTABLE_RETURN      64
diff --git a/toke.c b/toke.c
index f018d36..b6c9a71 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3414,10 +3414,7 @@ S_scan_const(pTHX_ char *start)
 
                             sv_utf8_upgrade_flags_grow(
                                            sv,
-                                           SV_GMAGIC|SV_FORCE_UTF8_UPGRADE
-                                                      /* Above-latin1 in string
-                                                       * implies no encoding */
-                                                      |SV_UTF8_NO_ENCODING,
+                                           SV_GMAGIC|SV_FORCE_UTF8_UPGRADE,
 
                                            /* Since we're having to grow here,
                                             * make sure we have enough room for
@@ -3744,7 +3741,7 @@ S_scan_const(pTHX_ char *start)
                              * \N{} implies Unicode semantics, and scalars have
                              * to be in utf8 to guarantee those semantics; but
                              * not needed in tr/// */
-                            sv_utf8_upgrade_flags(res, SV_UTF8_NO_ENCODING);
+                            sv_utf8_upgrade_flags(res, 0);
                             str = SvPV_const(res, len);
                         }