Skip to content

Commit

Permalink
utf8_to_uv_msgs: Silence some compiler warnings
Browse files Browse the repository at this point in the history
These showed up running gcc on a 32-bit build
  • Loading branch information
khwilliamson committed Dec 4, 2024
1 parent 22e39ba commit 23ee4f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
* there are other malformations, we may be still be able to tell if this
* is an overlong by looking at the UTF-8 byte sequence itself */
if ( ( LIKELY(! possible_problems)
&& UNLIKELY(expectlen > OFFUNISKIP(uv)))
&& UNLIKELY(expectlen > (SSize_t) OFFUNISKIP(uv)))
|| ( UNLIKELY(possible_problems)
&& UTF8_IS_SYNTACTIC_START_BYTE(s0)
&& UNLIKELY(0 < is_utf8_overlong(s0, s - s0))))
Expand Down Expand Up @@ -1841,7 +1841,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
* full length with occurrences of the smallest continuation
* byte. For surrogates we could just look at the bytes, but
* this single algorithm works for both those and supers. */
for (unsigned i = curlen; i < expectlen; i++) {
for (int i = curlen; i < expectlen; i++) {
uv = UTF8_ACCUMULATE(uv, UTF8_MIN_CONTINUATION_BYTE);
}
}
Expand Down Expand Up @@ -2073,7 +2073,8 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
switch (this_problem) {
default:
Perl_croak(aTHX_ "panic: Unexpected case value in "
" utf8n_to_uvchr_msgs() %d", this_problem);
" utf8n_to_uvchr_msgs() %ld",
(long) this_problem);
/* NOTREACHED */
break;

Expand Down

0 comments on commit 23ee4f2

Please sign in to comment.