diff options
author | David Mitchell <davem@iabyn.com> | 2019-09-20 10:57:54 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-09-23 14:42:00 +0100 |
commit | f417cfa90670b17255b02c7dc1a88924c102479f (patch) | |
tree | 3c2b0db38c681f9aca33e93bab8bfa1900d13c3e /pp.c | |
parent | 558b227c020be1ce3d21af4f57ae649d8a2229eb (diff) | |
download | perl-f417cfa90670b17255b02c7dc1a88924c102479f.tar.gz |
OP_ARGCHECK: use custom aux struct
This op is of class OP_UNOP_AUX, Ops of this class have an op_aux pointer
which typically points to a variable-length malloced array of IVs,
UVs, etc. However in the specific case of OP_ARGCHECK the data stored
in the aux struct is fixed. So this commit casts the aux pointer to a
struct containing the relevant fields (number of parameters etc), rather
than referring to them as aux[0], aux[1] etc. This makes the code more
readable.
Should be no functional changes.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -7110,7 +7110,7 @@ S_find_runcv_name(void) return sv; } -/* Check a a subs arguments - i.e. that it has the correct number of args +/* Check a sub's arguments - i.e. that it has the correct number of args * (and anything else we might think of in future). Typically used with * signatured subs. */ @@ -7118,10 +7118,10 @@ S_find_runcv_name(void) PP(pp_argcheck) { OP * const o = PL_op; - UNOP_AUX_item *aux = cUNOP_AUXo->op_aux; - IV params = aux[0].iv; - IV opt_params = aux[1].iv; - char slurpy = (char)(aux[2].iv); + struct op_argcheck_aux *aux = (struct op_argcheck_aux *)cUNOP_AUXo->op_aux; + IV params = aux->params; + IV opt_params = aux->opt_params; + char slurpy = aux->slurpy; AV *defav = GvAV(PL_defgv); /* @_ */ IV argc; bool too_few; |