From: Rafael Garcia-Suarez Date: Wed, 26 Aug 2009 12:32:22 +0000 (+0200) Subject: Use less constness in MAD code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d503a9ba1b647d7301de5326f3dab5a9176a98a4;p=p5sagit%2Fp5-mst-13.2.git Use less constness in MAD code This suppresses warnings, because sometimes the constness was taken away --- diff --git a/embed.fnc b/embed.fnc index 33774c7..3f9ddcd 100644 --- a/embed.fnc +++ b/embed.fnc @@ -2156,7 +2156,7 @@ Mp |void |append_madprops|NULLOK MADPROP* tm|NULLOK OP* o|char slot Mp |void |addmad |NULLOK MADPROP* tm|NULLOK MADPROP** root \ |char slot Mp |MADPROP*|newMADsv |char key|NN SV* sv -Mp |MADPROP*|newMADPROP |char key|char type|NULLOK const void* val \ +Mp |MADPROP*|newMADPROP |char key|char type|NULLOK void* val \ |I32 vlen Mp |void |mad_free |NULLOK MADPROP* mp diff --git a/op.c b/op.c index e03997a..e31c050 100644 --- a/op.c +++ b/op.c @@ -2770,7 +2770,7 @@ Perl_token_getmad(pTHX_ TOKEN* tk, OP* o, char slot) /* faked up qw list? */ if (slot == '(' && tm->mad_type == MAD_SV && - SvPVX((const SV *)tm->mad_val)[0] == 'q') + SvPVX((SV *)tm->mad_val)[0] == 'q') slot = 'x'; if (o) { @@ -2927,7 +2927,7 @@ Perl_newMADsv(pTHX_ char key, SV* sv) } MADPROP * -Perl_newMADPROP(pTHX_ char key, char type, const void* val, I32 vlen) +Perl_newMADPROP(pTHX_ char key, char type, void* val, I32 vlen) { MADPROP *mp; Newxz(mp, 1, MADPROP); diff --git a/op.h b/op.h index e8ba8ef..9608564 100644 --- a/op.h +++ b/op.h @@ -646,7 +646,7 @@ struct loop { struct madprop { MADPROP* mad_next; - const void *mad_val; + void *mad_val; U32 mad_vlen; /* short mad_count; */ char mad_key; diff --git a/proto.h b/proto.h index 5fe779a..0dc4aab 100644 --- a/proto.h +++ b/proto.h @@ -6510,7 +6510,7 @@ PERL_CALLCONV MADPROP* Perl_newMADsv(pTHX_ char key, SV* sv) #define PERL_ARGS_ASSERT_NEWMADSV \ assert(sv) -PERL_CALLCONV MADPROP* Perl_newMADPROP(pTHX_ char key, char type, const void* val, I32 vlen); +PERL_CALLCONV MADPROP* Perl_newMADPROP(pTHX_ char key, char type, void* val, I32 vlen); PERL_CALLCONV void Perl_mad_free(pTHX_ MADPROP* mp); # if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)