PERL PERL5 CHANGES 26 CHANGE 23313 INTEGRATE
Date: Fri, 10 Sep 2004 03:30:00 -0700

Subject: Change 23313: Integrate:
From: nick@no-spam (Nicholas Clark)

Change 23313 by nicholas@no-spam on 2004/09/10 09:56:57

Integrate:
[ 23277]
Subject: SvO?OK_off()'s return value From: Marcus Holland-Moritz <mhx-perl@no-spam>
Date: Sun, 1 Aug 2004 12:46:48 +0200
Message-Id: <20040801124648.7f9b3cee@no-spam>

Move (void) casts into SvOOK_off macro.

Affected files ...

... //depot/maint-5.8/perl/gv.c#20 integrate ... //depot/maint-5.8/perl/mg.c#46 integrate ... //depot/maint-5.8/perl/perl.c#85 integrate ... //depot/maint-5.8/perl/pp.c#44 integrate ... //depot/maint-5.8/perl/pp_ctl.c#62 edit ... //depot/maint-5.8/perl/pp_hot.c#52 integrate ... //depot/maint-5.8/perl/scope.c#21 integrate ... //depot/maint-5.8/perl/sv.c#110 integrate ... //depot/maint-5.8/perl/sv.h#31 integrate
Differences ...

==== //depot/maint-5.8/perl/gv.c#20 (text) ====
Index: perl/gv.c --- perl/gv.c#19~23308~ Fri Sep 10 00:28:09 2004
+++ perl/gv.c Fri Sep 10 02:56:57 2004
@@no-spam -1093,7 +1093,7 @@no-spam {
HV *hv = GvSTASH(gv);
if (!hv) {
- (void)SvOK_off(sv);
+ SvOK_off(sv);
return;
}
sv_setpv(sv, prefix ? prefix : "");

==== //depot/maint-5.8/perl/mg.c#46 (text) ====
Index: perl/mg.c --- perl/mg.c#45~23308~ Fri Sep 10 00:28:09 2004
+++ perl/mg.c Fri Sep 10 02:56:57 2004
@@no-spam -203,7 +203,7 @@no-spam if (SvREFCNT(sv) == 1) {
/* We hold the last reference to this SV, which implies that the SV was deleted as a side effect of the routines we called. */
- (void)SvOK_off(sv);
+ SvOK_off(sv);
}
return 0;
}
@@no-spam -693,7 +693,7 @@no-spam case '\023': /* ^S */
if (*(mg->mg_ptr+1) == '\0') {
if (PL_lex_state != LEX_NOTPARSING)
- (void)SvOK_off(sv);
+ SvOK_off(sv);
else if (PL_in_eval)
sv_setiv(sv, PL_in_eval & ~(EVAL_INREQUIRE));
else @@no-spam -1684,7 +1684,7 @@no-spam return 0;
}
}
- (void)SvOK_off(sv);
+ SvOK_off(sv);
return 0;
}
@@no-spam -1852,7 +1852,7 @@no-spam SV *lsv = LvTARG(sv);
if (!lsv) {
- (void)SvOK_off(sv);
+ SvOK_off(sv);
return 0;
}
@@no-spam -1973,7 +1973,7 @@no-spam Perl_croak(aTHX_ "panic: magic_killbackrefs");
/* XXX Should we check that it hasn't changed? */
SvRV(svp[i]) = 0;
- (void)SvOK_off(svp[i]);
+ SvOK_off(svp[i]);
SvWEAKREF_off(svp[i]);
svp[i] = Nullsv;
}

==== //depot/maint-5.8/perl/perl.c#85 (text) ====
Index: perl/perl.c --- perl/perl.c#84~23308~ Fri Sep 10 00:28:09 2004
+++ perl/perl.c Fri Sep 10 02:56:57 2004
@@no-spam -1055,7 +1055,7 @@no-spam }
}
/* we know that type >= SVt_PV */
- (void)SvOOK_off(PL_mess_sv);
+ SvOOK_off(PL_mess_sv);
Safefree(SvPVX(PL_mess_sv));
Safefree(SvANY(PL_mess_sv));
Safefree(PL_mess_sv);

