From e1c02f8429b9931efc13e763746fa70a9acd3324 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 21 Nov 2014 00:17:08 -0800 Subject: Use PADNAME rather than SV in the source This is in preparation for making PADNAME a separate type. This commit is not perfect. What I did was temporarily make PADNAME a separate struct identical to struct sv and make whatever changes were necessary to avoid compiler warnings. In some cases I had to add tem- porary SV casts. --- pad.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pad.h') diff --git a/pad.h b/pad.h index 0e29b10d90..049b1c4a56 100644 --- a/pad.h +++ b/pad.h @@ -287,7 +287,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() #define PadlistNAMESMAX(pl) PadnamelistMAX(PadlistNAMES(pl)) #define PadlistREFCNT(pl) 1 /* reserved for future use */ -#define PadnamelistARRAY(pnl) AvARRAY(pnl) +#define PadnamelistARRAY(pnl) ((PADNAME **)AvARRAY(pnl)) #define PadnamelistMAX(pnl) AvFILLp(pnl) #define PadnamelistMAXNAMED(pnl) \ ((XPVAV*) SvANY(pnl))->xmg_u.xmg_hash_index @@ -295,8 +295,8 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() #define PadARRAY(pad) AvARRAY(pad) #define PadMAX(pad) AvFILLp(pad) -#define PadnamePV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL) -#define PadnameLEN(pn) ((pn) == &PL_sv_undef ? 0 : SvCUR(pn)) +#define PadnamePV(pn) (SvPOKp(pn) ? SvPVX_const(pn) : NULL) +#define PadnameLEN(pn) ((SV*)(pn) == &PL_sv_undef ? 0 : SvCUR(pn)) #define PadnameUTF8(pn) !!SvUTF8(pn) #define PadnameSV(pn) pn #define PadnameIsOUR(pn) !!SvPAD_OUR(pn) @@ -404,10 +404,10 @@ ling pad (lvalue) to C. Note that C is hijacked for this purpose */ #define PAD_COMPNAME(po) PAD_COMPNAME_SV(po) -#define PAD_COMPNAME_SV(po) (AvARRAY(PL_comppad_name)[(po)]) +#define PAD_COMPNAME_SV(po) ((PADNAME *)AvARRAY(PL_comppad_name)[(po)]) #define PAD_COMPNAME_FLAGS(po) SvFLAGS(PAD_COMPNAME_SV(po)) #define PAD_COMPNAME_FLAGS_isOUR(po) SvPAD_OUR(PAD_COMPNAME_SV(po)) -#define PAD_COMPNAME_PV(po) SvPV_nolen(PAD_COMPNAME_SV(po)) +#define PAD_COMPNAME_PV(po) PadnamePV(PAD_COMPNAME(po)) #define PAD_COMPNAME_TYPE(po) pad_compname_type(po) -- cgit v1.2.1