#define AvALLOC(av) (*((SV***)&((XPVAV*) SvANY(av))->xav_alloc))
#define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max
#define AvFILLp(av) ((XPVAV*) SvANY(av))->xav_fill
-#define AvARYLEN(av) (*Perl_av_arylen_p(aTHX_ (AV*)av))
+#define AvARYLEN(av) (*Perl_av_arylen_p(aTHX_ MUTABLE_AV(av)))
#define AvREAL(av) (SvFLAGS(av) & SVpav_REAL)
#define AvREAL_on(av) (SvFLAGS(av) |= SVpav_REAL)
=cut
*/
-#define newAV() ((AV *)newSV_type(SVt_PVAV))
+#define newAV() MUTABLE_AV(newSV_type(SVt_PVAV))
/*
* Local variables:
# define MUTABLE_PTR(p) ((void *) (p))
#endif
+#define MUTABLE_AV(p) ((AV *)MUTABLE_PTR(p))
#define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
/* XXX Configure ought to have a test for a boolean type, if I can
#define PAD_BASE_SV(padlist, po) \
(AvARRAY(padlist)[1]) \
- ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : NULL;
+ ? AvARRAY(MUTABLE_AV((AvARRAY(padlist)[1])))[po] : NULL;
#define PAD_SET_CUR_NOSAVE(padlist,nth) \
*/
#define CX_CURPAD_SAVE(block) (block).oldcomppad = PL_comppad
-#define CX_CURPAD_SV(block,po) (AvARRAY((AV*)((block).oldcomppad))[po])
+#define CX_CURPAD_SV(block,po) (AvARRAY(MUTABLE_AV(((block).oldcomppad)))[po])
/*
* sub's CV or padlist. */
#define PAD_CLONE_VARS(proto_perl, param) \
- PL_comppad = (AV *) ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad); \
+ PL_comppad = MUTABLE_AV(ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad)); \
PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
PL_comppad_name = av_dup(proto_perl->Icomppad_name, param); \
PL_comppad_name_fill = proto_perl->Icomppad_name_fill; \
#define THREAD_RET_CAST(x) ((any_t) x)
#define DETACH(t) cthread_detach(t->self)
-#define JOIN(t, avp) (*(avp) = (AV *)cthread_join(t->self))
+#define JOIN(t, avp) (*(avp) = MUTABLE_AV(cthread_join(t->self)))
#define PERL_SET_CONTEXT(t) cthread_set_data(cthread_self(), t)
#define PERL_GET_CONTEXT cthread_data(cthread_self())