summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-08-04 11:58:27 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-08-07 08:15:39 +0000
commit10edeb5d2457364a70a6848a864cfa6b89dfc882 (patch)
tree901034210efd6983fe16b782168144371eb95631 /utf8.c
parent435fbc73c32c7bd8a6a0cdb8a1ea0ca077918585 (diff)
downloadperl-10edeb5d2457364a70a6848a864cfa6b89dfc882.tar.gz
g++ large patch
Message-ID: <44D2E203.5050201@iki.fi> p4raw-id: //depot/perl@28662
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index 28ac605295..21be126342 100644
--- a/utf8.c
+++ b/utf8.c
@@ -524,7 +524,7 @@ malformed:
if (flags & UTF8_CHECK_ONLY) {
if (retlen)
- *retlen = -1;
+ *retlen = ((STRLEN) -1);
return 0;
}
@@ -653,6 +653,7 @@ Perl_utf8_length(pTHX_ const U8 *s, const U8 *e)
{
dVAR;
STRLEN len = 0;
+ U8 t = 0;
/* Note: cannot use UTF8_IS_...() too eagerly here since e.g.
* the bitops (especially ~) can create illegal UTF-8.
@@ -661,7 +662,7 @@ Perl_utf8_length(pTHX_ const U8 *s, const U8 *e)
if (e < s)
goto warn_and_return;
while (s < e) {
- const U8 t = UTF8SKIP(s);
+ t = UTF8SKIP(s);
if (e - s < t) {
warn_and_return:
if (ckWARN_d(WARN_UTF8)) {
@@ -760,7 +761,7 @@ Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *len)
if (!UTF8_IS_INVARIANT(c) &&
(!UTF8_IS_DOWNGRADEABLE_START(c) || (s >= send)
|| !(c = *s++) || !UTF8_IS_CONTINUATION(c))) {
- *len = -1;
+ *len = ((STRLEN) -1);
return 0;
}
}