if (SvROK(sv)) {
sv_catpv(t, "\\");
if (SvCUR(t) + unref > 10) {
- SvCUR(t) = unref + 3;
+ SvCUR_set(t, unref + 3);
*SvEND(t) = '\0';
sv_catpv(t, "...");
goto finish;
if ((type != SVt_PVHV) && SvUTF8(sv))
sv_catpv(d, "UTF8");
- if (*(SvEND(d) - 1) == ',')
- SvPVX(d)[--SvCUR(d)] = '\0';
+ if (*(SvEND(d) - 1) == ',') {
+ SvCUR_set(d, SvCUR(d) - 1);
+ SvPVX(d)[SvCUR(d)] = '\0';
+ }
sv_catpv(d, ")");
s = SvPVX(d);
use XSLoader ();
-our $VERSION = '0.05';
+our $VERSION = '0.06';
XSLoader::load 'ByteLoader', $VERSION;
=head1 SYNOPSIS
- use ByteLoader 0.04;
+ use ByteLoader 0.06;
<byte code>
or just
{
svindex arg;
BGET_svindex(arg);
- SvRV(bstate->bs_sv) = arg;
+ SvRV_set(bstate->bs_sv, arg);
break;
}
case INSN_XPV: /* 22 */
BSET_xpv(bstate->bs_sv);
break;
}
- case INSN_XPV_CUR: /* 23 */
+ case INSN_XPV_CUR: /* 23 */
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvCUR(bstate->bs_sv) = arg;
+ SvCUR_set(bstate->bs_sv, arg);
break;
}
case INSN_XPV_LEN: /* 24 */
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvLEN(bstate->bs_sv) = arg;
+ SvLEN_set(bstate->bs_sv, arg);
break;
}
case INSN_XIV: /* 25 */
package Data::Dumper;
-$VERSION = '2.121_04';
+$VERSION = '2.121_05';
#$| = 1;
SvGROW(sv, len*n + SvCUR(sv) + 1);
if (len == 1) {
char *start = SvPVX(sv) + SvCUR(sv);
- SvCUR(sv) += n;
+ SvCUR_set(sv, SvCUR(sv) + n);
start[n] = '\0';
while (n > 0)
start[--n] = str[0];
av_push(postav, postentry);
e = newRV_inc(e);
- SvCUR(newapad) = 0;
+ SvCUR_set(newapad, 0);
if (indent >= 2)
(void)sv_x(aTHX_ newapad, " ", 1, SvCUR(postentry));
package Devel::Peek;
-$VERSION = '1.02';
+$VERSION = '1.03';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
if (!SvOK(*svp)) {
av = newAV();
(void)SvUPGRADE(*svp, SVt_RV);
- SvRV(*svp) = (SV*)av;
+ SvRV_set(*svp, (SV*)av);
SvROK_on(*svp);
} else
av = (AV*)SvRV(*svp);
package Encode;
use strict;
# our $VERSION = do { my @r = (q$Revision: 2.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
-our $VERSION = '2.0902';
+our $VERSION = '2.0902_01';
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
}
sv_catsv(dst, encode_method(aTHX_ enc, enc->t_utf8, src, check,
&offset, term, &code));
- SvIVX(off) = (IV)offset;
+ SvIV_set(off, (IV)offset);
if (code == ENCODE_FOUND_TERM) {
ST(0) = &PL_sv_yes;
}else{
@ISA = qw(Exporter);
@EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.14";
+$VERSION = "1.14_01";
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
our(@ISA, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD) = ();
-our $VERSION = "1.08";
+our $VERSION = "1.09";
use AutoLoader;
char * buffer = sv_grow( sv_buffer, nbytes+1 );
CLEANUP:
if (RETVAL >= 0) {
- SvCUR(sv_buffer) = RETVAL;
+ SvCUR_set(sv_buffer, RETVAL);
SvPOK_only(sv_buffer);
*SvEND(sv_buffer) = '\0';
SvTAINTED_on(sv_buffer);
strxfrm(SvPVX(ST(0)), p, (size_t)dstlen);
dstlen--;
}
- SvCUR(ST(0)) = dstlen;
+ SvCUR_set(ST(0), dstlen);
SvPOK_only(ST(0));
}
package PerlIO::encoding;
use strict;
-our $VERSION = '0.07';
+our $VERSION = '0.08';
our $DEBUG = 0;
$DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
}
}
SvPV_set(e->dataSV, (char *) ptr);
- SvLEN(e->dataSV) = 0; /* Hands off sv.c - it isn't yours */
+ SvLEN_set(e->dataSV, 0); /* Hands off sv.c - it isn't yours */
SvCUR_set(e->dataSV,use);
SvPOK_only(e->dataSV);
}
str = sv_newmortal();
sv_upgrade(str, SVt_PV);
SvPV_set(str, (char*)e->base.ptr);
- SvLEN(str) = 0;
+ SvLEN_set(str, 0);
SvCUR_set(str, e->base.end - e->base.ptr);
SvPOK_only(str);
SvUTF8_on(str);
package PerlIO::scalar;
-our $VERSION = '0.02';
+our $VERSION = '0.03';
use XSLoader ();
XSLoader::load 'PerlIO::scalar';
1;
SvUPGRADE(s->var, SVt_PV);
code = PerlIOBase_pushed(aTHX_ f, mode, Nullsv, tab);
if (!SvOK(s->var) || (PerlIOBase(f)->flags) & PERLIO_F_TRUNCATE)
- SvCUR(s->var) = 0;
+ SvCUR_set(s->var, 0);
if ((PerlIOBase(f)->flags) & PERLIO_F_APPEND)
s->posn = SvCUR(s->var);
else
use AutoLoader;
use vars qw($canonical $forgive_me $VERSION);
-$VERSION = '2.14';
+$VERSION = '2.15';
*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
#
stash = gv_stashpv((p), TRUE); \
ref = newRV_noinc(s); \
(void) sv_bless(ref, stash); \
- SvRV(ref) = 0; \
+ SvRV_set(ref, NULL); \
SvREFCNT_dec(ref); \
} STMT_END
/*
ref = newRV_noinc(sv); /* Temporary reference */
av = array_call(aTHX_ ref, hook, clone); /* @a = $object->STORABLE_freeze($c) */
- SvRV(ref) = 0;
+ SvRV_set(ref, NULL);
SvREFCNT_dec(ref); /* Reclaim temporary reference */
count = AvFILLp(av) + 1;
sv_upgrade(rv, SVt_RV);
}
- SvRV(rv) = sv; /* $rv = \$sv */
+ SvRV_set(rv, sv); /* $rv = \$sv */
SvROK_on(rv);
TRACEME(("ok (retrieve_ref at 0x%"UVxf")", PTR2UV(rv)));
*/
sv_upgrade(rv, SVt_RV);
- SvRV(rv) = sv; /* $rv = \$sv */
+ SvRV_set(rv, sv); /* $rv = \$sv */
SvROK_on(rv);
/*
SvUPGRADE(in, SVt_PV);
SvPOK_on(in);
SvPV_set(in, asbytes);
- SvLEN(in) = klen_tmp;
- SvCUR(in) = klen_tmp - 1;
+ SvLEN_set(in, klen_tmp);
+ SvCUR_set(in, klen_tmp - 1);
}
}
#endif
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(share cond_wait cond_timedwait cond_broadcast cond_signal);
- our $VERSION = '0.92';
+ our $VERSION = '0.93';
if ($threads::threads) {
*cond_wait = \&cond_wait_enabled;
char* stash_ptr = SvPV((SV*) SvSTASH(ssv), len);
HV* stash = gv_stashpvn(stash_ptr, len, TRUE);
SvOBJECT_on(sv);
- SvSTASH(sv) = (HV*)SvREFCNT_inc(stash);
+ SvSTASH_set(sv, (HV*)SvREFCNT_inc(stash));
}
}
break;
SV *obj = Nullsv;
Perl_sharedsv_associate(aTHX_ &obj, SvRV(SHAREDSvPTR(shared)), NULL);
sv_setsv_nomg(sv, &PL_sv_undef);
- SvRV(sv) = obj;
+ SvRV_set(sv, obj);
SvROK_on(sv);
}
if(SvOBJECT(SvRV(sv))) {
SV* fake_stash = newSVpv(HvNAME(SvSTASH(SvRV(sv))),0);
SvOBJECT_on(SHAREDSvPTR(target));
- SvSTASH(SHAREDSvPTR(target)) = (HV*)fake_stash;
+ SvSTASH_set(SHAREDSvPTR(target), (HV*)fake_stash);
}
CALLER_CONTEXT;
}
if(SvOBJECT(sv)) {
SV* fake_stash = newSVpv(HvNAME(SvSTASH(sv)),0);
SvOBJECT_on(SHAREDSvPTR(shared));
- SvSTASH(SHAREDSvPTR(shared)) = (HV*)fake_stash;
+ SvSTASH_set(SHAREDSvPTR(shared), (HV*)fake_stash);
}
CALLER_CONTEXT;
}
SV *obj = Nullsv;
Perl_sharedsv_associate(aTHX_ &obj, SvRV(*svp), NULL);
sv_setsv_nomg(sv, &PL_sv_undef);
- SvRV(sv) = obj;
+ SvRV_set(sv, obj);
SvROK_on(sv);
SvSETMAGIC(sv);
}
our @EXPORT = qw(
async
);
-our $VERSION = '1.05';
+our $VERSION = '1.06';
# || 0 to ensure compatibility with previous versions
if (SvLEN(gv)) {
if (proto) {
SvPV_set(gv, NULL);
- SvLEN(gv) = 0;
+ SvLEN_set(gv, 0);
SvPOK_off(gv);
} else
Safefree(SvPVX(gv));
*/
CvSTASH(cv) = stash;
SvPV_set(cv, (char *)name); /* cast to lose constness warning */
- SvCUR(cv) = len;
+ SvCUR_set(cv, len);
return gv;
}
/* unless exists($main::{FileHandle}) and defined(%main::FileHandle::) */
if (!(iogv && GvHV(iogv) && HvARRAY(GvHV(iogv))))
iogv = gv_fetchpv("IO::Handle::", TRUE, SVt_PVHV);
- SvSTASH(io) = (HV*)SvREFCNT_inc(GvHV(iogv));
+ SvSTASH_set(io, (HV*)SvREFCNT_inc(GvHV(iogv)));
return io;
}
*/
SV* newref = newSVsv(tmpRef);
SvOBJECT_on(newref);
- SvSTASH(newref) = (HV*)SvREFCNT_inc(SvSTASH(tmpRef));
+ SvSTASH_set(newref, (HV*)SvREFCNT_inc(SvSTASH(tmpRef)));
return newref;
}
}
SvREFCNT_dec(mg->mg_obj);
Safefree(mg);
}
- SvMAGIC(sv) = 0;
+ SvMAGIC_set(sv, NULL);
return 0;
}
MAGIC* mg = SvMAGIC(sv);
MAGIC* mgt;
PL_tainted = 1;
- SvMAGIC(sv) = mg->mg_moremagic;
+ SvMAGIC_set(sv, mg->mg_moremagic);
SvTAINT(sv);
if ((mgt = SvMAGIC(sv))) {
mg->mg_moremagic = mgt;
- SvMAGIC(sv) = mg;
+ SvMAGIC_set(sv, mg);
}
} else
SvTAINTED_off(sv);
if (!SvWEAKREF(svp[i]))
Perl_croak(aTHX_ "panic: magic_killbackrefs");
/* XXX Should we check that it hasn't changed? */
- SvRV(svp[i]) = 0;
+ SvRV_set(svp[i], 0);
SvOK_off(svp[i]);
SvWEAKREF_off(svp[i]);
svp[i] = Nullsv;
GV *gv = cGVOPx_gv(curop);
if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
break;
- SvCUR(gv) = PL_generation;
+ SvCUR_set(gv, PL_generation);
}
else if (curop->op_type == OP_PADSV ||
curop->op_type == OP_PADAV ||
if (PAD_COMPNAME_GEN(curop->op_targ)
== (STRLEN)PL_generation)
break;
- PAD_COMPNAME_GEN(curop->op_targ)
- = PL_generation;
+ PAD_COMPNAME_GEN_set(curop->op_targ, PL_generation);
}
else if (curop->op_type == OP_RV2CV)
#endif
if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
break;
- SvCUR(gv) = PL_generation;
+ SvCUR_set(gv, PL_generation);
}
}
else
if (*s == ':' && s[1] == ':') {
*s = '/';
Move(s+2, s+1, strlen(s+2)+1, char);
- --SvCUR(kid->op_sv);
+ SvCUR_set(kid->op_sv, SvCUR(kid->op_sv) - 1);
}
}
if (SvREADONLY(kid->op_sv)) {
if (typestash) {
SvFLAGS(namesv) |= SVpad_TYPED;
- SvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*) typestash);
+ SvSTASH_set(namesv, (HV*)SvREFCNT_inc((SV*) typestash));
}
if (ourstash) {
SvFLAGS(namesv) |= SVpad_OUR;
The generation number of the name at offset C<po> in the current
compiling pad (lvalue). Note that C<SvCUR> is hijacked for this purpose.
+=for apidoc m|STRLEN|PAD_COMPNAME_GEN_set|PADOFFSET po|int gen
+Sets the generation number of the name at offset C<po> in the current
+ling pad (lvalue) to C<gen>. Note that C<SvCUR_set> is hijacked for this purpose.
+
=cut
+
*/
#define PAD_COMPNAME_FLAGS(po) SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE))
#define PAD_COMPNAME_GEN(po) SvCUR(AvARRAY(PL_comppad_name)[po])
-
+#define PAD_COMPNAME_GEN_set(po, gen) SvCUR_set(AvARRAY(PL_comppad_name)[po], gen)
/*
};
#define PERL_DEBUG_PAD(i) &(PL_debug_pad.pad[i])
-#define PERL_DEBUG_PAD_ZERO(i) (SvPVX(PERL_DEBUG_PAD(i))[0] = 0, SvCUR(PERL_DEBUG_PAD(i)) = 0, PERL_DEBUG_PAD(i))
+#define PERL_DEBUG_PAD_ZERO(i) (SvPVX(PERL_DEBUG_PAD(i))[0] = 0, SvCUR_set(PERL_DEBUG_PAD(i), 0), PERL_DEBUG_PAD(i))
/* Enable variables which are pointers to functions */
typedef void (CPERLscope(*peep_t))(pTHX_ OP* o);
SvOOK_off(sv); /* backoff */
if (SvLEN(sv))
Safefree(SvPVX(sv));
- SvLEN(sv)=SvCUR(sv)=0;
+ SvLEN_set(sv, 0);
+ SvCUR_set(sv, 0);
}
- SvRV(sv) = (SV*)gv;
+ SvRV_set(sv, (SV*)gv);
SvROK_on(sv);
SvSETMAGIC(sv);
goto wasref;
}
rv = sv_newmortal();
sv_upgrade(rv, SVt_RV);
- SvRV(rv) = sv;
+ SvRV_set(rv, sv);
SvROK_on(rv);
return rv;
}
MEM_WRAP_CHECK_1(max, char, oom_string_extend);
SvGROW(TARG, (count * len) + 1);
repeatcpy(SvPVX(TARG) + len, SvPVX(TARG), len, count - 1);
- SvCUR(TARG) *= count;
+ SvCUR_set(TARG, SvCUR(TARG) * count);
}
*SvEND(TARG) = '\0';
}
changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV_set(rv, AMG_CALLun(rv,copy)); \
SvREFCNT_dec(tmpRef); \
} } STMT_END
tmps = SvEND(sv) - 1;
if (*tmps == *SvPVX(PL_rs)) {
*tmps = '\0';
- SvCUR(sv)--;
+ SvCUR_set(sv, SvCUR(sv) - 1);
}
}
for (tmps = SvPVX(sv); *tmps; tmps++)
else if (SvTYPE(sv) >= SVt_PV) {
SvOOK_off(sv);
Safefree(SvPVX(sv));
- SvLEN(sv) = SvCUR(sv) = 0;
+ SvLEN_set(sv, 0);
+ SvCUR_set(sv, 0);
}
switch (to_what) {
case OPpDEREF_SV:
- SvRV(sv) = NEWSV(355,0);
+ SvRV_set(sv, NEWSV(355,0));
break;
case OPpDEREF_AV:
- SvRV(sv) = (SV*)newAV();
+ SvRV_set(sv, (SV*)newAV());
break;
case OPpDEREF_HV:
- SvRV(sv) = (SV*)newHV();
+ SvRV_set(sv, (SV*)newHV());
break;
}
SvROK_on(sv);
if (utf8) gl *= UTF8_EXPAND; \
if ((cur) + gl >= (start) + SvLEN(cat)) { \
*cur = '\0'; \
- SvCUR(cat) = (cur) - (start); \
+ SvCUR_set((cat), (cur) - (start)); \
(start) = sv_exp_grow(aTHX_ cat, gl); \
(cur) = (start) + SvCUR(cat); \
} \
if (SvOOK(sv)) {
if (SvIVX(sv)) {
- SvLEN(sv) += SvIVX(sv);
+ SvLEN_set(sv, SvLEN(sv) + SvIVX(sv));
from_start -= SvIVX(sv);
SvIV_set(sv, 0);
}
if (SvLEN(sv) != 0)
Safefree(from_start);
SvPV_set(sv, to_start);
- SvCUR(sv) = to_ptr - to_start;
- SvLEN(sv) = len;
+ SvCUR_set(sv, to_ptr - to_start);
+ SvLEN_set(sv, len);
SvUTF8_on(sv);
}
W_utf8:
if (cur > end) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
GROWING(0, cat, start, cur, len+UTF8_MAXLEN);
end = start+SvLEN(cat)-UTF8_MAXLEN;
if (auv >= 0x100) {
if (!SvUTF8(cat)) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
marked_upgrade(aTHX_ cat, symptr);
lookahead.flags |= FLAG_DO_UTF8;
lookahead.strbeg = symptr->strbeg;
}
if (cur >= end) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
GROWING(0, cat, start, cur, len+1);
end = start+SvLEN(cat)-1;
}
0 : UNICODE_ALLOW_ANY);
if (cur+(endb-buffer)*UTF8_EXPAND >= end) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
GROWING(0, cat, start, cur,
len+(endb-buffer)*UTF8_EXPAND);
end = start+SvLEN(cat);
} else {
if (cur >= end) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
GROWING(0, cat, start, cur, len+UTF8_MAXLEN);
end = start+SvLEN(cat)-UTF8_MAXLEN;
}
if (anv < 0) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
Perl_croak(aTHX_ "Cannot compress negative numbers in pack");
}
if (!uni_to_bytes(aTHX_ &aptr, aend, buffer, todo,
'u' | TYPE_IS_PACK)) {
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
Perl_croak(aTHX_ "Assertion: string is shorter than advertised");
}
end = doencodes(hunk, buffer, todo);
}
}
*cur = '\0';
- SvCUR(cat) = cur - start;
+ SvCUR_set(cat, cur - start);
no_change:
*symptr = lookahead;
}
SvGROW(last_str, (mincount * l) + 1);
repeatcpy(SvPVX(last_str) + l,
SvPVX(last_str), l, mincount - 1);
- SvCUR(last_str) *= mincount;
+ SvCUR_set(last_str, SvCUR(last_str) * mincount);
/* Add additional parts. */
SvCUR_set(data->last_found,
SvCUR(data->last_found) - l);
(SVp_NOK|SVp_POK)) >> PRIVSHIFT;
PL_tainted = oldtainted;
}
- SvMAGIC(sv) = SvMAGIC(osv);
+ SvMAGIC_set(sv, SvMAGIC(osv));
/* if it's a special scalar or if it has no 'set' magic,
* propagate the SvREADONLY flag. --rgs 20030922 */
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
{
SSGROW(6);
SSPUSHIV((IV)SvLEN(gv));
- SvLEN(gv) = 0; /* forget that anything was allocated here */
+ SvLEN_set(gv, 0); /* forget that anything was allocated here */
SSPUSHIV((IV)SvCUR(gv));
SSPUSHPTR(SvPVX(gv));
SvPOK_off(gv);
GvAV(gv) = Null(AV*);
av = GvAVn(gv);
if (SvMAGIC(oav)) {
- SvMAGIC(av) = SvMAGIC(oav);
+ SvMAGIC_set(av, SvMAGIC(oav));
SvFLAGS((SV*)av) |= SvMAGICAL(oav);
SvMAGICAL_off(oav);
- SvMAGIC(oav) = 0;
+ SvMAGIC_set(oav, NULL);
PL_localizing = 1;
SvSETMAGIC((SV*)av);
PL_localizing = 0;
GvHV(gv) = Null(HV*);
hv = GvHVn(gv);
if (SvMAGIC(ohv)) {
- SvMAGIC(hv) = SvMAGIC(ohv);
+ SvMAGIC_set(hv, SvMAGIC(ohv));
SvFLAGS((SV*)hv) |= SvMAGICAL(ohv);
SvMAGICAL_off(ohv);
- SvMAGIC(ohv) = 0;
+ SvMAGIC_set(ohv, NULL);
PL_localizing = 1;
SvSETMAGIC((SV*)hv);
PL_localizing = 0;
SvTYPE(sv) != SVt_PVGV)
{
(void)SvUPGRADE(value, SvTYPE(sv));
- SvMAGIC(value) = SvMAGIC(sv);
+ SvMAGIC_set(value, SvMAGIC(sv));
SvFLAGS(value) |= SvMAGICAL(sv);
SvMAGICAL_off(sv);
- SvMAGIC(sv) = 0;
+ SvMAGIC_set(sv, 0);
}
/* XXX This branch is pretty bogus. This code irretrievably
* clears(!) the magic on the SV (either to avoid further
SvMAGICAL_off(value);
/* XXX this is a leak when we get here because the
* mg_get() in save_scalar_at() croaked */
- SvMAGIC(value) = 0;
+ SvMAGIC_set(value, NULL);
}
*(SV**)ptr = value;
SvREFCNT_dec(sv);
gv = (GV*)SSPOPPTR;
if (GvAV(gv)) {
AV * const goner = GvAV(gv);
- SvMAGIC(av) = SvMAGIC(goner);
+ SvMAGIC_set(av, SvMAGIC(goner));
SvFLAGS((SV*)av) |= SvMAGICAL(goner);
SvMAGICAL_off(goner);
- SvMAGIC(goner) = 0;
+ SvMAGIC_set(goner, NULL);
SvREFCNT_dec(goner);
}
GvAV(gv) = av;
gv = (GV*)SSPOPPTR;
if (GvHV(gv)) {
HV * const goner = GvHV(gv);
- SvMAGIC(hv) = SvMAGIC(goner);
+ SvMAGIC_set(hv, SvMAGIC(goner));
SvFLAGS(hv) |= SvMAGICAL(goner);
SvMAGICAL_off(goner);
- SvMAGIC(goner) = 0;
+ SvMAGIC_set(goner, NULL);
SvREFCNT_dec(goner);
}
GvHV(gv) = hv;
Safefree(SvPVX(gv));
}
SvPV_set(gv, (char *)SSPOPPTR);
- SvCUR(gv) = (STRLEN)SSPOPIV;
- SvLEN(gv) = (STRLEN)SSPOPIV;
+ SvCUR_set(gv, (STRLEN)SSPOPIV);
+ SvLEN_set(gv, (STRLEN)SSPOPIV);
gp_free(gv);
GvGP(gv) = (GP*)ptr;
if (GvCVu(gv))
if (SvWEAKREF(sv)) {
sv_del_backref(sv);
SvWEAKREF_off(sv);
- SvRV(sv) = 0;
+ SvRV_set(sv, NULL);
} else {
SvROK_off(sv);
- SvRV(sv) = 0;
+ SvRV_set(sv, NULL);
SvREFCNT_dec(rv);
}
}
break;
case SVt_RV:
SvANY(sv) = new_XRV();
- SvRV(sv) = (SV*)pv;
+ SvRV_set(sv, (SV*)pv);
break;
case SVt_PV:
SvANY(sv) = new_XPV();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
break;
case SVt_PVIV:
SvANY(sv) = new_XPVIV();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
if (SvNIOK(sv))
(void)SvIOK_on(sv);
case SVt_PVNV:
SvANY(sv) = new_XPVNV();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
break;
case SVt_PVMG:
SvANY(sv) = new_XPVMG();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
break;
case SVt_PVLV:
SvANY(sv) = new_XPVLV();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
LvTARGOFF(sv) = 0;
LvTARGLEN(sv) = 0;
LvTARG(sv) = 0;
AvFILLp(sv) = -1;
SvIV_set(sv, 0);
SvNV_set(sv, 0.0);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
AvALLOC(sv) = 0;
AvARYLEN(sv) = 0;
AvFLAGS(sv) = AVf_REAL;
HvMAX(sv) = 0;
HvTOTALKEYS(sv) = 0;
HvPLACEHOLDERS(sv) = 0;
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
HvRITER(sv) = 0;
HvEITER(sv) = 0;
HvPMROOT(sv) = 0;
SvANY(sv) = new_XPVCV();
Zero(SvANY(sv), 1, XPVCV);
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
break;
case SVt_PVGV:
SvANY(sv) = new_XPVGV();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
GvGP(sv) = 0;
GvNAME(sv) = 0;
GvNAMELEN(sv) = 0;
case SVt_PVBM:
SvANY(sv) = new_XPVBM();
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
BmRARE(sv) = 0;
BmUSEFUL(sv) = 0;
BmPREVIOUS(sv) = 0;
SvANY(sv) = new_XPVFM();
Zero(SvANY(sv), 1, XPVFM);
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
break;
case SVt_PVIO:
SvANY(sv) = new_XPVIO();
Zero(SvANY(sv), 1, XPVIO);
SvPV_set(sv, pv);
- SvCUR(sv) = cur;
- SvLEN(sv) = len;
+ SvCUR_set(sv, cur);
+ SvLEN_set(sv, len);
SvIV_set(sv, iv);
SvNV_set(sv, nv);
- SvMAGIC(sv) = magic;
- SvSTASH(sv) = stash;
+ SvMAGIC_set(sv, magic);
+ SvSTASH_set(sv, stash);
IoPAGE_LEN(sv) = 60;
break;
}
assert(SvOOK(sv));
if (SvIVX(sv)) {
char *s = SvPVX(sv);
- SvLEN(sv) += SvIVX(sv);
+ SvLEN_set(sv, SvLEN(sv) + SvIVX(sv));
SvPV_set(sv, SvPVX(sv) - SvIVX(sv));
SvIV_set(sv, 0);
Move(s, SvPVX(sv), SvCUR(sv)+1, char);
s = (U8*)SvPVX(sv);
len = SvCUR(sv) + 1; /* Plus the \0 */
SvPV_set(sv, (char*)bytes_to_utf8((U8*)s, &len));
- SvCUR(sv) = len - 1;
+ SvCUR_set(sv, len - 1);
if (SvLEN(sv) != 0)
Safefree(s); /* No longer using what was there before. */
- SvLEN(sv) = len; /* No longer know the real size. */
+ SvLEN_set(sv, len); /* No longer know the real size. */
}
/* Mark as UTF-8 even if no hibit - saves scanning loop */
SvUTF8_on(sv);
Perl_croak(aTHX_ "Wide character");
}
}
- SvCUR(sv) = len;
+ SvCUR_set(sv, len);
}
}
SvUTF8_off(sv);
(void)SvOOK_off(dstr); /* backoff */
if (SvLEN(dstr))
Safefree(SvPVX(dstr));
- SvLEN(dstr)=SvCUR(dstr)=0;
+ SvLEN_set(dstr, 0);
+ SvCUR_set(dstr, 0);
}
}
(void)SvOK_off(dstr);
- SvRV(dstr) = SvREFCNT_inc(SvRV(sstr));
+ SvRV_set(dstr, SvREFCNT_inc(SvRV(sstr)));
SvROK_on(dstr);
if (sflags & SVp_NOK) {
SvNOKp_on(dstr);
SvFAKE_off(sv);
SvREADONLY_off(sv);
SvPV_set(sv, (char*)0);
- SvLEN(sv) = 0;
+ SvLEN_set(sv, 0);
SvGROW(sv, len + 1);
Move(pvx,SvPVX(sv),len,char);
*SvEND(sv) = '\0';
SvFLAGS(sv) |= SVf_OOK;
}
SvNIOK_off(sv);
- SvLEN(sv) -= delta;
- SvCUR(sv) -= delta;
+ SvLEN_set(sv, SvLEN(sv) - delta);
+ SvCUR_set(sv, SvCUR(sv) - delta);
SvPV_set(sv, SvPVX(sv) + delta);
SvIV_set(sv, SvIVX(sv) + delta);
}
if (sstr == dstr)
sstr = SvPVX(dsv);
Move(sstr, SvPVX(dsv) + dlen, slen, char);
- SvCUR(dsv) += slen;
+ SvCUR_set(dsv, SvCUR(dsv) + slen);
*SvEND(dsv) = '\0';
(void)SvPOK_only_UTF8(dsv); /* validate pointer */
SvTAINT(dsv);
if (ptr == junk)
ptr = SvPVX(sv);
Move(ptr,SvPVX(sv)+tlen,len+1,char);
- SvCUR(sv) += len;
+ SvCUR_set(sv, SvCUR(sv) + len);
(void)SvPOK_only_UTF8(sv); /* validate pointer */
SvTAINT(sv);
}
}
Newz(702,mg, 1, MAGIC);
mg->mg_moremagic = SvMAGIC(sv);
- SvMAGIC(sv) = mg;
+ SvMAGIC_set(sv, mg);
/* Sometimes a magic contains a reference loop, where the sv and
object refer to each other. To prevent a reference loop that
while (midend > mid) /* shove everything down */
*--bigend = *--midend;
Move(little,big+offset,littlelen,char);
- SvCUR(bigstr) += i;
+ SvCUR_set(bigstr, SvCUR(bigstr) + i);
SvSETMAGIC(bigstr);
return;
}
mg_free(nsv);
else
sv_upgrade(nsv, SVt_PVMG);
- SvMAGIC(nsv) = SvMAGIC(sv);
+ SvMAGIC_set(nsv, SvMAGIC(sv));
SvFLAGS(nsv) |= SvMAGICAL(sv);
SvMAGICAL_off(sv);
- SvMAGIC(sv) = 0;
+ SvMAGIC_set(sv, NULL);
}
SvREFCNT(sv) = 0;
sv_clear(sv);
if(SvREFCNT(tmpref) < 2) {
/* tmpref is not kept alive! */
SvREFCNT(sv)--;
- SvRV(tmpref) = 0;
+ SvRV_set(tmpref, NULL);
SvROK_off(tmpref);
}
SvREFCNT_dec(tmpref);
}
/* oh,oh, the number grew */
SvGROW(sv, SvCUR(sv) + 2);
- SvCUR(sv)++;
+ SvCUR_set(sv, SvCUR(sv) + 1);
for (d = SvPVX(sv) + SvCUR(sv); d > SvPVX(sv); d--)
*d = d[-1];
if (isDIGIT(d[1]))
new_SV(sv);
sv_upgrade(sv, SVt_PVIV);
SvPV_set(sv, sharepvn(src, is_utf8?-len:len, hash));
- SvCUR(sv) = len;
+ SvCUR_set(sv, len);
SvUV_set(sv, hash);
- SvLEN(sv) = 0;
+ SvLEN_set(sv, 0);
SvREADONLY_on(sv);
SvFAKE_on(sv);
SvPOK_on(sv);
new_SV(sv);
sv_upgrade(sv, SVt_RV);
SvTEMP_off(tmpRef);
- SvRV(sv) = tmpRef;
+ SvRV_set(sv, tmpRef);
SvROK_on(sv);
return sv;
}
}
SvOK_off(rv);
- SvRV(rv) = sv;
+ SvRV_set(rv, sv);
SvROK_on(rv);
if (classname) {
if (SvTYPE(tmpRef) != SVt_PVIO)
++PL_sv_objcount;
(void)SvUPGRADE(tmpRef, SVt_PVMG);
- SvSTASH(tmpRef) = (HV*)SvREFCNT_inc(stash);
+ SvSTASH_set(tmpRef, (HV*)SvREFCNT_inc(stash));
if (Gv_AMG(stash))
SvAMAGIC_on(sv);
if (SvWEAKREF(sv)) {
sv_del_backref(sv);
SvWEAKREF_off(sv);
- SvRV(sv) = 0;
+ SvRV_set(sv, NULL);
return;
}
- SvRV(sv) = 0;
+ SvRV_set(sv, NULL);
SvROK_off(sv);
/* You can't have a || SvREADONLY(rv) here, as $a = $$a, where $a was
assigned to as BEGIN {$a = \"Foo"} will fail. */
Copy(eptr, p, elen, char);
p += elen;
*p = '\0';
- SvCUR(sv) = p - SvPVX(sv);
+ SvCUR_set(sv, p - SvPVX(sv));
svix = osvix;
continue; /* not "break" */
}
if (has_utf8)
SvUTF8_on(sv);
*p = '\0';
- SvCUR(sv) = p - SvPVX(sv);
+ SvCUR_set(sv, p - SvPVX(sv));
if (vectorize) {
esignlen = 0;
goto vector;
Perl_rvpv_dup(pTHX_ SV *dstr, SV *sstr, CLONE_PARAMS* param)
{
if (SvROK(sstr)) {
- SvRV(dstr) = SvWEAKREF(sstr)
- ? sv_dup(SvRV(sstr), param)
- : sv_dup_inc(SvRV(sstr), param);
+ SvRV_set(dstr, SvWEAKREF(sstr)
+ ? sv_dup(SvRV(sstr), param)
+ : sv_dup_inc(SvRV(sstr), param));
}
else if (SvPVX(sstr)) {
else {
/* Copy the Null */
if (SvTYPE(dstr) == SVt_RV)
- SvRV(dstr) = 0;
+ SvRV_set(dstr, NULL);
else
SvPV_set(dstr, 0);
}
break;
case SVt_PV:
SvANY(dstr) = new_XPV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
break;
case SVt_PVIV:
SvANY(dstr) = new_XPVIV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
break;
case SVt_PVNV:
SvANY(dstr) = new_XPVNV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
break;
case SVt_PVMG:
SvANY(dstr) = new_XPVMG();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
break;
case SVt_PVBM:
SvANY(dstr) = new_XPVBM();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
BmRARE(dstr) = BmRARE(sstr);
BmUSEFUL(dstr) = BmUSEFUL(sstr);
break;
case SVt_PVLV:
SvANY(dstr) = new_XPVLV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
LvTARGOFF(dstr) = LvTARGOFF(sstr); /* XXX sometimes holds PMOP* when DEBUGGING */
LvTARGLEN(dstr) = LvTARGLEN(sstr);
}
}
SvANY(dstr) = new_XPVGV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
GvNAMELEN(dstr) = GvNAMELEN(sstr);
GvNAME(dstr) = SAVEPVN(GvNAME(sstr), GvNAMELEN(sstr));
break;
case SVt_PVIO:
SvANY(dstr) = new_XPVIO();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
IoIFP(dstr) = fp_dup(IoIFP(sstr), IoTYPE(sstr), param);
if (IoOFP(sstr) == IoIFP(sstr))
break;
case SVt_PVAV:
SvANY(dstr) = new_XPVAV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
AvARYLEN((AV*)dstr) = sv_dup_inc(AvARYLEN((AV*)sstr), param);
AvFLAGS((AV*)dstr) = AvFLAGS((AV*)sstr);
if (AvARRAY((AV*)sstr)) {
break;
case SVt_PVHV:
SvANY(dstr) = new_XPVHV();
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
HvRITER((HV*)dstr) = HvRITER((HV*)sstr);
if (HvARRAY((HV*)sstr)) {
STRLEN i = 0;
case SVt_PVCV:
SvANY(dstr) = new_XPVCV();
dup_pvcv:
- SvCUR(dstr) = SvCUR(sstr);
- SvLEN(dstr) = SvLEN(sstr);
+ SvCUR_set(dstr, SvCUR(sstr));
+ SvLEN_set(dstr, SvLEN(sstr));
SvIV_set(dstr, SvIVX(sstr));
SvNV_set(dstr, SvNVX(sstr));
- SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr), param);
- SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr), param);
+ SvMAGIC_set(dstr, mg_dup(SvMAGIC(sstr), param));
+ SvSTASH_set(dstr, hv_dup_inc(SvSTASH(sstr), param));
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
CvSTASH(dstr) = hv_dup(CvSTASH(sstr), param); /* NOTE: not refcounted */
CvSTART(dstr) = CvSTART(sstr);
SvFLAGS(&PL_sv_no) = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK
|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
SvPV_set(&PL_sv_no, SAVEPVN(PL_No, 0));
- SvCUR(&PL_sv_no) = 0;
- SvLEN(&PL_sv_no) = 1;
+ SvCUR_set(&PL_sv_no, 0);
+ SvLEN_set(&PL_sv_no, 1);
SvIV_set(&PL_sv_no, 0);
SvNV_set(&PL_sv_no, 0);
ptr_table_store(PL_ptr_table, &proto_perl->Isv_no, &PL_sv_no);
SvFLAGS(&PL_sv_yes) = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK
|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
SvPV_set(&PL_sv_yes, SAVEPVN(PL_Yes, 1));
- SvCUR(&PL_sv_yes) = 1;
- SvLEN(&PL_sv_yes) = 2;
+ SvCUR_set(&PL_sv_yes, 1);
+ SvLEN_set(&PL_sv_yes, 2);
SvIV_set(&PL_sv_yes, 1);
SvNV_set(&PL_sv_yes, 1);
ptr_table_store(PL_ptr_table, &proto_perl->Isv_yes, &PL_sv_yes);
#define SvREPADTMP_off(sv) (SvFLAGS(sv) &= ~SVf_FAKE)
#endif
+#ifdef PERL_DEBUG_COW
+#define SvRV(sv) (0 + ((XRV*) SvANY(sv))->xrv_rv)
+#else
#define SvRV(sv) ((XRV*) SvANY(sv))->xrv_rv
+#endif
#define SvRVx(sv) SvRV(sv)
#ifdef PERL_DEBUG_COW
#define SvIVX(sv) (0 + ((XPVIV*) SvANY(sv))->xiv_iv)
-#define SvUVX(sv) (0 + (XPVUV*) SvANY(sv))->xuv_uv
-#define SvNVX(sv) (0.0 + ((XPVNV*)SvANY(sv))->xnv_nv)
+#define SvUVX(sv) (0 + ((XPVUV*) SvANY(sv))->xuv_uv)
+#define SvNVX(sv) (0 + ((XPVNV*)SvANY(sv))->xnv_nv)
#define SvPVX(sv) (0 + ((XPV*) SvANY(sv))->xpv_pv)
+#define SvCUR(sv) (0 + ((XPV*) SvANY(sv))->xpv_cur)
+#define SvLEN(sv) (0 + ((XPV*) SvANY(sv))->xpv_len)
+#define SvEND(sv) (0 + (((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur))
#else
#define SvIVX(sv) ((XPVIV*) SvANY(sv))->xiv_iv
#define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv
#define SvNVX(sv) ((XPVNV*)SvANY(sv))->xnv_nv
-#define SvPVX(sv) ((XPV*) SvANY(sv))->xpv_pv
-#endif
+#define SvPVX(sv) ((XPV*) SvANY(sv))->xpv_pv
#define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur
#define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len
#define SvEND(sv)(((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur)
+#endif
#define SvIVXx(sv) SvIVX(sv)
#define SvUVXx(sv) SvUVX(sv)
#define SvUV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
(((XPVUV*)SvANY(sv))->xuv_uv = (val)); } STMT_END
+#define SvRV_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
+ (((XRV*)SvANY(sv))->xrv_rv = (val)); } STMT_END
+#define SvMAGIC_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
+ (((XPVMG*)SvANY(sv))->xmg_magic = (val)); } STMT_END
+#define SvSTASH_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
+ (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
#define SvCUR_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
- (SvCUR(sv) = (val)); } STMT_END
+ (((XPV*) SvANY(sv))->xpv_cur = (val)); } STMT_END
#define SvLEN_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
- (SvLEN(sv) = (val)); } STMT_END
-#define SvEND_set(sv, val) \
- STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
- (SvCUR(sv) = (val) - SvPVX(sv)); } STMT_END
+ (((XPV*) SvANY(sv))->xpv_len = (val)); } STMT_END
#define SvPV_renew(sv,n) \
STMT_START { SvLEN_set(sv, n); \
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"Illegal character in prototype for %"SVf" : %s",
PL_subname, d);
- SvCUR(PL_lex_stuff) = tmp;
+ SvCUR_set(PL_lex_stuff, tmp);
have_proto = TRUE;
s = skipspace(s);
char *end = SvPVX(stuff) + SvCUR(stuff);
end[-2] = '\n';
end[-1] = '\0';
- SvCUR(stuff)--;
+ SvCUR_set(stuff, SvCUR(stuff) - 1);
}
#endif
}