This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Another warning-silencing cast
[perl5.git] / cop.h
diff --git a/cop.h b/cop.h
index c248eed..65651b0 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -268,19 +268,26 @@ struct block_sub {
     AV *       savearray;
     AV *       argarray;
     I32                olddepth;
-    U8         hasargs;
-    U8         lval;           /* XXX merge lval and hasargs? */
+    /* These are merged to to get struct context down to 64 bytes on ILP32.  */
+    U8         hasargs_lval;
     PAD                *oldcomppad;
     OP *       retop;  /* op to execute on exit from sub */
 };
 
+#define CX_SUB_HASARGS_SET(cx, v)      ((cx)->blk_sub.hasargs_lval = \
+ ((cx)->blk_sub.hasargs_lval & 0xFE) | ((v) ? 1 : 0))
+#define CX_SUB_HASARGS_GET(cx)         ((cx)->blk_sub.hasargs_lval & 0x01)
+
+#define CX_SUB_LVAL_SET(cx, v)         ((cx)->blk_sub.hasargs_lval = \
+ (((cx)->blk_sub.hasargs_lval & 0x01) | ((v) & (OPpLVAL_INTRO|OPpENTERSUB_INARGS))))
+#define CX_SUB_LVAL(cx)                        ((cx)->blk_sub.hasargs_lval & 0xFE)
+#define CX_SUB_LVAL_INARGS(cx)         ((cx)->blk_sub.hasargs_lval & \
+                                        OPpENTERSUB_INARGS)
+
 /* base for the next two macros. Don't use directly.
  * Note that the refcnt of the cv is incremented twice;  The CX one is
  * decremented by LEAVESUB, the other by LEAVE. */
 
-#define CX_SUB_HASARGS_SET(cx, v)      ((cx)->blk_sub.hasargs = (v))
-#define CX_SUB_HASARGS_GET(cx)         ((cx)->blk_sub.hasargs + 0)
-
 #define PUSHSUB_BASE(cx)                                               \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.olddepth = CvDEPTH(cv);                             \
@@ -295,13 +302,12 @@ struct block_sub {
 
 #define PUSHSUB(cx)                                                    \
        PUSHSUB_BASE(cx)                                                \
-       cx->blk_sub.lval = PL_op->op_private &                          \
-                             (OPpLVAL_INTRO|OPpENTERSUB_INARGS);
+       CX_SUB_LVAL_SET(cx, PL_op->op_private)
 
 /* variant for use by OP_DBSTATE, where op_private holds hint bits */
 #define PUSHSUB_DB(cx)                                                 \
        PUSHSUB_BASE(cx)                                                \
-       cx->blk_sub.lval = 0;
+       CX_SUB_LVAL_SET(cx, 0)
 
 
 #define PUSHFORMAT(cx)                                                 \