diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-21 00:17:08 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-30 11:48:36 -0800 |
commit | e1c02f8429b9931efc13e763746fa70a9acd3324 (patch) | |
tree | e9b98d9b3a598e8a8195177c2b8133369650325f /pad.h | |
parent | 3bc8ec963e9657121e69386195faa61e46928dda (diff) | |
download | perl-e1c02f8429b9931efc13e763746fa70a9acd3324.tar.gz |
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.
Diffstat (limited to 'pad.h')
-rw-r--r-- | pad.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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<gen>. Note that C<SvUV_set> 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) |