==== //depot/maint-5.8/perl/pp.c#44 (text) ====
Index: perl/pp.c --- perl/pp.c#43~23308~ Fri Sep 10 00:28:09 2004
+++ perl/pp.c Fri Sep 10 02:56:57 2004
@@no-spam -176,7 +176,7 @@no-spam if (SvTYPE(sv) < SVt_RV)
sv_upgrade(sv, SVt_RV);
if (SvPVX(sv)) {
- (void)SvOOK_off(sv); /* backoff */
+ SvOOK_off(sv); /* backoff */
if (SvLEN(sv))
Safefree(SvPVX(sv));
SvLEN(sv)=SvCUR(sv)=0;
@@no-spam -823,12 +823,12 @@no-spam break;
default:
if (SvTYPE(sv) >= SVt_PV && SvPVX(sv) && SvLEN(sv)) {
- (void)SvOOK_off(sv);
+ SvOOK_off(sv);
Safefree(SvPVX(sv));
SvPV_set(sv, Nullch);
SvLEN_set(sv, 0);
}
- (void)SvOK_off(sv);
+ SvOK_off(sv);
SvSETMAGIC(sv);
}
@@no-spam -3128,7 +3128,7 @@no-spam sv_magic(TARG, Nullsv, PERL_MAGIC_substr, Nullch, 0);
}
else - (void)SvOK_off(TARG);
+ SvOK_off(TARG);
LvTYPE(TARG) = 'x';
if (LvTARG(TARG) != sv) {

==== //depot/maint-5.8/perl/pp_ctl.c#62 (text) ====
Index: perl/pp_ctl.c --- perl/pp_ctl.c#61~23308~ Fri Sep 10 00:28:09 2004
+++ perl/pp_ctl.c Fri Sep 10 02:56:57 2004
@@no-spam -207,7 +207,7 @@no-spam }
cx->sb_rxtainted |= RX_MATCH_TAINTED(rx);
- (void)SvOOK_off(targ);
+ SvOOK_off(targ);
if (SvLEN(targ))
Safefree(SvPVX(targ));
SvPVX(targ) = SvPVX(dstr);

==== //depot/maint-5.8/perl/pp_hot.c#52 (text) ====
Index: perl/pp_hot.c --- perl/pp_hot.c#51~23308~ Fri Sep 10 00:28:09 2004
+++ perl/pp_hot.c Fri Sep 10 02:56:57 2004
@@no-spam -1555,7 +1555,7 @@no-spam /* undef TARG, and push that undefined value */
if (type != OP_RCATLINE) {
SV_CHECK_THINKFIRST(TARG);
- (void)SvOK_off(TARG);
+ SvOK_off(TARG);
}
PUSHTARG;
}
@@no-spam -1621,7 +1621,7 @@no-spam if (gimme == G_SCALAR) {
if (type != OP_RCATLINE) {
SV_CHECK_THINKFIRST(TARG);
- (void)SvOK_off(TARG);
+ SvOK_off(TARG);
}
SPAGAIN;
PUSHTARG;
@@no-spam -2265,7 +2265,7 @@no-spam else sv_catpvn(dstr, s, strend - s);
- (void)SvOOK_off(TARG);
+ SvOOK_off(TARG);
if (SvLEN(TARG))
Safefree(SvPVX(TARG));
SvPVX(TARG) = SvPVX(dstr);
@@no-spam -3078,7 +3078,7 @@no-spam if (SvTYPE(sv) < SVt_RV)
sv_upgrade(sv, SVt_RV);
else if (SvTYPE(sv) >= SVt_PV) {
- (void)SvOOK_off(sv);
+ SvOOK_off(sv);
Safefree(SvPVX(sv));
SvLEN(sv) = SvCUR(sv) = 0;
}

==== //depot/maint-5.8/perl/scope.c#21 (text) ====
Index: perl/scope.c --- perl/scope.c#20~23308~ Fri Sep 10 00:28:09 2004
+++ perl/scope.c Fri Sep 10 02:56:57 2004
@@no-spam -938,7 +938,7 @@no-spam case SVt_PVCV:
Perl_croak(aTHX_ "panic: leave_scope pad code");
default:
- (void)SvOK_off(sv);
+ SvOK_off(sv);
break;
}
}

