From: Marcus Holland-Moritz Date: Sun, 1 Aug 2004 12:46:48 +0000 (+0200) Subject: SvO?OK_off()'s return value X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c34ef67a6aacb77e2b5421df56439f11f4d78c0;p=p5sagit%2Fp5-mst-13.2.git SvO?OK_off()'s return value Message-Id: <20040801124648.7f9b3cee@r2d2> Move (void) casts into SvOOK_off macro. p4raw-id: //depot/perl@23277 --- diff --git a/gv.c b/gv.c index a461e0d..e20f278 100644 --- a/gv.c +++ b/gv.c @@ -1086,7 +1086,7 @@ Perl_gv_fullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain) char *name; HV *hv = GvSTASH(gv); if (!hv) { - (void)SvOK_off(sv); + SvOK_off(sv); return; } sv_setpv(sv, prefix ? prefix : ""); diff --git a/mg.c b/mg.c index ee705ad..e5eedc5 100644 --- a/mg.c +++ b/mg.c @@ -208,7 +208,7 @@ Perl_mg_get(pTHX_ SV *sv) 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; } @@ -695,7 +695,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) 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 @@ -1688,7 +1688,7 @@ Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg) return 0; } } - (void)SvOK_off(sv); + SvOK_off(sv); return 0; } @@ -1861,7 +1861,7 @@ Perl_magic_getvec(pTHX_ SV *sv, MAGIC *mg) SV *lsv = LvTARG(sv); if (!lsv) { - (void)SvOK_off(sv); + SvOK_off(sv); return 0; } @@ -1968,7 +1968,7 @@ Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg) 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; } diff --git a/perl.c b/perl.c index 88f8547..957bbbc 100644 --- a/perl.c +++ b/perl.c @@ -911,7 +911,7 @@ perl_destruct(pTHXx) } } /* 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); diff --git a/pp.c b/pp.c index f58306d..772954e 100644 --- a/pp.c +++ b/pp.c @@ -176,7 +176,7 @@ PP(pp_rv2gv) 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; @@ -828,12 +828,12 @@ PP(pp_undef) 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); } @@ -3141,7 +3141,7 @@ PP(pp_substr) sv_magic(TARG, Nullsv, PERL_MAGIC_substr, Nullch, 0); } else - (void)SvOK_off(TARG); + SvOK_off(TARG); LvTYPE(TARG) = 'x'; if (LvTARG(TARG) != sv) { diff --git a/pp_ctl.c b/pp_ctl.c index 69f499c..dd6962c 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -213,7 +213,7 @@ PP(pp_substcont) } else #endif { - (void)SvOOK_off(targ); + SvOOK_off(targ); if (SvLEN(targ)) Safefree(SvPVX(targ)); } diff --git a/pp_hot.c b/pp_hot.c index 98cad17..1054d1d 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1537,7 +1537,7 @@ Perl_do_readline(pTHX) /* undef TARG, and push that undefined value */ if (type != OP_RCATLINE) { SV_CHECK_THINKFIRST_COW_DROP(TARG); - (void)SvOK_off(TARG); + SvOK_off(TARG); } PUSHTARG; } @@ -1603,7 +1603,7 @@ Perl_do_readline(pTHX) if (gimme == G_SCALAR) { if (type != OP_RCATLINE) { SV_CHECK_THINKFIRST_COW_DROP(TARG); - (void)SvOK_off(TARG); + SvOK_off(TARG); } SPAGAIN; PUSHTARG; @@ -2282,7 +2282,7 @@ PP(pp_subst) } else #endif { - (void)SvOOK_off(TARG); + SvOOK_off(TARG); if (SvLEN(TARG)) Safefree(SvPVX(TARG)); } @@ -2964,7 +2964,7 @@ Perl_vivify_ref(pTHX_ SV *sv, U32 to_what) 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; } diff --git a/scope.c b/scope.c index b38ae7e..af10b71 100644 --- a/scope.c +++ b/scope.c @@ -934,7 +934,7 @@ Perl_leave_scope(pTHX_ I32 base) case SVt_PVCV: Perl_croak(aTHX_ "panic: leave_scope pad code"); default: - (void)SvOK_off(sv); + SvOK_off(sv); break; } SvPADSTALE_on(sv); /* mark as no longer live */ diff --git a/sv.c b/sv.c index bdc6cbb..20f344f 100644 --- a/sv.c +++ b/sv.c @@ -4952,7 +4952,8 @@ Perl_sv_release_IVX(pTHX_ register SV *sv) { if (SvIsCOW(sv)) sv_force_normal_flags(sv, 0); - return SvOOK_off(sv); + SvOOK_off(sv); + return 0; } #endif /* @@ -5975,7 +5976,7 @@ Perl_sv_clear(pTHX_ register SV *sv) case SVt_PVNV: case SVt_PVIV: freescalar: - (void)SvOOK_off(sv); + SvOOK_off(sv); /* FALL THROUGH */ case SVt_PV: case SVt_RV: @@ -7917,7 +7918,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash) sv_unref(sv); continue; } - (void)SvOK_off(sv); + SvOK_off(sv); if (SvTYPE(sv) >= SVt_PV) { SvCUR_set(sv, 0); if (SvPVX(sv) != Nullch) @@ -8521,14 +8522,14 @@ Perl_newSVrv(pTHX_ SV *rv, const char *classname) 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); diff --git a/sv.h b/sv.h index c9341e6..c26da9d 100644 --- a/sv.h +++ b/sv.h @@ -567,9 +567,9 @@ Set the length of the string which is in the SV. See C. #define SvIOK_on(sv) (SvRELEASE_IVX(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)) \ @@ -585,7 +585,7 @@ Set the length of the string which is in the SV. See C. #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)) /* @@ -626,7 +626,7 @@ and leaves the UTF-8 status as it was. #define SvVOK(sv) (SvMAGICAL(sv) && mg_find(sv,'V')) #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) @@ -1124,7 +1124,7 @@ Like C but doesn't process magic. #define CAN_COW_FLAGS (SVp_POK|SVf_POK) #else -# define SvRELEASE_IVX(sv) ((void)SvOOK_off(sv)) +# define SvRELEASE_IVX(sv) SvOOK_off(sv) #endif /* PERL_COPY_ON_WRITE */ #define SV_CHECK_THINKFIRST(sv) if (SvTHINKFIRST(sv)) \