From: Andy Lester Date: Mon, 13 Mar 2006 09:31:52 +0000 (-0600) Subject: looks_like_bool can be const X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef519e132d81262cbafdc318e417dce9db1d88a9;p=p5sagit%2Fp5-mst-13.2.git looks_like_bool can be const Message-ID: <20060313153152.GA13254@petdance.com> p4raw-id: //depot/perl@27492 --- diff --git a/embed.fnc b/embed.fnc index 4503983..719cf5c 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1147,7 +1147,7 @@ s |void |no_bareword_allowed|NN const OP *o sR |OP* |no_fh_allowed|NN OP *o sR |OP* |too_few_arguments|NN OP *o|NN const char* name sR |OP* |too_many_arguments|NN OP *o|NN const char* name -s |bool |looks_like_bool|NN OP* o +s |bool |looks_like_bool|NN const OP* o s |OP* |newGIVWHENOP |NULLOK OP* cond|NN OP *block \ |I32 enter_opcode|I32 leave_opcode \ |PADOFFSET entertarg diff --git a/op.c b/op.c index 9a5dfb1..71d0764 100644 --- a/op.c +++ b/op.c @@ -4607,7 +4607,7 @@ S_newGIVWHENOP(pTHX_ OP *cond, OP *block, */ STATIC bool -S_looks_like_bool(pTHX_ OP *o) +S_looks_like_bool(pTHX_ const OP *o) { dVAR; switch(o->op_type) { @@ -4678,7 +4678,7 @@ Perl_newGIVENOP(pTHX_ OP *cond, OP *block, PADOFFSET defsv_off) OP * Perl_newWHENOP(pTHX_ OP *cond, OP *block) { - bool cond_llb = (!cond || looks_like_bool(cond)); + const bool cond_llb = (!cond || looks_like_bool(cond)); OP *cond_op; if (cond_llb) diff --git a/proto.h b/proto.h index c6c0d2f..fd42b8c 100644 --- a/proto.h +++ b/proto.h @@ -3180,7 +3180,7 @@ STATIC OP* S_too_many_arguments(pTHX_ OP *o, const char* name) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC bool S_looks_like_bool(pTHX_ OP* o) +STATIC bool S_looks_like_bool(pTHX_ const OP* o) __attribute__nonnull__(pTHX_1); STATIC OP* S_newGIVWHENOP(pTHX_ OP* cond, OP *block, I32 enter_opcode, I32 leave_opcode, PADOFFSET entertarg)