==== //depot/maint-5.8/perl/sv.c#110 (text) ====
Index: perl/sv.c --- perl/sv.c#109~23306~ Thu Sep 9 23:39:03 2004
+++ perl/sv.c Fri Sep 10 02:56:57 2004
@@no-spam -5211,7 +5211,7 @@no-spam case SVt_PVNV:
case SVt_PVIV:
freescalar:
- (void)SvOOK_off(sv);
+ SvOOK_off(sv);
/* FALL THROUGH */
case SVt_PV:
case SVt_RV:
@@no-spam -7131,7 +7131,7 @@no-spam sv_unref(sv);
continue;
}
- (void)SvOK_off(sv);
+ SvOK_off(sv);
if (SvTYPE(sv) >= SVt_PV) {
SvCUR_set(sv, 0);
if (SvPVX(sv) != Nullch)
@@no-spam -7731,14 +7731,14 @@no-spam if (SvTYPE(rv) < SVt_RV)
sv_upgrade(rv, SVt_RV);
else if (SvTYPE(rv) > SVt_RV) {
- (void)SvOOK_off(rv);
+ SvOOK_off(rv);
if (SvPVX(rv) && SvLEN(rv))
Safefree(SvPVX(rv));
SvCUR_set(rv, 0);
SvLEN_set(rv, 0);
}
- (void)SvOK_off(rv);
+ SvOK_off(rv);
SvRV(rv) = sv;
SvROK_on(rv);

==== //depot/maint-5.8/perl/sv.h#31 (text) ====
Index: perl/sv.h --- perl/sv.h#30~23308~ Fri Sep 10 00:28:09 2004
+++ perl/sv.h Fri Sep 10 02:56:57 2004
@@no-spam -581,9 +581,9 @@no-spam #define SvIOK_on(sv) ((void)SvOOK_off(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
#define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK|SVf_IVisUV))
-#define SvIOK_only(sv) ((void)SvOK_off(sv), \
+#define SvIOK_only(sv) (SvOK_off(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
-#define SvIOK_only_UV(sv) ((void)SvOK_off_exc_UV(sv), \
+#define SvIOK_only_UV(sv) (SvOK_off_exc_UV(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
#define SvIOK_UV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
@@no-spam -600,7 +600,7 @@no-spam #define SvNOK(sv) (SvFLAGS(sv) & SVf_NOK)
#define SvNOK_on(sv) (SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
#define SvNOK_off(sv) (SvFLAGS(sv) &= ~(SVf_NOK|SVp_NOK))
-#define SvNOK_only(sv) ((void)SvOK_off(sv), \
+#define SvNOK_only(sv) (SvOK_off(sv), \
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
/*
@@no-spam -640,7 +640,7 @@no-spam #define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
#define SvOOK_on(sv) ((void)SvIOK_off(sv), SvFLAGS(sv) |= SVf_OOK)
-#define SvOOK_off(sv) (SvOOK(sv) && sv_backoff(sv))
+#define SvOOK_off(sv) ((void)(SvOOK(sv) && sv_backoff(sv)))
#define SvFAKE(sv) (SvFLAGS(sv) & SVf_FAKE)
#define SvFAKE_on(sv) (SvFLAGS(sv) |= SVf_FAKE)
End of Patch.