develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH perl@8585] bytes_from_utf8() signedness nit

Craig A. Berry
January 29, 2001 20:10
[PATCH perl@8585] bytes_from_utf8() signedness nit
Message ID:
Before the casting in this patch, Compaq C V6.2-007 on OpenVMS Alpha
V7.2-1 complains that pointer to char and pointer to unsigned char
aren't the same thing.  If it's supposed to return bytes, I'm not
sure why the return value of the function is of type U8*, but there's
a lot I'm not sure about this deep in the core.  Better solutions
encouraged, but this gets a clean build and all utf8 tests passing.

--- sv.c;-0     Sun Jan 28 12:40:21 2001
+++ sv.c        Mon Jan 29 20:57:19 2001
@@ -4696,14 +4696,14 @@
             return FALSE;

         if (SvUTF8(sv1)) {
-           char *pv = bytes_from_utf8((U8*)pv1, &cur1, &is_utf8);
+           char *pv = (char *) bytes_from_utf8((U8*)pv1, &cur1, &is_utf8);
             if (is_utf8)
                 return 0;
             pv1tmp = (pv != pv1);
             pv1 = pv;
         else {
-           char *pv = bytes_from_utf8((U8*)pv2, &cur2, &is_utf8);
+           char *pv = (char *) bytes_from_utf8((U8*)pv2, &cur2, &is_utf8);
             if (is_utf8)
                 return 0;
             pv2tmp = (pv != pv2);
[end of patch]
Craig A. Berry Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About