summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-06-06 18:08:50 -0500
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-06-07 08:18:59 +0000
commit862a34c634844bb3ea22e5f44bdaf2e973831a89 (patch)
tree77292e7d3d639e71bc2aca9df160653ecea15005
parentc158a4fd68e274329d9ffd7198cb9eb1b21b0dfe (diff)
downloadperl-862a34c634844bb3ea22e5f44bdaf2e973831a89.tar.gz
Unvoid SvUPGRADE
Message-ID: <20050607040850.GA7033@petdance.com> p4raw-id: //depot/perl@24717
-rw-r--r--doio.c4
-rw-r--r--doop.c2
-rw-r--r--gv.c2
-rw-r--r--op.c6
-rw-r--r--pp.c8
-rw-r--r--pp_ctl.c2
-rw-r--r--pp_hot.c2
-rw-r--r--pp_sys.c6
-rw-r--r--scope.c2
-rw-r--r--sv.c24
-rw-r--r--sv.h2
-rw-r--r--toke.c4
-rw-r--r--util.c10
13 files changed, 37 insertions, 37 deletions
diff --git a/doio.c b/doio.c
index 81a0f65826..2959aac07a 100644
--- a/doio.c
+++ b/doio.c
@@ -673,11 +673,11 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
LOCK_FDPID_MUTEX;
sv = *av_fetch(PL_fdpid,fd,TRUE);
- (void)SvUPGRADE(sv, SVt_IV);
+ SvUPGRADE(sv, SVt_IV);
pid = SvIVX(sv);
SvIV_set(sv, 0);
sv = *av_fetch(PL_fdpid,savefd,TRUE);
- (void)SvUPGRADE(sv, SVt_IV);
+ SvUPGRADE(sv, SVt_IV);
SvIV_set(sv, pid);
UNLOCK_FDPID_MUTEX;
}
diff --git a/doop.c b/doop.c
index 22160aff63..d35fe309d1 100644
--- a/doop.c
+++ b/doop.c
@@ -653,7 +653,7 @@ Perl_do_join(pTHX_ register SV *sv, SV *del, register SV **mark, register SV **s
mark++;
len = (items > 0 ? (delimlen * (items - 1) ) : 0);
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
if (SvLEN(sv) < len + items) { /* current length is way too short */
while (items-- > 0) {
if (*mark && !SvGAMAGIC(*mark) && SvOK(*mark)) {
diff --git a/gv.c b/gv.c
index 504f1ec854..7e9097be28 100644
--- a/gv.c
+++ b/gv.c
@@ -1005,7 +1005,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
case '?':
#ifdef COMPLEX_STATUS
- (void)SvUPGRADE(GvSV(gv), SVt_PVLV);
+ SvUPGRADE(GvSV(gv), SVt_PVLV);
#endif
goto magicalize;
diff --git a/op.c b/op.c
index b5946fa576..73f33ff87b 100644
--- a/op.c
+++ b/op.c
@@ -1597,7 +1597,7 @@ S_apply_attrs_my(pTHX_ HV *stash, OP *target, OP *attrs, OP **imopsp)
/* Fake up a method call to import */
meth = newSVpvn("import", 6);
- (void)SvUPGRADE(meth, SVt_PVIV);
+ SvUPGRADE(meth, SVt_PVIV);
(void)SvIOK_on(meth);
{
U32 hash;
@@ -3064,7 +3064,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
/* Fake up a method call to import/unimport */
meth = aver ? newSVpvn("import",6) : newSVpvn("unimport", 8);
- (void)SvUPGRADE(meth, SVt_PVIV);
+ SvUPGRADE(meth, SVt_PVIV);
(void)SvIOK_on(meth);
{
U32 hash;
@@ -5500,7 +5500,7 @@ Perl_ck_fun(pTHX_ OP *o)
SV *namesv;
targ = pad_alloc(OP_RV2GV, SVs_PADTMP);
namesv = PAD_SVl(targ);
- (void)SvUPGRADE(namesv, SVt_PV);
+ SvUPGRADE(namesv, SVt_PV);
if (*name != '$')
sv_setpvn(namesv, "$", 1);
sv_catpvn(namesv, name, len);
diff --git a/pp.c b/pp.c
index 2014f6f525..f93128506c 100644
--- a/pp.c
+++ b/pp.c
@@ -3358,7 +3358,7 @@ PP(pp_chr)
char *tmps;
UV value = POPu;
- (void)SvUPGRADE(TARG,SVt_PV);
+ SvUPGRADE(TARG,SVt_PV);
if (value > 255 && !IN_BYTES) {
SvGROW(TARG, (STRLEN)UNISKIP(value)+1);
@@ -3587,7 +3587,7 @@ PP(pp_uc)
else {
STRLEN min = len + 1;
- (void)SvUPGRADE(TARG, SVt_PV);
+ SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, min);
(void)SvPOK_only(TARG);
d = (U8*)SvPVX(TARG);
@@ -3670,7 +3670,7 @@ PP(pp_lc)
else {
STRLEN min = len + 1;
- (void)SvUPGRADE(TARG, SVt_PV);
+ SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, min);
(void)SvPOK_only(TARG);
d = (U8*)SvPVX(TARG);
@@ -3759,7 +3759,7 @@ PP(pp_quotemeta)
SvUTF8_off(TARG); /* decontaminate */
if (len) {
- (void)SvUPGRADE(TARG, SVt_PV);
+ SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, (len * 2) + 1);
d = SvPVX(TARG);
if (DO_UTF8(sv)) {
diff --git a/pp_ctl.c b/pp_ctl.c
index 2ee4e886ad..8fd89c0ac6 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -285,7 +285,7 @@ PP(pp_substcont)
MAGIC *mg;
I32 i;
if (SvTYPE(sv) < SVt_PVMG)
- (void)SvUPGRADE(sv, SVt_PVMG);
+ SvUPGRADE(sv, SVt_PVMG);
if (!(mg = mg_find(sv, PERL_MAGIC_regex_global))) {
sv_magic(sv, Nullsv, PERL_MAGIC_regex_global, Nullch, 0);
mg = mg_find(sv, PERL_MAGIC_regex_global);
diff --git a/pp_hot.c b/pp_hot.c
index e4266988d0..7d6fdc5a64 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1518,7 +1518,7 @@ Perl_do_readline(pTHX)
sv = TARG;
if (SvROK(sv))
sv_unref(sv);
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
tmplen = SvLEN(sv); /* remember if already alloced */
if (!tmplen && !SvREADONLY(sv))
Sv_Grow(sv, 80); /* try short-buffering it */
diff --git a/pp_sys.c b/pp_sys.c
index 89bb05d3e2..68b845110c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -449,7 +449,7 @@ PP(pp_warn)
tmps = SvPV(tmpsv, len);
if ((!tmps || !len) && PL_errgv) {
SV *error = ERRSV;
- (void)SvUPGRADE(error, SVt_PV);
+ SvUPGRADE(error, SVt_PV);
if (SvPOK(error) && SvCUR(error))
sv_catpv(error, "\t...caught");
tmpsv = error;
@@ -486,7 +486,7 @@ PP(pp_die)
}
if (!tmps || !len) {
SV *error = ERRSV;
- (void)SvUPGRADE(error, SVt_PV);
+ SvUPGRADE(error, SVt_PV);
if (multiarg ? SvROK(error) : SvROK(tmpsv)) {
if (!multiarg)
SvSetSV(error,tmpsv);
@@ -1698,7 +1698,7 @@ PP(pp_sysread)
SvCUR_set(bufsv, offset);
read_target = sv_newmortal();
- (void)SvUPGRADE(read_target, SVt_PV);
+ SvUPGRADE(read_target, SVt_PV);
buffer = SvGROW(read_target, (STRLEN)(length + 1));
}
diff --git a/scope.c b/scope.c
index 494fe0bf70..11c81bde94 100644
--- a/scope.c
+++ b/scope.c
@@ -720,7 +720,7 @@ Perl_leave_scope(pTHX_ I32 base)
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
SvTYPE(sv) != SVt_PVGV)
{
- (void)SvUPGRADE(value, SvTYPE(sv));
+ SvUPGRADE(value, SvTYPE(sv));
SvMAGIC_set(value, SvMAGIC(sv));
SvFLAGS(value) |= SvMAGICAL(sv);
SvMAGICAL_off(sv);
diff --git a/sv.c b/sv.c
index 16aac13ed0..dfb0e5a69d 100644
--- a/sv.c
+++ b/sv.c
@@ -3674,7 +3674,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags)
len = 1;
}
#endif
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
*lp = len;
s = SvGROW(sv, len + 1);
SvCUR_set(sv, len);
@@ -4260,9 +4260,9 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
}
}
if (stype == SVt_PVLV)
- (void)SvUPGRADE(dstr, SVt_PVNV);
+ SvUPGRADE(dstr, SVt_PVNV);
else
- (void)SvUPGRADE(dstr, (U32)stype);
+ SvUPGRADE(dstr, (U32)stype);
}
sflags = SvFLAGS(sstr);
@@ -4652,7 +4652,7 @@ Perl_sv_setsv_cow(pTHX_ SV *dstr, SV *sstr)
}
else
new_SV(dstr);
- (void)SvUPGRADE (dstr, SVt_PVIV);
+ SvUPGRADE(dstr, SVt_PVIV);
assert (SvPOK(sstr));
assert (SvPOKp(sstr));
@@ -4675,7 +4675,7 @@ Perl_sv_setsv_cow(pTHX_ SV *dstr, SV *sstr)
SV_COW_NEXT_SV_SET(dstr, SV_COW_NEXT_SV(sstr));
} else {
assert ((SvFLAGS(sstr) & CAN_COW_MASK) == CAN_COW_FLAGS);
- (void)SvUPGRADE (sstr, SVt_PVIV);
+ SvUPGRADE(sstr, SVt_PVIV);
SvREADONLY_on(sstr);
SvFAKE_on(sstr);
DEBUG_C(PerlIO_printf(Perl_debug_log,
@@ -4725,7 +4725,7 @@ Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN
if (iv < 0)
Perl_croak(aTHX_ "panic: sv_setpvn called with negative strlen");
}
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
SvGROW(sv, len + 1);
dptr = SvPVX(sv);
@@ -4771,7 +4771,7 @@ Perl_sv_setpv(pTHX_ register SV *sv, register const char *ptr)
return;
}
len = strlen(ptr);
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
SvGROW(sv, len + 1);
Move(ptr,SvPVX(sv),len+1,char);
@@ -4814,7 +4814,7 @@ Perl_sv_usepvn(pTHX_ register SV *sv, register char *ptr, register STRLEN len)
{
STRLEN allocate;
SV_CHECK_THINKFIRST_COW_DROP(sv);
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
if (!ptr) {
(void)SvOK_off(sv);
return;
@@ -5270,7 +5270,7 @@ Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, const MGVTBL *vtable,
MAGIC* mg;
if (SvTYPE(sv) < SVt_PVMG) {
- (void)SvUPGRADE(sv, SVt_PVMG);
+ SvUPGRADE(sv, SVt_PVMG);
}
Newz(702,mg, 1, MAGIC);
mg->mg_moremagic = SvMAGIC(sv);
@@ -6887,7 +6887,7 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append)
However, perlbench says it's slower, because the existing swipe code
is faster than copy on write.
Swings and roundabouts. */
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
SvSCREAM_off(sv);
@@ -8280,7 +8280,7 @@ Perl_sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
if (SvROK(sv))
sv_unref(sv);
- (void)SvUPGRADE(sv, SVt_PV); /* Never FALSE */
+ SvUPGRADE(sv, SVt_PV); /* Never FALSE */
SvGROW(sv, len + 1);
Move(s,SvPVX_const(sv),len,char);
SvCUR_set(sv, len);
@@ -8690,7 +8690,7 @@ Perl_sv_bless(pTHX_ SV *sv, HV *stash)
SvOBJECT_on(tmpRef);
if (SvTYPE(tmpRef) != SVt_PVIO)
++PL_sv_objcount;
- (void)SvUPGRADE(tmpRef, SVt_PVMG);
+ SvUPGRADE(tmpRef, SVt_PVMG);
SvSTASH_set(tmpRef, (HV*)SvREFCNT_inc(stash));
if (Gv_AMG(stash))
diff --git a/sv.h b/sv.h
index da03ca8501..2d9a367a9f 100644
--- a/sv.h
+++ b/sv.h
@@ -208,7 +208,7 @@ perform the upgrade if necessary. See C<svtype>.
#define SVTYPEMASK 0xff
#define SvTYPE(sv) ((sv)->sv_flags & SVTYPEMASK)
-#define SvUPGRADE(sv, mt) (SvTYPE(sv) >= mt || sv_upgrade(sv, mt))
+#define SvUPGRADE(sv, mt) (void)(SvTYPE(sv) >= mt || sv_upgrade(sv, mt))
#define SVs_PADSTALE 0x00000100 /* lexical has gone out of scope */
#define SVs_PADTMP 0x00000200 /* in use as tmp */
diff --git a/toke.c b/toke.c
index 7ee1b07955..314ebc713b 100644
--- a/toke.c
+++ b/toke.c
@@ -1027,7 +1027,7 @@ S_force_version(pTHX_ char *s, int guessing)
version = yylval.opval;
ver = cSVOPx(version)->op_sv;
if (SvPOK(ver) && !SvNIOK(ver)) {
- (void)SvUPGRADE(ver, SVt_PVNV);
+ SvUPGRADE(ver, SVt_PVNV);
SvNV_set(ver, str_to_version(ver));
SvNOK_on(ver); /* hint that it is a version */
}
@@ -2150,7 +2150,7 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)
PL_rsfp_filters = newAV();
if (!datasv)
datasv = NEWSV(255,0);
- (void)SvUPGRADE(datasv, SVt_PVIO);
+ SvUPGRADE(datasv, SVt_PVIO);
u.filter = funcp;
IoANY(datasv) = u.iop; /* stash funcp into spare field */
IoFLAGS(datasv) |= IOf_FAKE_DIRP;
diff --git a/util.c b/util.c
index 657a8f5884..cb3774edb7 100644
--- a/util.c
+++ b/util.c
@@ -380,7 +380,7 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
mg->mg_len++;
}
s = (U8*)SvPV_force(sv, len);
- (void)SvUPGRADE(sv, SVt_PVBM);
+ SvUPGRADE(sv, SVt_PVBM);
if (len == 0) /* TAIL might be on a zero-length string. */
return;
if (len > 2) {
@@ -2039,7 +2039,7 @@ Perl_my_popen_list(pTHX_ char *mode, int n, SV **args)
LOCK_FDPID_MUTEX;
sv = *av_fetch(PL_fdpid,p[This],TRUE);
UNLOCK_FDPID_MUTEX;
- (void)SvUPGRADE(sv,SVt_IV);
+ SvUPGRADE(sv,SVt_IV);
SvIV_set(sv, pid);
PL_forkprocess = pid;
/* If we managed to get status pipe check for exec fail */
@@ -2190,7 +2190,7 @@ Perl_my_popen(pTHX_ char *cmd, char *mode)
LOCK_FDPID_MUTEX;
sv = *av_fetch(PL_fdpid,p[This],TRUE);
UNLOCK_FDPID_MUTEX;
- (void)SvUPGRADE(sv,SVt_IV);
+ SvUPGRADE(sv,SVt_IV);
SvIV_set(sv, pid);
PL_forkprocess = pid;
if (did_pipes && pid > 0) {
@@ -2656,7 +2656,7 @@ Perl_pidgone(pTHX_ Pid_t pid, int status)
sprintf(spid, "%"IVdf, (IV)pid);
sv = *hv_fetch(PL_pidstatus,spid,strlen(spid),TRUE);
- (void)SvUPGRADE(sv,SVt_IV);
+ SvUPGRADE(sv,SVt_IV);
SvIV_set(sv, status);
return;
}
@@ -3706,7 +3706,7 @@ Perl_getcwd_sv(pTHX_ register SV *sv)
int pathlen=0;
Direntry_t *dp;
- (void)SvUPGRADE(sv, SVt_PV);
+ SvUPGRADE(sv, SVt_PV);
if (PerlLIO_lstat(".", &statbuf) < 0) {
SV_CWD_RETURN_UNDEF;