]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Don't hardcode the OPc_* values
authorVincent Pit <vince@profvince.com>
Mon, 20 Oct 2014 21:31:50 +0000 (19:31 -0200)
committerVincent Pit <vince@profvince.com>
Mon, 20 Oct 2014 21:31:50 +0000 (19:31 -0200)
This simplifies the addition of new op classes.

Magic.xs

index 03363e1057916ede0fa519cd2ac56f38a681b8bb..95d728287cd04f71a3d172713946487360b0766c 100644 (file)
--- 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[] = {