From: Jarkko Hietaniemi Date: Sun, 26 Jan 2003 21:54:36 +0000 (+0000) Subject: Missing (STRLEN)casts. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=667208dd2ec490b5ca4e1ceb577d012f9d91a397;p=p5sagit%2Fp5-mst-13.2.git Missing (STRLEN)casts. p4raw-id: //depot/perl@18592 --- diff --git a/sv.c b/sv.c index a0d218b..c7c83a9 100644 --- a/sv.c +++ b/sv.c @@ -5568,7 +5568,7 @@ S_utf8_mg_pos(pTHX_ SV *sv, MAGIC **mgp, STRLEN **cachep, I32 i, I32 *offsetp, I *mgp = mg_find(sv, PERL_MAGIC_utf8); if (*mgp && (*mgp)->mg_ptr) { *cachep = (STRLEN *) (*mgp)->mg_ptr; - if ((*cachep)[i] == uoff) /* An exact match. */ + if ((*cachep)[i] == (STRLEN)uoff) /* An exact match. */ found = TRUE; else { /* We will skip to the right spot. */ STRLEN forw = 0; @@ -5580,9 +5580,9 @@ S_utf8_mg_pos(pTHX_ SV *sv, MAGIC **mgp, STRLEN **cachep, I32 i, I32 *offsetp, I * 2 * backw in the below comes from). (The real * figure of course depends on the UTF-8 data.) */ - if ((*cachep)[i] > uoff) { + if ((*cachep)[i] > (STRLEN)uoff) { forw = uoff; - backw = (*cachep)[i] - uoff; + backw = (*cachep)[i] - (STRLEN)uoff; if (forw < 2 * backw) p = start; @@ -5594,9 +5594,9 @@ S_utf8_mg_pos(pTHX_ SV *sv, MAGIC **mgp, STRLEN **cachep, I32 i, I32 *offsetp, I else if (i == 0) { /* (*cachep)[i] < uoff */ STRLEN ulen = sv_len_utf8(sv); - if (uoff < ulen) { - forw = uoff - (*cachep)[i]; - backw = ulen - uoff; + if ((STRLEN)uoff < ulen) { + forw = (STRLEN)uoff - (*cachep)[i]; + backw = ulen - (STRLEN)uoff; if (forw < 2 * backw) p = start + (*cachep)[i+1]; @@ -5622,7 +5622,7 @@ S_utf8_mg_pos(pTHX_ SV *sv, MAGIC **mgp, STRLEN **cachep, I32 i, I32 *offsetp, I } /* Update the cache. */ - (*cachep)[i] = uoff; + (*cachep)[i] = (STRLEN)uoff; (*cachep)[i+1] = p - start; found = TRUE;