X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=util.c;h=556abb715da8e076742a54afb16f5e4c650e2a63;hb=d2aeed1648166d254ac68525c35b77dec4ba8772;hp=f75e5a79e224a611e188a479adbddde0ed21dc49;hpb=82d8bb4934a8ea558df654435885eafe94e09dc8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/util.c b/util.c index f75e5a7..556abb7 100644 --- a/util.c +++ b/util.c @@ -1025,7 +1025,7 @@ S_mess_alloc(pTHX) XPVMG *any; if (!PL_dirty) - return sv_2mortal(newSVpvs("")); + return newSVpvs_flags("", SVs_TEMP); if (PL_mess_sv) return PL_mess_sv; @@ -1216,7 +1216,7 @@ Perl_write_to_stderr(pTHX_ const char* message, int msglen) PUSHMARK(SP); EXTEND(SP,2); PUSHs(SvTIED_obj((SV*)io, mg)); - PUSHs(sv_2mortal(newSVpvn(message, msglen))); + mPUSHp(message, msglen); PUTBACK; call_method("PRINT", G_SCALAR); @@ -1270,8 +1270,7 @@ S_vdie_common(pTHX_ const char *message, STRLEN msglen, I32 utf8, bool warn) *hook = NULL; } if (warn || message) { - msg = newSVpvn(message, msglen); - SvFLAGS(msg) |= utf8; + msg = newSVpvn_flags(message, msglen, utf8); SvREADONLY_on(msg); SAVEFREESV(msg); } @@ -2343,7 +2342,7 @@ Perl_my_popen_list(pTHX_ char *mode, int n, SV **args) return PerlIO_fdopen(p[This], mode); #else # ifdef OS2 /* Same, without fork()ing and all extra overhead... */ - return my_syspopen4(aTHX_ Nullch, mode, n, args); + return my_syspopen4(aTHX_ NULL, mode, n, args); # else Perl_croak(aTHX_ "List form of piped open not implemented"); return (PerlIO *) NULL; @@ -4176,10 +4175,6 @@ Perl_scan_version(pTHX_ const char *s, SV *rv, bool qv) SV * const hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */ (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */ -#ifndef NODEFAULT_SHAREKEYS - HvSHAREKEYS_on(hv); /* key-sharing on by default */ -#endif - while (isSPACE(*s)) /* leading whitespace is OK */ s++; @@ -4386,19 +4381,16 @@ Perl_new_version(pTHX_ SV *ver) /* This will get reblessed later if a derived class*/ SV * const hv = newSVrv(rv, "version"); (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */ -#ifndef NODEFAULT_SHAREKEYS - HvSHAREKEYS_on(hv); /* key-sharing on by default */ -#endif if ( SvROK(ver) ) ver = SvRV(ver); /* Begin copying all of the elements */ if ( hv_exists((HV *)ver, "qv", 2) ) - (void)hv_stores((HV *)hv, "qv", &PL_sv_yes); + (void)hv_stores((HV *)hv, "qv", newSViv(1)); if ( hv_exists((HV *)ver, "alpha", 5) ) - (void)hv_stores((HV *)hv, "alpha", &PL_sv_yes); + (void)hv_stores((HV *)hv, "alpha", newSViv(1)); if ( hv_exists((HV*)ver, "width", 5 ) ) { @@ -5112,6 +5104,26 @@ Perl_sv_nosharing(pTHX_ SV *sv) PERL_UNUSED_ARG(sv); } +/* + +=for apidoc sv_destroyable + +Dummy routine which reports that object can be destroyed when there is no +sharing module present. It ignores its single SV argument, and returns +'true'. Exists to avoid test for a NULL function pointer and because it +could potentially warn under some level of strict-ness. + +=cut +*/ + +bool +Perl_sv_destroyable(pTHX_ SV *sv) +{ + PERL_UNUSED_CONTEXT; + PERL_UNUSED_ARG(sv); + return TRUE; +} + U32 Perl_parse_unicode_opts(pTHX_ const char **popt) { @@ -5901,17 +5913,15 @@ Perl_my_dirfd(pTHX_ DIR * dir) { REGEXP * Perl_get_re_arg(pTHX_ SV *sv) { SV *tmpsv; - MAGIC *mg; if (sv) { if (SvMAGICAL(sv)) mg_get(sv); if (SvROK(sv) && (tmpsv = (SV*)SvRV(sv)) && /* assign deliberate */ - SvTYPE(tmpsv) == SVt_PVMG && - (mg = mg_find(tmpsv, PERL_MAGIC_qr))) /* assign deliberate */ + SvTYPE(tmpsv) == SVt_REGEXP) { - return (REGEXP *)mg->mg_obj; + return (REGEXP*) tmpsv; } }