diff options
author | David Mitchell <davem@iabyn.com> | 2015-11-24 12:38:15 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-11-24 12:38:15 +0000 |
commit | b5134c56ad069262bdb18e74fa3a6e020de17558 (patch) | |
tree | c52fc929377030dfbb65abd1befa9f6445660b33 /ext | |
parent | d3b9036e206e03f8b788b7eecad735d30f355745 (diff) | |
download | perl-b5134c56ad069262bdb18e74fa3a6e020de17558.tar.gz |
Opcode.xs: silence compiler warning
Opcode.xs: In function ‘opmask_addlocal’:
../../perl.h:6473:12: warning: unused variable ‘my_cxtp’ [-Wunused-variable]
my_cxt_t *my_cxtp = (my_cxt_t *)PL_my_cxt_list[MY_CXT_INDEX]
^
Without debugging enabled, opcode_debug becomes a constant, so
dMY_CXT isn't needed in opmask_addlocal().
Make the enabling of debugging based on a macro (OPCODE_DEBUG)
rather then on '#if 0', then use that accordingly.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Opcode/Opcode.pm | 2 | ||||
-rw-r--r-- | ext/Opcode/Opcode.xs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index 78ffd54f7e..1522c4c378 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -6,7 +6,7 @@ use strict; our($VERSION, @ISA, @EXPORT_OK); -$VERSION = "1.33"; +$VERSION = "1.34"; use Carp; use Exporter (); diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs index c1170e98aa..936ffba25e 100644 --- a/ext/Opcode/Opcode.xs +++ b/ext/Opcode/Opcode.xs @@ -13,7 +13,7 @@ typedef struct { HV * x_op_named_bits; /* cache shared for whole process */ SV * x_opset_all; /* mask with all bits set */ IV x_opset_len; /* length of opmasks in bytes */ -#if 0 +#ifdef OPCODE_DEBUG int x_opcode_debug; /* unused warn() emitting debugging code */ #endif } my_cxt_t; @@ -23,7 +23,7 @@ START_MY_CXT #define op_named_bits (MY_CXT.x_op_named_bits) #define opset_all (MY_CXT.x_opset_all) #define opset_len (MY_CXT.x_opset_len) -#if 0 +#ifdef OPCODE_DEBUG # define opcode_debug (MY_CXT.x_opcode_debug) #else /* no API to turn this on at runtime, so constant fold the code away */ @@ -227,7 +227,9 @@ static void opmask_addlocal(pTHX_ SV *opset, char *op_mask_buf) /* Localise PL_op_mask then opmask_add() */ { char *orig_op_mask = PL_op_mask; +#ifdef OPCODE_DEBUG dMY_CXT; +#endif SAVEVPTR(PL_op_mask); /* XXX casting to an ordinary function ptr from a member function ptr |