Fixes for casting problems detected on a SuSE 7.2 Itanium,
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 12 Dec 2001 14:33:30 +0000 (14:33 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 12 Dec 2001 14:33:30 +0000 (14:33 +0000)
mostly gcc -Wall complaining about the argument of %p not
being a void *.

p4raw-id: //depot/perl@13659

perlio.c
regcomp.c
taint.c
toke.c

index db21071..fa6639e 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -450,7 +450,7 @@ PerlIO_fdupopen(pTHX_ PerlIO *f, CLONE_PARAMS *param, int flags)
     if (f && *f) {
        PerlIO_funcs *tab = PerlIOBase(f)->tab;
        PerlIO *new;
-       PerlIO_debug("fdupopen f=%p param=%p\n",f,param);
+       PerlIO_debug("fdupopen f=%p param=%p\n",(void*)f,(void*)param);
         new = (*tab->Dup)(aTHX_ PerlIO_allocate(aTHX),f,param, flags);
        return new;
     }
@@ -603,7 +603,7 @@ PerlIO_pop(pTHX_ PerlIO *f)
 {
     PerlIOl *l = *f;
     if (l) {
-       PerlIO_debug("PerlIO_pop f=%p %s\n", f, l->tab->name);
+       PerlIO_debug("PerlIO_pop f=%p %s\n", (void*)f, l->tab->name);
        if (l->tab->Popped) {
            /*
             * If popped returns non-zero do not free its layer structure
@@ -632,7 +632,7 @@ PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load)
     for (i = 0; i < PL_known_layers->cur; i++) {
        PerlIO_funcs *f = PL_known_layers->array[i].funcs;
        if (memEQ(f->name, name, len)) {
-           PerlIO_debug("%.*s => %p\n", (int) len, name, f);
+           PerlIO_debug("%.*s => %p\n", (int) len, name, (void*)f);
            return f;
        }
     }
@@ -763,7 +763,7 @@ PerlIO_define_layer(pTHX_ PerlIO_funcs *tab)
     if (!PL_known_layers)
        PL_known_layers = PerlIO_list_alloc(aTHX);
     PerlIO_list_push(aTHX_ PL_known_layers, tab, Nullsv);
-    PerlIO_debug("define %s %p\n", tab->name, tab);
+    PerlIO_debug("define %s %p\n", tab->name, (void*)tab);
 }
 
 int
@@ -971,8 +971,8 @@ PerlIO_push(pTHX_ PerlIO *f, PerlIO_funcs *tab, const char *mode, SV *arg)
        l->next = *f;
        l->tab = tab;
        *f = l;
-       PerlIO_debug("PerlIO_push f=%p %s %s %p\n", f, tab->name,
-                    (mode) ? mode : "(Null)", arg);
+       PerlIO_debug("PerlIO_push f=%p %s %s %p\n", (void*)f, tab->name,
+                    (mode) ? mode : "(Null)", (void*)arg);
        if ((*l->tab->Pushed) (f, mode, arg) != 0) {
            PerlIO_pop(aTHX_ f);
            return NULL;
@@ -1021,7 +1021,7 @@ PerlIORaw_pushed(PerlIO *f, const char *mode, SV *arg)
                break;
            }
        }
-       PerlIO_debug(":raw f=%p :%s\n", f, PerlIOBase(f)->tab->name);
+       PerlIO_debug(":raw f=%p :%s\n", (void*)f, PerlIOBase(f)->tab->name);
        return 0;
     }
     return -1;
@@ -1071,7 +1071,7 @@ int
 PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int mode, const char *names)
 {
     PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n",
-                f, PerlIOBase(f)->tab->name, iotype, mode,
+                (void*)f, PerlIOBase(f)->tab->name, iotype, mode,
                 (names) ? names : "(Null)");
     /* Can't flush if switching encodings. */
     if (!(names && memEQ(names, ":encoding(", 10))) {
@@ -1290,8 +1290,8 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
                Perl_croak(aTHX_ "More than one argument to open(,':%s')",tab->name);
            }
            PerlIO_debug("openn(%s,'%s','%s',%d,%x,%o,%p,%d,%p)\n",
-                        tab->name, layers, mode, fd, imode, perm, f, narg,
-                        args);
+                        tab->name, layers, mode, fd, imode, perm,
+                        (void*)f, narg, (void*)args);
            f = (*tab->Open) (aTHX_ tab, layera, n, mode, fd, imode, perm,
                              f, narg, args);
            if (f) {
@@ -1410,13 +1410,13 @@ PerlIO_flush(PerlIO *f)
                return (*tab->Flush) (f);
            }
            else {
-               PerlIO_debug("Cannot flush f=%p :%s\n", f, tab->name);
+               PerlIO_debug("Cannot flush f=%p :%s\n", (void*)f, tab->name);
                SETERRNO(EBADF, SS$_IVCHAN);
                return -1;
            }
        }
        else {
-           PerlIO_debug("Cannot flush f=%p\n", f);
+           PerlIO_debug("Cannot flush f=%p\n", (void*)f);
            SETERRNO(EBADF, SS$_IVCHAN);
            return -1;
        }
@@ -1993,7 +1993,8 @@ PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
        PerlIO_funcs *self = PerlIOBase(o)->tab;
        SV *arg = Nullsv;
        char buf[8];
-       PerlIO_debug("PerlIOBase_dup %s f=%p o=%p param=%p\n",self->name,f,o,param);
+       PerlIO_debug("PerlIOBase_dup %s f=%p o=%p param=%p\n",
+                    self->name, (void*)f, (void*)o, (void*)param);
        if (self->Getarg) {
            arg = (*self->Getarg)(aTHX_ o,param,flags);
        }
index 40e7916..a0f32f8 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -3187,7 +3187,7 @@ tryagain:
         STRLEN newlen = SvCUR(sv);
         if (!SIZE_ONLY) {
              DEBUG_r(PerlIO_printf(Perl_debug_log, "recode %*s to %*s\n",
-                                   oldlen, STRING(ret), newlen, s));
+                                   (int)oldlen, STRING(ret), (int)newlen, s));
              Copy(s, STRING(ret), newlen, char);
              STR_LEN(ret) += newlen - oldlen;
              RExC_emit += STR_SZ(newlen) - STR_SZ(oldlen);
diff --git a/taint.c b/taint.c
index e5f6f8a..1ce27e3 100644 (file)
--- a/taint.c
+++ b/taint.c
@@ -15,7 +15,7 @@ Perl_taint_proper(pTHX_ const char *f, const char *s)
 
 #ifdef HAS_SETEUID
     DEBUG_u(PerlIO_printf(Perl_debug_log,
-            "%s %d %"Uid_t_f" %"Uid_t_f"\n", s, PL_tainted, (long unsigned int)PL_uid, (long unsigned int)PL_euid));
+            "%s %d %"Uid_t_f" %"Uid_t_f"\n", s, PL_tainted, (Uid_t)PL_uid, (Uid_t)PL_euid));
 #endif
 
     if (PL_tainted) {
diff --git a/toke.c b/toke.c
index 764e305..314753f 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1980,7 +1980,7 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)
     IoANY(datasv) = (void *)funcp; /* stash funcp into spare field */
     IoFLAGS(datasv) |= IOf_FAKE_DIRP;
     DEBUG_P(PerlIO_printf(Perl_debug_log, "filter_add func %p (%s)\n",
-                         funcp, SvPV_nolen(datasv)));
+                         (void*)funcp, SvPV_nolen(datasv)));
     av_unshift(PL_rsfp_filters, 1);
     av_store(PL_rsfp_filters, 0, datasv) ;
     return(datasv);
@@ -1992,7 +1992,7 @@ void
 Perl_filter_del(pTHX_ filter_t funcp)
 {
     SV *datasv;
-    DEBUG_P(PerlIO_printf(Perl_debug_log, "filter_del func %p", funcp));
+    DEBUG_P(PerlIO_printf(Perl_debug_log, "filter_del func %p", (void*)funcp));
     if (!PL_rsfp_filters || AvFILLp(PL_rsfp_filters)<0)
        return;
     /* if filter is on top of stack (usual case) just pop it off */
@@ -2062,7 +2062,7 @@ Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen)
     funcp = (filter_t)IoANY(datasv);
     DEBUG_P(PerlIO_printf(Perl_debug_log,
                          "filter_read %d: via function %p (%s)\n",
-                         idx, funcp, SvPV_nolen(datasv)));
+                         idx, (void*)funcp, SvPV_nolen(datasv)));
     /* Call function. The function is expected to      */
     /* call "FILTER_READ(idx+1, buf_sv)" first.                */
     /* Return: <0:error, =0:eof, >0:not eof            */