Change 33315 by [EMAIL PROTECTED] on 2008/02/15 09:19:49
Silence compiler warnings on Win32/VC6
Subject: RE: Bit-fields patch causes warnings on Win32/VC6
From: "Jan Dubois" <[EMAIL PROTECTED]>
Date: Thu, 14 Feb 2008 11:24:01 -0800
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/B/B.xs#150 edit
... //depot/perl/op.c#989 edit
... //depot/perl/op.h#207 edit
Differences ...
==== //depot/perl/ext/B/B.xs#150 (text) ====
Index: perl/ext/B/B.xs
--- perl/ext/B/B.xs#149~33233~ 2008-02-04 06:15:11.000000000 -0800
+++ perl/ext/B/B.xs 2008-02-15 01:19:49.000000000 -0800
@@ -916,7 +916,7 @@
#if PERL_VERSION >= 9
-U8
+U16
OP_opt(o)
B::OP o
@@ -938,7 +938,7 @@
#if PERL_VERSION >= 9
-U8
+U16
OP_spare(o)
B::OP o
==== //depot/perl/op.c#989 (text) ====
Index: perl/op.c
--- perl/op.c#988~33309~ 2008-02-14 07:14:36.000000000 -0800
+++ perl/op.c 2008-02-15 01:19:49.000000000 -0800
@@ -548,7 +548,7 @@
switch (o->op_type) {
case OP_NULL: /* Was holding old type, if any. */
if (PL_madskills && o->op_targ != OP_NULL) {
- o->op_type = o->op_targ;
+ o->op_type = (optype)o->op_targ;
o->op_targ = 0;
goto retry;
}
@@ -5039,7 +5039,7 @@
PERL_ARGS_ASSERT_NEWGIVWHENOP;
NewOp(1101, enterop, 1, LOGOP);
- enterop->op_type = enter_opcode;
+ enterop->op_type = (optype)enter_opcode;
enterop->op_ppaddr = PL_ppaddr[enter_opcode];
enterop->op_flags = (U8) OPf_KIDS;
enterop->op_targ = ((entertarg == NOT_IN_PAD) ? 0 : entertarg);
==== //depot/perl/op.h#207 (text) ====
Index: perl/op.h
--- perl/op.h#206~33292~ 2008-02-12 06:58:50.000000000 -0800
+++ perl/op.h 2008-02-15 01:19:49.000000000 -0800
@@ -45,6 +45,8 @@
# define MADPROP_IN_BASEOP
#endif
+typedef PERL_BITFIELD16 optype;
+
#ifdef BASEOP_DEFINITION
#define BASEOP BASEOP_DEFINITION
#else
@@ -64,7 +66,10 @@
U8 op_private;
#endif
-/* If op_type:9 is changed to :10, also change PUSHEVAL in cop.h */
+/* If op_type:9 is changed to :10, also change PUSHEVAL in cop.h.
+ Also, if the type of op_type is ever changed (e.g. to PERL_BITFIELD32)
+ then all the other bit-fields before/after it should change their
+ types too to let VC pack them into the same 4 byte integer.*/
#define OP_GIMME(op,dfl) \
(((op)->op_flags & OPf_WANT) == OPf_WANT_VOID ? G_VOID : \
End of Patch.