Change 13691 by jhi@alpha on 2001/12/14 21:26:08

        Silence compiler worries found by Schwern/Digital cc.

Affected files ...

.... //depot/perl/perlio.c#152 edit
.... //depot/perl/sv.c#497 edit
.... //depot/perl/x2p/str.c#12 edit

Differences ...

==== //depot/perl/perlio.c#152 (text) ====
Index: perl/perlio.c
--- perl/perlio.c.~1~   Fri Dec 14 14:30:05 2001
+++ perl/perlio.c       Fri Dec 14 14:30:05 2001
@@ -2694,7 +2694,7 @@
 {
     dSYS;
     FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
-    return PerlSIO_get_base(stdio);
+    return (STDCHAR*)PerlSIO_get_base(stdio);
 }
 
 Size_t
@@ -2712,7 +2712,7 @@
 {
     dSYS;
     FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
-    return PerlSIO_get_ptr(stdio);
+    return (STDCHAR*)PerlSIO_get_ptr(stdio);
 }
 
 SSize_t
@@ -2730,7 +2730,7 @@
     dSYS;
     if (ptr != NULL) {
 #ifdef STDIO_PTR_LVALUE
-       PerlSIO_set_ptr(stdio, ptr);
+        PerlSIO_set_ptr(stdio, (void*)ptr); /* LHS STDCHAR* cast non-portable */ 
 #ifdef STDIO_PTR_LVAL_SETS_CNT
        if (PerlSIO_get_cnt(stdio) != (cnt)) {
            dTHX;

==== //depot/perl/sv.c#497 (text) ====
Index: perl/sv.c
--- perl/sv.c.~1~       Fri Dec 14 14:30:05 2001
+++ perl/sv.c   Fri Dec 14 14:30:05 2001
@@ -5700,7 +5700,7 @@
        DEBUG_P(PerlIO_printf(Perl_debug_log,
                              "Screamer: going to getc, ptr=%"UVuf", cnt=%ld\n",
                              PTR2UV(ptr),(long)cnt));
-       PerlIO_set_ptrcnt(fp, ptr, cnt); /* deregisterize cnt and ptr */
+       PerlIO_set_ptrcnt(fp, (STDCHAR*)ptr, cnt); /* deregisterize cnt and ptr */
        DEBUG_P(PerlIO_printf(Perl_debug_log,
            "Screamer: pre: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
            PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),
@@ -5741,7 +5741,7 @@
        cnt += shortbuffered;
        DEBUG_P(PerlIO_printf(Perl_debug_log,
            "Screamer: quitting, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
-    PerlIO_set_ptrcnt(fp, ptr, cnt);   /* put these back or we're in trouble */
+    PerlIO_set_ptrcnt(fp, (STDCHAR*)ptr, cnt); /* put these back or we're in trouble 
+*/
     DEBUG_P(PerlIO_printf(Perl_debug_log,
        "Screamer: end: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
        PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),

==== //depot/perl/x2p/str.c#12 (text) ====
Index: perl/x2p/str.c
--- perl/x2p/str.c.~1~  Fri Dec 14 14:30:05 2001
+++ perl/x2p/str.c      Fri Dec 14 14:30:05 2001
@@ -282,7 +282,7 @@
     if (str->str_len <= cnt)           /* make sure we have the room */
        GROWSTR(&(str->str_ptr), &(str->str_len), cnt+1);
     bp = str->str_ptr;                 /* move these two too to registers */
-    ptr = FILE_ptr(fp);
+    ptr = (STDCHAR*)FILE_ptr(fp);
     for (;;) {
        while (--cnt >= 0) {
            if ((*bp++ = *ptr++) == newline) {
@@ -296,7 +296,7 @@
        }
        
        FILE_cnt(fp) = cnt;             /* deregisterize cnt and ptr */
-       FILE_ptr(fp) = ptr;
+       FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
        i = getc(fp);           /* get more characters */
        cnt = FILE_cnt(fp);
        ptr = FILE_ptr(fp);             /* reregisterize cnt and ptr */
@@ -316,7 +316,7 @@
 
 thats_all_folks:
     FILE_cnt(fp) = cnt;                        /* put these back or we're in trouble 
*/
-    FILE_ptr(fp) = ptr;
+    FILE_ptr(fp) = (STDCHAR*)ptr;
     *bp = '\0';
     str->str_cur = bp - str->str_ptr;  /* set length */
 
End of Patch.

Reply via email to