From: Vincent Pit Date: Mon, 20 Oct 2014 21:31:50 +0000 (-0200) Subject: Don't hardcode the OPc_* values X-Git-Tag: rt99319~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4eaf2c57794114c12c93c0c8faf9bc07b20182f7;p=perl%2Fmodules%2FVariable-Magic.git Don't hardcode the OPc_* values This simplifies the addition of new op classes. --- diff --git a/Magic.xs b/Magic.xs index 03363e1..95d7282 100644 --- a/Magic.xs +++ b/Magic.xs @@ -337,19 +337,19 @@ STATIC I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, int (*cleanup)(pTHX_ void *), vo /* --- Stolen chunk of B --------------------------------------------------- */ typedef enum { - OPc_NULL = 0, - OPc_BASEOP = 1, - OPc_UNOP = 2, - OPc_BINOP = 3, - OPc_LOGOP = 4, - OPc_LISTOP = 5, - OPc_PMOP = 6, - OPc_SVOP = 7, - OPc_PADOP = 8, - OPc_PVOP = 9, - OPc_LOOP = 10, - OPc_COP = 11, - OPc_MAX = 12 + OPc_NULL, + OPc_BASEOP, + OPc_UNOP, + OPc_BINOP, + OPc_LOGOP, + OPc_LISTOP, + OPc_PMOP, + OPc_SVOP, + OPc_PADOP, + OPc_PVOP, + OPc_LOOP, + OPc_COP, + OPc_MAX } opclass; STATIC const char *const vmg_opclassnames[] = {