Skip to content

Commit e5c1312

Browse files
committed
utf8.c: Silence C comparison of ints warnings
Fixes #23790
1 parent eaf4bbe commit e5c1312

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6179,7 +6179,7 @@ RTi |int |does_utf8_overflow \
61796179
|NN const U8 *e
61806180
RTi |int |isFF_overlong |NN const U8 * const s \
61816181
|const STRLEN len
6182-
RTi |int |is_utf8_overlong \
6182+
RTi |SSize_t|is_utf8_overlong \
61836183
|NN const U8 * const s \
61846184
|const STRLEN len
61856185
RS |HV * |new_msg_hv |NN const char * const message \

proto.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ The new names accurately describe the situation in all cases.
461461
=cut
462462
*/
463463

464-
PERL_STATIC_INLINE int
464+
PERL_STATIC_INLINE SSize_t
465465
S_is_utf8_overlong(const U8 * const s, const STRLEN len)
466466
{
467467
/* Returns an int indicating whether or not the UTF-8 sequence from 's' to
@@ -649,7 +649,7 @@ S_does_utf8_overflow(const U8 * const s, const U8 * e)
649649
overflows_if_not_overlong: ;
650650

651651
/* Here, the sequence overflows if not overlong. Check for that */
652-
int is_overlong = is_utf8_overlong(s, len);
652+
SSize_t is_overlong = is_utf8_overlong(s, len);
653653
if (LIKELY(is_overlong == 0)) {
654654
return OVERFLOWS;
655655
}
@@ -2319,8 +2319,8 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
23192319
malformed_text,
23202320
byte_dump_string_(s0, curlen, 0),
23212321
byte_dump_string_(s0,
2322-
MIN(avail_len,
2323-
overlong_detect_length),
2322+
MIN((SSize_t) avail_len,
2323+
overlong_detect_length),
23242324
0));
23252325
}
23262326
else {

0 commit comments

Comments
 (0)