From b1bc3f345d4dfe19cd94c120c46649336b5cb92b Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 27 Oct 2008 20:25:46 +0000 Subject: Add a macro MUTABLE_PTR(p), which on (non-pedantic) gcc will not cast away const, returning a void *. Add MUTABLE_SV(sv) which uses this, and replace all (SV *) casts either with MUTABLE_SV(sv), or (const SV *). This probably still needs some work - assigning to SvPVX() and SvRV() is now likely to generate a casting error. The core doesn't do this. But as-is it's finding bugs that can be fixed. p4raw-id: //depot/perl@34605 --- gv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gv.h') diff --git a/gv.h b/gv.h index f55d41f3ee..85b03800f5 100644 --- a/gv.h +++ b/gv.h @@ -88,7 +88,7 @@ Return the SV from the GV. #endif #define GvREFCNT(gv) (GvGP(gv)->gp_refcnt) -#define GvIO(gv) ((gv) && SvTYPE((SV*)gv) == SVt_PVGV && GvGP(gv) ? GvIOp(gv) : NULL) +#define GvIO(gv) ((gv) && SvTYPE((const SV*)gv) == SVt_PVGV && GvGP(gv) ? GvIOp(gv) : NULL) #define GvIOp(gv) (GvGP(gv)->gp_io) #define GvIOn(gv) (GvIO(gv) ? GvIOp(gv) : GvIOp(gv_IOadd(gv))) -- cgit v1.2.1