integrate cfgperl and vmsperl changes into mainline
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index f6c0a1e..d62a145 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2758,6 +2758,11 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
            SvPV_set(dstr, SvPVX(sstr));
            SvLEN_set(dstr, SvLEN(sstr));
            SvCUR_set(dstr, SvCUR(sstr));
+           if (SvUTF8(sstr))
+               SvUTF8_on(dstr);
+           else
+               SvUTF8_off(dstr);
+
            SvTEMP_off(dstr);
            (void)SvOK_off(sstr);
            SvPV_set(sstr, Nullch);
@@ -5741,7 +5746,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
        bool is_utf = FALSE;
 
        char esignbuf[4];
-       U8 utf8buf[10];
+       U8 utf8buf[UTF8_MAXLEN];
        STRLEN esignlen = 0;
 
        char *eptr = Nullch;
@@ -5754,7 +5759,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
        /* what about long double NVs? --jhi */
 
        SV *vecsv;
-       char *vecstr = Nullch;
+       U8 *vecstr = Null(U8*);
        STRLEN veclen = 0;
        char c;
        int i;
@@ -5819,7 +5824,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                    vecsv = va_arg(*args, SV*);
                else if (svix < svmax)
                    vecsv = svargs[svix++];
-               vecstr = SvPVx(vecsv,veclen);
+               vecstr = (U8*)SvPVx(vecsv,veclen);
                utf = DO_UTF8(vecsv);
                continue;
 
@@ -6005,7 +6010,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                if (utf)
                    iv = (IV)utf8_to_uv(vecstr, &ulen);
                else {
-                   iv = (U8)*vecstr;
+                   iv = *vecstr;
                    ulen = 1;
                }
                vecstr += ulen;
@@ -6087,7 +6092,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                if (utf)
                    uv = utf8_to_uv(vecstr, &ulen);
                else {
-                   uv = (U8)*vecstr;
+                   uv = *vecstr;
                    ulen = 1;
                }
                vecstr += ulen;
@@ -7237,13 +7242,13 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl)
            ptr = POPPTR(ss,ix);
            TOPPTR(nss,ix) = any_dup(ptr, proto_perl);  /* XXX quite arbitrary */
            dptr = POPDPTR(ss,ix);
-           TOPDPTR(nss,ix) = (void (*)(void*))any_dup(dptr, proto_perl);
+           TOPDPTR(nss,ix) = (void (*)(void*))any_dup((void *)dptr, proto_perl);
            break;
        case SAVEt_DESTRUCTOR_X:
            ptr = POPPTR(ss,ix);
            TOPPTR(nss,ix) = any_dup(ptr, proto_perl);  /* XXX quite arbitrary */
            dxptr = POPDXPTR(ss,ix);
-           TOPDXPTR(nss,ix) = (void (*)(pTHXo_ void*))any_dup(dxptr, proto_perl);
+           TOPDXPTR(nss,ix) = (void (*)(pTHXo_ void*))any_dup((void *)dxptr, proto_perl);
            break;
        case SAVEt_REGCONTEXT:
        case SAVEt_ALLOC: