Skip to content

Commit d295717

Browse files
committed
op.c: Silence compiler warning
This fixes GH #22614 Not all compilers warned on this. Make both operands unsigned. The one that had been declared signed is always non-negative anyway. In this case, the multiple evaluations MAX gives is ok.
1 parent e2de21d commit d295717

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

op.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6058,13 +6058,13 @@ Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
60586058

60596059
/* Total number of bytes a given code point would occupy in the output */
60606060
#define TOTAL_LEN(num) \
6061-
((int) ((num == 0) \
6062-
? 1 /* Plain 0 has no ornamentation */ \
6063-
: ((num >= IV_MAX) \
6064-
? STRLENs(INFTY) \
6065-
: ((STRLENs("0x") + ((NUM_HEX_CHARS(num) <= 2) \
6066-
? 2 /* Otherwise, minimum of 2 hex digits */ \
6067-
: NUM_HEX_CHARS(num)))))))
6061+
((unsigned) ((num == 0) \
6062+
? 1 /* Plain 0 has no ornamentation */ \
6063+
: ((num >= IV_MAX) \
6064+
? STRLENs(INFTY) \
6065+
: ((STRLENs("0x") + ((NUM_HEX_CHARS(num) <= 2) \
6066+
? 2 /* Otherwise, minimum of 2 hex digits */\
6067+
: NUM_HEX_CHARS(num)))))))
60686068

60696069
/* To make evident, Configure with `-DDEBUGGING`, build, run
60706070
* `./perl -Ilib -Dy t/op/tr.t`

0 commit comments

Comments
 (0)