This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Prefer -std=c89 over -ansi.
[perl5.git] / pad.c
diff --git a/pad.c b/pad.c
index 0d37ddb..a9581f8 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -171,12 +171,12 @@ sv_eq_pvn_flags(pTHX_ const SV *sv, const char* pv, const STRLEN pvlen, const U3
               SV* svrecode = NULL;
              if (SvUTF8(sv)) {
                   svrecode = newSVpvn(pv2, cur2);
-                  sv_recode_to_utf8(svrecode, PL_encoding);
+                  sv_recode_to_utf8(svrecode, _get_encoding());
                   pv2      = SvPV_const(svrecode, cur2);
              }
              else {
                   svrecode = newSVpvn(pv1, cur1);
-                  sv_recode_to_utf8(svrecode, PL_encoding);
+                  sv_recode_to_utf8(svrecode, _get_encoding());
                   pv1      = SvPV_const(svrecode, cur1);
              }
               SvREFCNT_dec_NN(svrecode);
@@ -197,7 +197,7 @@ sv_eq_pvn_flags(pTHX_ const SV *sv, const char* pv, const STRLEN pvlen, const U3
 
 #ifdef DEBUGGING
 void
-Perl_set_padlist(pTHX_ CV * cv, PADLIST *padlist){
+Perl_set_padlist(CV * cv, PADLIST *padlist){
     PERL_ARGS_ASSERT_SET_PADLIST;
 #  if PTRSIZE == 8
     if((Size_t)padlist == UINT64_C(0xEFEFEFEFEFEFEFEF)){
@@ -2128,7 +2128,7 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, bool newcv)
                        CvNAME_HEK_set(
                            sv,
                            share_hek(SvPVX_const(namesv)+1,
-                                     SvCUR(namesv) - 1
+                                     (SvCUR(namesv) - 1)
                                         * (SvUTF8(namesv) ? -1 : 1),
                                      hash)
                        );