/* make new elements SVs now: avoid problems if they're from the array */
for (dst = MARK, i = newlen; i; i--) {
SV *h = *dst;
- *dst = NEWSV(46, 0);
- sv_setsv(*dst++, h);
+ *dst++ = newSVsv(h);
}
if (diff < 0) { /* shrinking the area */
else {
av_unshift(ary, SP - MARK);
while (MARK < SP) {
- sv = NEWSV(27, 0);
- sv_setsv(sv, *++MARK);
+ sv = newSVsv(*++MARK);
(void)av_store(ary, i++, sv);
}
}
if (m >= strend)
break;
- dstr = NEWSV(30, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
m++;
if (m >= strend)
break;
- dstr = NEWSV(30, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
for (m = s; m < strend && *m != c; m++) ;
if (m >= strend)
break;
- dstr = NEWSV(30, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
csv, multiline ? FBMrf_MULTILINE : 0)) )
#endif
{
- dstr = NEWSV(31, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
strend = s + (strend - m);
}
m = rx->startp[0] + orig;
- dstr = NEWSV(32, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
parens that didn't match -- they should be set to
undef, not the empty string */
if (m >= orig && s >= orig) {
- dstr = NEWSV(33, m-s);
- sv_setpvn(dstr, s, m-s);
+ dstr = newSVpvn(s, m-s);
}
else
dstr = &PL_sv_undef; /* undef, not "" */
/* keep field after final delim? */
if (s < strend || (iters && origlimit)) {
STRLEN l = strend - s;
- dstr = NEWSV(34, l);
- sv_setpvn(dstr, s, l);
+ dstr = newSVpvn(s, l);
if (make_mortal)
sv_2mortal(dstr);
if (do_utf8)
i = 0;
while (relem <= lastrelem) { /* gobble up all the rest */
SV **didstore;
- sv = NEWSV(28,0);
assert(*relem);
- sv_setsv(sv,*relem);
+ sv = newSVsv(*relem);
*(relem++) = sv;
didstore = av_store(ary,i++,sv);
if (magic) {
have_a_cow:
#endif
rxtainted |= RX_MATCH_TAINTED(rx);
- dstr = NEWSV(25, len);
- sv_setpvn(dstr, m, s-m);
+ dstr = newSVpvn(m, s-m);
if (DO_UTF8(TARG))
SvUTF8_on(dstr);
PL_curpm = pm;
SV *sv;
SV** base, **didstore;
for (base = ORIGMARK+1, i=0; i < max; i++) {
- sv = NEWSV(28,0);
- sv_setsv(sv, base[i]);
+ sv = newSVsv(base[i]);
base[i] = sv;
}
av_clear(av);
**** Alterations to Henry's code are...
****
**** Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- **** 2000, 2001, 2002, 2003, 2004, by Larry Wall and others
+ **** 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
****
**** You may distribute under the terms of either the GNU General Public
**** License or the Artistic License, as specified in the README file.
{
SV* sv;
if (prog->float_substr && !prog->float_utf8) {
- prog->float_utf8 = sv = NEWSV(117, 0);
- SvSetSV(sv, prog->float_substr);
+ prog->float_utf8 = sv = newSVsv(prog->float_substr);
sv_utf8_upgrade(sv);
if (SvTAIL(prog->float_substr))
SvTAIL_on(sv);
prog->check_utf8 = sv;
}
if (prog->anchored_substr && !prog->anchored_utf8) {
- prog->anchored_utf8 = sv = NEWSV(118, 0);
- SvSetSV(sv, prog->anchored_substr);
+ prog->anchored_utf8 = sv = newSVsv(prog->anchored_substr);
sv_utf8_upgrade(sv);
if (SvTAIL(prog->anchored_substr))
SvTAIL_on(sv);
{
SV* sv;
if (prog->float_utf8 && !prog->float_substr) {
- prog->float_substr = sv = NEWSV(117, 0);
- SvSetSV(sv, prog->float_utf8);
+ prog->float_substr = sv = newSVsv(prog->float_utf8);
if (sv_utf8_downgrade(sv, TRUE)) {
if (SvTAIL(prog->float_utf8))
SvTAIL_on(sv);
prog->check_substr = sv;
}
if (prog->anchored_utf8 && !prog->anchored_substr) {
- prog->anchored_substr = sv = NEWSV(118, 0);
- SvSetSV(sv, prog->anchored_utf8);
+ prog->anchored_substr = sv = newSVsv(prog->anchored_utf8);
if (sv_utf8_downgrade(sv, TRUE)) {
if (SvTAIL(prog->anchored_utf8))
SvTAIL_on(sv);
void
Perl_save_item(pTHX_ register SV *item)
{
- register SV *sv = NEWSV(0,0);
+ register SV *sv = newSVsv(item);
- sv_setsv(sv,item);
SSCHECK(3);
SSPUSHPTR(item); /* remember the pointer */
SSPUSHPTR(sv); /* remember the value */
char *name = Nullch;
enum token_type type = TOKENTYPE_NONE;
struct debug_tokens *p;
- SV* report = NEWSV(0, 60);
-
- Perl_sv_catpvf(aTHX_ report, "<== ");
+ SV* report = newSVpvn("<== ", 4);
for (p = debug_tokens; p->token; p++) {
if (p->token == (int)rv) {