summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-04-18 14:09:25 -0500
committerNicholas Clark <nick@ccl4.org>2005-04-19 09:55:51 +0000
commitb162af07ec759e1ba6b84569e4963bc5c289d75f (patch)
treedae58f745e70011d6b87525617543b26a5ff39fe /ext
parent9660f4819671f0b9100e5eabfa988ead3e799a1e (diff)
downloadperl-b162af07ec759e1ba6b84569e4963bc5c289d75f.tar.gz
Refactoring to Sv*_set() macros - patch #5
Message-ID: <20050419000925.GA21640@mccoy.peters.homeunix.org> Date: Mon, 18 Apr 2005 19:09:25 -0500 p4raw-id: //depot/perl@24248
Diffstat (limited to 'ext')
-rw-r--r--ext/ByteLoader/ByteLoader.pm4
-rw-r--r--ext/ByteLoader/byterun.c8
-rw-r--r--ext/Data/Dumper/Dumper.pm2
-rw-r--r--ext/Data/Dumper/Dumper.xs4
-rw-r--r--ext/Devel/Peek/Peek.pm2
-rw-r--r--ext/Devel/Peek/Peek.xs2
-rw-r--r--ext/Encode/Encode.pm2
-rw-r--r--ext/Encode/Encode.xs2
-rw-r--r--ext/List/Util/lib/List/Util.pm2
-rw-r--r--ext/POSIX/POSIX.pm2
-rw-r--r--ext/POSIX/POSIX.xs4
-rw-r--r--ext/PerlIO/encoding/encoding.pm2
-rw-r--r--ext/PerlIO/encoding/encoding.xs4
-rw-r--r--ext/PerlIO/scalar/scalar.pm2
-rw-r--r--ext/PerlIO/scalar/scalar.xs2
-rw-r--r--ext/Storable/Storable.pm2
-rw-r--r--ext/Storable/Storable.xs12
-rw-r--r--ext/threads/shared/shared.pm2
-rw-r--r--ext/threads/shared/shared.xs10
-rwxr-xr-xext/threads/threads.pm2
20 files changed, 36 insertions, 36 deletions
diff --git a/ext/ByteLoader/ByteLoader.pm b/ext/ByteLoader/ByteLoader.pm
index cf9fdf2874..5ff3c91370 100644
--- a/ext/ByteLoader/ByteLoader.pm
+++ b/ext/ByteLoader/ByteLoader.pm
@@ -2,7 +2,7 @@ package ByteLoader;
use XSLoader ();
-our $VERSION = '0.05';
+our $VERSION = '0.06';
XSLoader::load 'ByteLoader', $VERSION;
@@ -15,7 +15,7 @@ ByteLoader - load byte compiled perl code
=head1 SYNOPSIS
- use ByteLoader 0.04;
+ use ByteLoader 0.06;
<byte code>
or just
diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c
index d2f424273f..fd506b1430 100644
--- a/ext/ByteLoader/byterun.c
+++ b/ext/ByteLoader/byterun.c
@@ -216,7 +216,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
{
svindex arg;
BGET_svindex(arg);
- SvRV(bstate->bs_sv) = arg;
+ SvRV_set(bstate->bs_sv, arg);
break;
}
case INSN_XPV: /* 22 */
@@ -224,18 +224,18 @@ byterun(pTHX_ register struct byteloader_state *bstate)
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 */
diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm
index 1639189b3d..0a91414509 100644
--- a/ext/Data/Dumper/Dumper.pm
+++ b/ext/Data/Dumper/Dumper.pm
@@ -9,7 +9,7 @@
package Data::Dumper;
-$VERSION = '2.121_04';
+$VERSION = '2.121_05';
#$| = 1;
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs
index 5d983656ea..0626977e00 100644
--- a/ext/Data/Dumper/Dumper.xs
+++ b/ext/Data/Dumper/Dumper.xs
@@ -215,7 +215,7 @@ sv_x(pTHX_ SV *sv, register char *str, STRLEN len, I32 n)
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];
@@ -855,7 +855,7 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
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));
diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm
index 4559a0d801..bf19c27d7a 100644
--- a/ext/Devel/Peek/Peek.pm
+++ b/ext/Devel/Peek/Peek.pm
@@ -3,7 +3,7 @@
package Devel::Peek;
-$VERSION = '1.02';
+$VERSION = '1.03';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs
index 4d01a2b618..13fce6ae4e 100644
--- a/ext/Devel/Peek/Peek.xs
+++ b/ext/Devel/Peek/Peek.xs
@@ -240,7 +240,7 @@ _mstats_to_hv(HV *hv, struct mstats_buffer *b, int level)
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);
diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm
index 49813d59c5..9ac98f9acf 100644
--- a/ext/Encode/Encode.pm
+++ b/ext/Encode/Encode.pm
@@ -4,7 +4,7 @@
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);
diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs
index de7028c3c1..2f907b6e64 100644
--- a/ext/Encode/Encode.xs
+++ b/ext/Encode/Encode.xs
@@ -524,7 +524,7 @@ CODE:
}
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{
diff --git a/ext/List/Util/lib/List/Util.pm b/ext/List/Util/lib/List/Util.pm
index 5c3da9fa81..a9f8b46b1c 100644
--- a/ext/List/Util/lib/List/Util.pm
+++ b/ext/List/Util/lib/List/Util.pm
@@ -10,7 +10,7 @@ require Exporter;
@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;
diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm
index 78d733a808..87676215e7 100644
--- a/ext/POSIX/POSIX.pm
+++ b/ext/POSIX/POSIX.pm
@@ -2,7 +2,7 @@ package POSIX;
our(@ISA, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD) = ();
-our $VERSION = "1.08";
+our $VERSION = "1.09";
use AutoLoader;
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 4703dcf005..561dc3053c 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1476,7 +1476,7 @@ read(fd, buffer, nbytes)
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);
@@ -1652,7 +1652,7 @@ strxfrm(src)
strxfrm(SvPVX(ST(0)), p, (size_t)dstlen);
dstlen--;
}
- SvCUR(ST(0)) = dstlen;
+ SvCUR_set(ST(0), dstlen);
SvPOK_only(ST(0));
}
diff --git a/ext/PerlIO/encoding/encoding.pm b/ext/PerlIO/encoding/encoding.pm
index 61a116f205..3eb7dd589f 100644
--- a/ext/PerlIO/encoding/encoding.pm
+++ b/ext/PerlIO/encoding/encoding.pm
@@ -1,6 +1,6 @@
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";
diff --git a/ext/PerlIO/encoding/encoding.xs b/ext/PerlIO/encoding/encoding.xs
index 0bb3fb9b1f..e743f3f11b 100644
--- a/ext/PerlIO/encoding/encoding.xs
+++ b/ext/PerlIO/encoding/encoding.xs
@@ -322,7 +322,7 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
}
}
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);
}
@@ -463,7 +463,7 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
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);
diff --git a/ext/PerlIO/scalar/scalar.pm b/ext/PerlIO/scalar/scalar.pm
index 1c4fa4549c..7eb936eacb 100644
--- a/ext/PerlIO/scalar/scalar.pm
+++ b/ext/PerlIO/scalar/scalar.pm
@@ -1,5 +1,5 @@
package PerlIO::scalar;
-our $VERSION = '0.02';
+our $VERSION = '0.03';
use XSLoader ();
XSLoader::load 'PerlIO::scalar';
1;
diff --git a/ext/PerlIO/scalar/scalar.xs b/ext/PerlIO/scalar/scalar.xs
index c116f07f17..074da92631 100644
--- a/ext/PerlIO/scalar/scalar.xs
+++ b/ext/PerlIO/scalar/scalar.xs
@@ -40,7 +40,7 @@ PerlIOScalar_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg,
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
diff --git a/ext/Storable/Storable.pm b/ext/Storable/Storable.pm
index bdfaa19735..2c7e307dad 100644
--- a/ext/Storable/Storable.pm
+++ b/ext/Storable/Storable.pm
@@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter DynaLoader);
use AutoLoader;
use vars qw($canonical $forgive_me $VERSION);
-$VERSION = '2.14';
+$VERSION = '2.15';
*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
#
diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs
index 6bd8343b63..702644e5f6 100644
--- a/ext/Storable/Storable.xs
+++ b/ext/Storable/Storable.xs
@@ -973,7 +973,7 @@ static const char byteorderstr_56[] = {BYTEORDER_BYTES_56, 0};
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
/*
@@ -2849,7 +2849,7 @@ static int store_hook(
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;
@@ -4303,7 +4303,7 @@ static SV *retrieve_ref(pTHX_ stcxt_t *cxt, char *cname)
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)));
@@ -4363,7 +4363,7 @@ static SV *retrieve_overloaded(pTHX_ stcxt_t *cxt, char *cname)
*/
sv_upgrade(rv, SVt_RV);
- SvRV(rv) = sv; /* $rv = \$sv */
+ SvRV_set(rv, sv); /* $rv = \$sv */
SvROK_on(rv);
/*
@@ -5886,8 +5886,8 @@ static SV *do_retrieve(
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
diff --git a/ext/threads/shared/shared.pm b/ext/threads/shared/shared.pm
index dd6a705813..0a4bd04f8d 100644
--- a/ext/threads/shared/shared.pm
+++ b/ext/threads/shared/shared.pm
@@ -7,7 +7,7 @@ BEGIN {
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;
diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs
index 1ac3dce832..dcaa7e7a9e 100644
--- a/ext/threads/shared/shared.xs
+++ b/ext/threads/shared/shared.xs
@@ -361,7 +361,7 @@ Perl_sharedsv_associate(pTHX_ SV **psv, SV *ssv, shared_sv *data)
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;
@@ -503,7 +503,7 @@ sharedsv_scalar_mg_get(pTHX_ SV *sv, MAGIC *mg)
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);
}
@@ -531,7 +531,7 @@ sharedsv_scalar_store(pTHX_ SV *sv, shared_sv *shared)
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;
}
@@ -546,7 +546,7 @@ sharedsv_scalar_store(pTHX_ SV *sv, shared_sv *shared)
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;
}
@@ -643,7 +643,7 @@ sharedsv_elem_mg_FETCH(pTHX_ SV *sv, MAGIC *mg)
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);
}
diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm
index dcd2aa015c..22180ad577 100755
--- a/ext/threads/threads.pm
+++ b/ext/threads/threads.pm
@@ -50,7 +50,7 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
async
);
-our $VERSION = '1.05';
+our $VERSION = '1.06';
# || 0 to ensure compatibility with previous versions