diff options
author | Yves Orton <demerphq@gmail.com> | 2020-02-08 10:51:48 +0100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-03-12 22:34:26 -0600 |
commit | 6b32f57da89de094200b8259611c0f2c80aeeef2 (patch) | |
tree | 7a4fc78778f900e069279744b74f86cfce5332e0 /proto.h | |
parent | 4bd78a4962edb4f91c34534af5ee89fe47594c18 (diff) | |
download | perl-6b32f57da89de094200b8259611c0f2c80aeeef2.tar.gz |
op.c: change Optype to I32 for cmpchain functions
Optype appears to be almost completely unused, and on Win32 builds
we saw warnings from the cmpchain patches:
perly.y(1063) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1065) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1079) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1081) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
Reviewing the code I noticed that functions like Perl_newBINOP() have
an I32 type argument, and functions like OpTYPE_set() coerce such
arguments into type OPCODE:
#define OpTYPE_set(o,type) \
STMT_START { \
o->op_type = (OPCODE)type; \
o->op_ppaddr = PL_ppaddr[type]; \
} STMT_END
this patch changes the signature to the new cmpchain functions so that
they do they same, and change the type for storage for op_type values
to also use OPCODE like most of the other op.c code.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -656,7 +656,7 @@ PERL_CALLCONV void Perl_clear_defarray(pTHX_ AV* av, bool abandon); PERL_CALLCONV const COP* Perl_closest_cop(pTHX_ const COP *cop, const OP *o, const OP *curop, bool opnext); #define PERL_ARGS_ASSERT_CLOSEST_COP \ assert(cop) -PERL_CALLCONV OP* Perl_cmpchain_extend(pTHX_ Optype type, OP* ch, OP* right) +PERL_CALLCONV OP* Perl_cmpchain_extend(pTHX_ I32 type, OP* ch, OP* right) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_CMPCHAIN_EXTEND \ assert(ch) @@ -666,7 +666,7 @@ PERL_CALLCONV OP* Perl_cmpchain_finish(pTHX_ OP* ch) #define PERL_ARGS_ASSERT_CMPCHAIN_FINISH \ assert(ch) -PERL_CALLCONV OP* Perl_cmpchain_start(pTHX_ Optype type, OP* left, OP* right) +PERL_CALLCONV OP* Perl_cmpchain_start(pTHX_ I32 type, OP* left, OP* right) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_CMPCHAIN_START |