diff options
author | Karl Williamson <khw@cpan.org> | 2016-11-25 08:35:30 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-12-11 14:33:47 -0700 |
commit | c551bb019448883c2c8b94191e223158c6d40b29 (patch) | |
tree | 207a887ad914a2c1cf67e4ccbe9f0ec6e7d975c6 /utf8.c | |
parent | 680b55f7dc3b143fa8c4cc5bbd905f9242504f3b (diff) | |
download | perl-c551bb019448883c2c8b94191e223158c6d40b29.tar.gz |
utf8.c: Silence compiler warning
This was generating a "comparison between signed and unsigned integer
expression" warning
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -430,6 +430,12 @@ S_does_utf8_overflow(const U8 * const s, const U8 * e) const U8 *x; const U8 * y = (const U8 *) HIGHEST_REPRESENTABLE_UTF8; +#if ! defined(UV_IS_QUAD) && ! defined(EBCDIC) + + const STRLEN len = e - s; + +#endif + /* Returns a boolean as to if this UTF-8 string would overflow a UV on this * platform, that is if it represents a code point larger than the highest * representable code point. (For ASCII platforms, we could use memcmp() @@ -449,10 +455,10 @@ S_does_utf8_overflow(const U8 * const s, const U8 * e) /* On 32 bit ASCII machines, many overlongs that start with FF don't * overflow */ - if (isFF_OVERLONG(s, e - s)) { + if (isFF_OVERLONG(s, len)) { const U8 max_32_bit_overlong[] = "\xFF\x80\x80\x80\x80\x80\x80\x84"; return memGE(s, max_32_bit_overlong, - MIN(e - s, sizeof(max_32_bit_overlong) - 1)); + MIN(len, sizeof(max_32_bit_overlong) - 1)); } #endif |