From: Vincent Pit Date: Wed, 6 Jan 2010 22:48:11 +0000 (+0100) Subject: Use SvRV_const() whenever possible X-Git-Tag: v0.40~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4d18d9fb3cb2ad7da53f58a9b0741ba6cb97ec62;p=perl%2Fmodules%2FVariable-Magic.git Use SvRV_const() whenever possible --- diff --git a/Magic.xs b/Magic.xs index 120287f..3ec0b6f 100644 --- a/Magic.xs +++ b/Magic.xs @@ -100,6 +100,10 @@ STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { # define SvMAGIC_set(sv, val) (SvMAGIC(sv) = (val)) #endif +#ifndef SvRV_const +# define SvRV_const(sv) SvRV((SV *) sv) +#endif + #ifndef mPUSHu # define mPUSHu(U) PUSHs(sv_2mortal(newSVuv(U))) #endif @@ -526,7 +530,7 @@ STATIC SV *vmg_wizard_new(pTHX_ const MGWIZ *w) { STATIC const SV *vmg_wizard_validate(pTHX_ const SV *wiz) { #define vmg_wizard_validate(W) vmg_wizard_validate(aTHX_ (W)) if (SvROK(wiz)) { - wiz = SvRV(wiz); + wiz = SvRV_const(wiz); if (SvIOK(wiz)) return wiz; }