summaryrefslogtreecommitdiff
path: root/pad.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-21 00:17:08 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-30 11:48:36 -0800
commite1c02f8429b9931efc13e763746fa70a9acd3324 (patch)
treee9b98d9b3a598e8a8195177c2b8133369650325f /pad.h
parent3bc8ec963e9657121e69386195faa61e46928dda (diff)
downloadperl-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.h10
1 files changed, 5 insertions, 5 deletions
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<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)