Fix numerous compiler warnings and format conversion specifiers.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 20 Aug 2009 17:24:58 +0000 (10:24 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 20 Aug 2009 18:03:04 +0000 (11:03 -0700)
45 files changed:
include/strings.h
sys/bus/cam/cam.c
sys/bus/cam/scsi/scsi_all.c
sys/bus/cam/scsi/scsi_target.c
sys/bus/usb/usb.c
sys/contrib/dev/acpica-unix/executer/exdump.c
sys/contrib/dev/acpica-unix/namespace/nsutils.c
sys/contrib/ipfilter/netinet/ip_state.c
sys/ddb/db_command.c
sys/dev/disk/nata/ata-all.c
sys/dev/misc/lpt/lpt.c
sys/dev/misc/psm/psm.c
sys/dev/netif/de/if_de.c
sys/dev/raid/ciss/ciss.c
sys/dev/raid/vinum/vinumrequest.c
sys/dev/serial/dgb/dgm.c
sys/dev/sound/usb/uaudio.c
sys/dev/video/fb/vga.c
sys/dev/video/i386/vesa/vesa.c
sys/emulation/linux/i386/linux_ptrace.c
sys/emulation/ndis/subr_ntoskrnl.c
sys/kern/kern_descrip.c
sys/kern/tty.c
sys/kern/uipc_syscalls.c
sys/kern/vfs_bio.c
sys/libkern/bsearch.c
sys/net/pf/pf.c
sys/net/tap/if_tap.c
sys/netinet6/ah_output.c
sys/netinet6/ip6_input.c
sys/netproto/ipx/ipx_pcb.h
sys/netproto/ipx/ipx_var.h
sys/opencrypto/cast.c
sys/platform/pc32/apic/mpapic.c
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/i386/trap.c
sys/platform/vkernel/i386/trap.c
sys/platform/vkernel/platform/pmap.c
sys/sys/libkern.h
sys/vfs/nfs/nfs_serv.c
sys/vfs/nfs/nfs_socket.c
sys/vfs/nfs/nfs_syscalls.c
sys/vfs/udf/udf_vnops.c

index cf39da7..7c90b89 100644 (file)
@@ -47,8 +47,10 @@ int   ffs(int) __pure2;
 #ifdef __BSD_VISIBLE
 int     ffsl(long) __pure2;
 int     ffsll(long long) __pure2;
+#if !defined(_KERNEL_VIRTUAL)
 int     fls(int) __pure2;
 int     flsl(long) __pure2;
+#endif
 int     flsll(long long) __pure2;
 #endif
 #if !defined(_KERNEL_VIRTUAL)
index 920070c..43c9228 100644 (file)
@@ -182,7 +182,7 @@ const struct cam_status_entry*
 cam_fetch_status_entry(cam_status status)
 {
        status &= CAM_STATUS_MASK;
-       return (bsearch(&status, &cam_status_table,
+       return (kbsearch(&status, &cam_status_table,
                        num_cam_status_entries,
                        sizeof(*cam_status_table),
                        camstatusentrycomp));
index 431976f..0a6075d 100644 (file)
@@ -2754,7 +2754,7 @@ fetchtableentries(int sense_key, int asc, int ascq,
        for (i = 0; i < num_asc_tables; i++) {
                void *found_entry;
 
-               found_entry = bsearch(&asc_ascq, asc_tables[i],
+               found_entry = kbsearch(&asc_ascq, asc_tables[i],
                                      asc_tables_size[i],
                                      sizeof(**asc_tables),
                                      ascentrycomp);
@@ -2768,7 +2768,7 @@ fetchtableentries(int sense_key, int asc, int ascq,
        for (i = 0; i < num_sense_tables; i++) {
                void *found_entry;
 
-               found_entry = bsearch(&sense_key, sense_tables[i],
+               found_entry = kbsearch(&sense_key, sense_tables[i],
                                      sense_tables_size[i],
                                      sizeof(**sense_tables),
                                      senseentrycomp);
index 8494369..afdc596 100644 (file)
@@ -565,7 +565,7 @@ targwrite(struct dev_write_args *ap)
        softc = (struct targ_softc *)ap->a_head.a_dev->si_drv1;
        write_len = error = 0;
        CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
-                 ("write - uio_resid %ld\n", uio->uio_resid));
+                 ("write - uio_resid %zu\n", uio->uio_resid));
        while (uio->uio_resid >= sizeof(user_ccb) && error == 0) {
                union ccb *ccb;
 
index 3194b03..0a3414f 100644 (file)
@@ -623,7 +623,7 @@ usbioctl(struct dev_ioctl_args *ap)
                usbd_status err;
                int error = 0;
 
-               DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%ld\n", addr, len));
+               DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%zu\n", addr, len));
                if (len > 32768)
                        return (EINVAL);
                if (addr < 0 || addr >= USB_MAX_DEVICES ||
index d7745e7..5078f25 100644 (file)
@@ -424,6 +424,7 @@ AcpiExDumpObject (
     UINT8                   *Target;
     char                    *Name;
     UINT8                   Count;
+    const char             *str;
 
 
     if (!Info)
@@ -506,8 +507,8 @@ AcpiExDumpObject (
 
         case ACPI_EXD_REFERENCE:
 
-            AcpiExOutString ("Class Name",
-                (char *) AcpiUtGetReferenceName (ObjDesc));
+           str = AcpiUtGetReferenceName (ObjDesc);
+            AcpiExOutString ("Class Name", __DECONST(char *, str));
             AcpiExDumpReferenceObj (ObjDesc);
             break;
 
index 1752af3..4bfb7c3 100644 (file)
@@ -1048,7 +1048,7 @@ AcpiNsGetNode (
     char                    *InternalPath;
 
 
-    ACPI_FUNCTION_TRACE_PTR (NsGetNode, Pathname);
+    ACPI_FUNCTION_TRACE_PTR (NsGetNode, __DECONST(char *, Pathname));
 
 
     if (!Pathname)
index 288f9cf..a643567 100644 (file)
@@ -1147,10 +1147,8 @@ tcphdr_t *tcp;
        return 1;
 }
 
-static int fr_matchicmpqueryreply(v, is, icmp, rev)
-int v;
-ipstate_t *is;
-icmphdr_t *icmp;
+static int
+fr_matchicmpqueryreply(int v, ipstate_t *is, icmphdr_t *icmp, int rev)
 {
        if (v == 4) {
                /*
index becb3b2..fba9ec3 100644 (file)
@@ -228,6 +228,7 @@ db_command(struct command **last_cmdp, struct command *cmd_table,
        boolean_t       have_addr = FALSE;
        int             result;
 
+       cmd = NULL;
        t = db_read_token();
        if (t == tEOL) {
            /* empty line repeats last command, at 'next' */
index 9675c63..8c7d3fb 100644 (file)
@@ -61,7 +61,9 @@ static struct dev_ops ata_ops = {
 };
 
 /* prototypes */
+#if 0
 static void ata_boot_attach(void);
+#endif
 static device_t ata_add_child(device_t, struct ata_device *, int);
 static int ata_getparam(struct ata_device *, int);
 static void bswap(int8_t *, int);
@@ -531,6 +533,8 @@ ata_device_ioctl(device_t dev, u_long cmd, caddr_t data)
     }
 }
 
+#if 0
+
 static void
 ata_boot_attach(void)
 {
@@ -549,6 +553,8 @@ ata_boot_attach(void)
     rel_mplock();
 }
 
+#endif
+
 
 /*
  * misc support functions
index 23ff75f..7bc72dc 100644 (file)
@@ -703,7 +703,7 @@ lptread(struct dev_read_args *ap)
        while (uio->uio_resid) {
                error = ppb_1284_read(ppbus, PPB_NIBBLE, sc->sc_statbuf,
                                      (int)szmin(BUFSTATSIZE, uio->uio_resid),
-                                     len);
+                                     &len);
                if (error)
                        goto error;
 
index 8cf834a..30c4405 100644 (file)
@@ -1655,6 +1655,8 @@ psmioctl(struct dev_ioctl_args *ap)
     int command_byte;
     int error = 0;
 
+    mode.resolution = -1;
+
     /* Perform IOCTL command */
 
     switch (ap->a_cmd) {
index fb48d3a..420dcb6 100644 (file)
@@ -3309,11 +3309,13 @@ tulip_tx_intr(tulip_softc_t *sc)
     /*
      * If nothing left to transmit, disable the timer.
      * Else if progress, reset the timer back to 2 ticks.
+     *
+     * XXX 2 bit field, TXTIMER is 4?
      */
     if (ri->ri_free == ri->ri_max || (sc->tulip_flags & TULIP_TXPROBE_ACTIVE))
        sc->tulip_txtimer = 0;
     else if (xmits > 0)
-       sc->tulip_txtimer = TULIP_TXTIMER;
+       sc->tulip_txtimer = (TULIP_TXTIMER & 3);
     sc->tulip_if.if_opackets += xmits;
     return descs;
 }
@@ -3609,10 +3611,12 @@ tulip_txput(tulip_softc_t *sc, struct mbuf *m)
 
     /*
      * switch back to the single queueing ifstart.
+     *
+     * XXX 2 bit field, TXTIMER is 4?
      */
     sc->tulip_flags &= ~TULIP_WANTTXSTART;
     if (sc->tulip_txtimer == 0)
-       sc->tulip_txtimer = TULIP_TXTIMER;
+       sc->tulip_txtimer = TULIP_TXTIMER & 3;
 
     /*
      * If we want a txstart, there must be not enough space in the
index e42b0fe..eb1a226 100644 (file)
@@ -3761,6 +3761,7 @@ ciss_print_adapter(struct ciss_softc *sc)
        ciss_print_request(sc->ciss_request + i);
 }
 
+#if 0
 /* DDB hook */
 static void
 ciss_print0(void)
@@ -3776,6 +3777,8 @@ ciss_print0(void)
 }
 #endif
 
+#endif
+
 /************************************************************************
  * Return a name for a logical drive status value.
  */
index 5235e95..a9b7f58 100644 (file)
@@ -637,10 +637,11 @@ bre(struct request *rq,
                            (uintmax_t)sd->sectors,
                            (uintmax_t)bp->b_bio1.bio_offset);
                        log(LOG_DEBUG,
-                           "vinum: stripebase %x, stripeoffset %x, blockoffset %x\n",
-                           stripebase,
-                           stripeoffset,
-                           blockoffset);
+                           "vinum: stripebase 0x%llx, stripeoffset 0x%llx, "
+                           "blockoffset 0x%llx\n",
+                           (long long)stripebase,
+                           (long long)stripeoffset,
+                           (long long)blockoffset);
                    }
 #endif
                }
index 7386832..c6455a0 100644 (file)
@@ -914,7 +914,7 @@ dgmdetach(device_t dev)
        FREE(sc->ttys, M_TTYS);
 
        if (sc->vmem) {
-               pmap_unmapdev(sc->vmem, sc->msize);
+               pmap_unmapdev((vm_offset_t)sc->vmem, sc->msize);
                sc->vmem = NULL;
        }
 
index 191ca5e..af486a0 100644 (file)
@@ -1636,6 +1636,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp,
        ai.edesc1 = epdesc1;
        ai.asf1desc = asf1d;
        ai.sc_busy = 0;
+       ai.ifaceh = NULL;
        uaudio_add_alt(sc, &ai);
 #ifdef USB_DEBUG
        if (ai.attributes & UA_SED_FREQ_CONTROL)
index 57f82b9..376ab42 100644 (file)
@@ -1904,8 +1904,8 @@ vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
        return -1;
 
 #if VGA_DEBUG > 0
-    kprintf("vga_mmap_buf(): window:0x%x, offset:0x%x\n", 
-          adp->va_info.vi_window, offset);
+    kprintf("vga_mmap_buf(): window:0x%x, offset:%p\n",
+          adp->va_info.vi_window, (void *)offset);
 #endif
 
     /* XXX: is this correct? */
index d1b178d..e383273 100644 (file)
@@ -787,13 +787,13 @@ static vm_offset_t
 vesa_map_buffer(u_int paddr, size_t size)
 {
        vm_offset_t vaddr;
-       u_int off;
+       size_t off;
 
        off = paddr - trunc_page(paddr);
        vaddr = (vm_offset_t)pmap_mapdev(paddr - off, size + off);
 #if VESA_DEBUG > 1
-       kprintf("vesa_map_buffer: paddr:0x%x vaddr:0x%x size:0x%x off:0x%x\n",
-              paddr, vaddr, size, off);
+       kprintf("vesa_map_buffer: paddr:0x%x vaddr:%p size:%zu off:%zu\n",
+              paddr, (void *)vaddr, size, off);
 #endif
        return (vaddr + off);
 }
@@ -802,7 +802,8 @@ static void
 vesa_unmap_buffer(vm_offset_t vaddr, size_t size)
 {
 #if VESA_DEBUG > 1
-       kprintf("vesa_unmap_buffer: vaddr:0x%x size:0x%x\n", vaddr, size);
+       kprintf("vesa_unmap_buffer: vaddr:%p size:%zu\n",
+               (void *)vaddr, size);
 #endif
        pmap_unmapdev(vaddr, size);
 }
@@ -1298,8 +1299,8 @@ static int
 vesa_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
 {
 #if VESA_DEBUG > 0
-       kprintf("vesa_mmap(): window:0x%x, buffer:0x%x, offset:0x%x\n", 
-              adp->va_info.vi_window, adp->va_info.vi_buffer, offset);
+       kprintf("vesa_mmap(): window:0x%x, buffer:0x%x, offset:0x%lx\n",
+              adp->va_info.vi_window, adp->va_info.vi_buffer, (long )offset);
 #endif
 
        if ((adp == vesa_adp) && (adp->va_info.vi_flags & V_INFO_LINEAR)) {
index b6c3cc0..9ae3b07 100644 (file)
@@ -310,7 +310,8 @@ sys_linux_ptrace(struct linux_ptrace_args *uap)
                                    &uap->sysmsg_iresult);
                if (error == 0) {
                        map_regs_to_linux(&u.bsd_reg, &r.reg);
-                       error = copyout(&r.reg, uap->data, sizeof(r.reg));
+                       error = copyout(&r.reg, (void *)uap->data,
+                                       sizeof(r.reg));
                }
                break;
        case PTRACE_SETREGS:
index 750c614..707bcec 100644 (file)
@@ -540,6 +540,9 @@ ntoskrnl_waitforobjs(uint32_t cnt, nt_dispatch_header *obj[],
        else
                w = wb_array;
 
+       tv.tv_sec = 0;          /* fix compiler warning */
+       tv.tv_usec = 0;         /* fix compiler warning */
+
        /* First pass: see if we can satisfy any waits immediately. */
 
        for (i = 0; i < cnt; i++) {
@@ -580,16 +583,16 @@ ntoskrnl_waitforobjs(uint32_t cnt, nt_dispatch_header *obj[],
                wcnt++;
        }
 
-       if (duetime != NULL) {
+       if (duetime) {
                if (*duetime < 0) {
-                       tv.tv_sec = - (*duetime) / 10000000;
-                       tv.tv_usec = (- (*duetime) / 10) -
-                           (tv.tv_sec * 1000000);
+                       tv.tv_sec = -*duetime / 10000000;
+                       tv.tv_usec = (-*duetime / 10) - (tv.tv_sec * 1000000);
                } else {
                        ntoskrnl_time(&curtime);
-                       if (*duetime < curtime)
-                               tv.tv_sec = tv.tv_usec = 0;
-                       else {
+                       if (*duetime < curtime) {
+                               tv.tv_sec = 0;
+                               tv.tv_usec = 0;
+                       } else {
                                tv.tv_sec = ((*duetime) - curtime) / 10000000;
                                tv.tv_usec = ((*duetime) - curtime) / 10 -
                                    (tv.tv_sec * 1000000);
@@ -601,9 +604,12 @@ ntoskrnl_waitforobjs(uint32_t cnt, nt_dispatch_header *obj[],
                nanotime(&t1);
                lwkt_reltoken(&tokref);
 
-               ticks = 1 + tv.tv_sec * hz + tv.tv_usec * hz / 1000000;
-
-               error = ndis_thsuspend(td, duetime == NULL ? 0 : ticks);
+               if (duetime) {
+                       ticks = 1 + tv.tv_sec * hz + tv.tv_usec * hz / 1000000;
+                       error = ndis_thsuspend(td, ticks);
+               } else {
+                       error = ndis_thsuspend(td, 0);
+               }
 
                lwkt_gettoken(&tokref, &ntoskrnl_dispatchtoken);
                nanotime(&t2);
@@ -629,7 +635,7 @@ ntoskrnl_waitforobjs(uint32_t cnt, nt_dispatch_header *obj[],
                if (error || wtype == WAITTYPE_ANY)
                        break;
 
-               if (duetime != NULL) {
+               if (duetime) {
                        tv.tv_sec -= (t2.tv_sec - t1.tv_sec);
                        tv.tv_usec -= (t2.tv_nsec - t1.tv_nsec) / 1000;
                }
index f6ced0f..58c7736 100644 (file)
@@ -956,7 +956,7 @@ sys_fpathconf(struct fpathconf_args *uap)
        case DTYPE_FIFO:
        case DTYPE_VNODE:
                vp = (struct vnode *)fp->f_data;
-               error = VOP_PATHCONF(vp, uap->name, uap->sysmsg_fds);
+               error = VOP_PATHCONF(vp, uap->name, &uap->sysmsg_reg);
                break;
        default:
                error = EOPNOTSUPP;
index 3201a2c..1979289 100644 (file)
@@ -1597,6 +1597,8 @@ ttread(struct tty *tp, struct uio *uio, int flag)
        struct timeval stime;
 
        lp = curthread->td_lwp;
+       stime.tv_sec = 0;       /* fix compiler warnings */
+       stime.tv_usec = 0;
 
 loop:
        crit_enter();
@@ -1681,7 +1683,7 @@ loop:
                        if (qp->c_cc >= m)
                                goto read;
                        getmicrotime(&timecopy);
-                       if (!has_stime) {
+                       if (has_stime == 0) {
                                /* first character, start timer */
                                has_stime = 1;
                                stime = timecopy;
@@ -1701,7 +1703,7 @@ loop:
                        if (qp->c_cc > 0)
                                goto read;
                        getmicrotime(&timecopy);
-                       if (!has_stime) {
+                       if (has_stime == 0) {
                                has_stime = 1;
                                stime = timecopy;
                                slp = t;
index f1e868f..1c9f4e5 100644 (file)
@@ -676,7 +676,6 @@ kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio,
 #endif
        if (error == 0)
                *res  = len - auio->uio_resid;
-done:
        fdrop(fp);
        return (error);
 }
@@ -856,7 +855,6 @@ kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio,
 #endif
        if (error == 0)
                *res = len - auio->uio_resid;
-done:
        fdrop(fp);
        return (error);
 }
index 650ad7f..8217817 100644 (file)
@@ -3540,9 +3540,9 @@ bpdone(struct buf *bp, int elseit)
                        }
 #if defined(VFS_BIO_DEBUG)
                        if (OFF_TO_IDX(foff) != m->pindex) {
-                               kprintf(
-"biodone: foff(%lu)/m->pindex(%d) mismatch\n",
-                                   (unsigned long)foff, m->pindex);
+                               kprintf("biodone: foff(%lu)/m->pindex(%ld) "
+                                       "mismatch\n",
+                                       (unsigned long)foff, (long)m->pindex);
                        }
 #endif
 
index aa8d8e6..75a19bd 100644 (file)
@@ -51,7 +51,7 @@
  * look at item 3.
  */
 void *
-bsearch(const void *key, const void *base0, size_t nmemb, size_t size,
+kbsearch(const void *key, const void *base0, size_t nmemb, size_t size,
        int (*compar)(const void *, const void *))
 {
        const char *base = base0;
index 1e1c346..f3df6f8 100644 (file)
@@ -4432,6 +4432,11 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kif *kif,
                        } while (!terminal);
                        break;
 #endif /* INET6 */
+               default:
+                       DPFPRINTF(PF_DEBUG_MISC,
+                           ("pf: ICMP AF %d unknown (ip6)\n", pd->af));
+                       return (PF_DROP);
+                       break;
                }
 
                switch (pd2.proto) {
index 4815445..8fc6964 100644 (file)
@@ -880,7 +880,7 @@ tapwrite(struct dev_write_args *ap)
                return (0);
 
        if (uio->uio_resid > TAPMRU) {
-               TAPDEBUG(ifp, "invalid packet len = %ld, minor = %#x\n",
+               TAPDEBUG(ifp, "invalid packet len = %zu, minor = %#x\n",
                         uio->uio_resid, minor(tp->tap_dev));
 
                return (EIO);
index 8a555e1..64205d0 100644 (file)
@@ -296,6 +296,8 @@ ah4_output(struct mbuf *m, struct ipsecrequest *isr)
        if (finaldst) {
                dst.s_addr = ip->ip_dst.s_addr;
                ip->ip_dst.s_addr = finaldst->s_addr;
+       } else {
+               dst.s_addr = 0; /* fix compiler warning */
        }
 
        /*
index 406f20c..79885d8 100644 (file)
@@ -1422,7 +1422,7 @@ ip6_notify_pmtu(struct inpcb *in6p, struct sockaddr_in6 *dst, u_int32_t *mtu)
            IPV6_PATHMTU, IPPROTO_IPV6)) == NULL)
                return;
 
-       if (sbappendaddr(&so->so_rcv, (struct sockaddr *)dst, NULL, m_mtu)
+       if (sbappendaddr(&so->so_rcv.sb, (struct sockaddr *)dst, NULL, m_mtu)
            == 0) {
                m_freem(m_mtu);
                /* XXX: should count statistics */
index df18d2b..70d83fa 100644 (file)
@@ -92,7 +92,7 @@ void  ipx_pcbdetach (struct ipxpcb *ipxp);
 void   ipx_pcbdisconnect (struct ipxpcb *ipxp);
 struct ipxpcb *
        ipx_pcblookup (struct ipx_addr *faddr, int lport, int wildp);
-void   ipx_pcbnotify (struct ipx_addr *dst, int errno,
+void   ipx_pcbnotify (struct ipx_addr *dst, int error,
                           void (*notify)(struct ipxpcb *), long param);
 void   ipx_setpeeraddr (struct ipxpcb *ipxp, struct sockaddr **nam);
 void   ipx_setsockaddr (struct ipxpcb *ipxp, struct sockaddr **nam);
index d2a6be0..ed48c72 100644 (file)
@@ -93,7 +93,7 @@ int   ipx_control (struct socket *so, u_long cmd, caddr_t data,
                         struct ifnet *ifp, struct thread *td);
 void   ipx_ctlinput (int cmd, struct sockaddr *arg_as_sa, void *dummy);
 int    ipx_ctloutput (struct socket *so, struct sockopt *sopt);
-void   ipx_drop (struct ipxpcb *ipxp, int errno);
+void   ipx_drop (struct ipxpcb *ipxp, int error);
 void   ipx_init (void);
 void   ipx_input (struct mbuf *m, struct ipxpcb *ipxp);
 int    ipx_outputfl (struct mbuf *m0, struct route *ro, int flags);
index bd82bfa..5867164 100644 (file)
@@ -131,8 +131,13 @@ u_int32_t t, l, r;
 
 void cast_setkey(cast_key* key, u_int8_t* rawkey, int keybytes)
 {
-u_int32_t t[4], z[4], x[4];
-int i;
+       u_int32_t t[4], z[4], x[4];
+       int i;
+
+       /* Remove compiler warnings */
+       for (i = 0; i < 4; i++) {
+               t[i] = z[i] = 0;
+       }
 
        /* Set number of rounds to 12 or 16, depending on key length */
        key->rounds = (keybytes <= 10 ? 12 : 16);
index d6aec3f..3990f96 100644 (file)
@@ -993,7 +993,7 @@ lapic_map(vm_offset_t lapic_addr)
        SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N |
            pmap_get_pgeflag() | (lapic_addr & PG_FRAME));
 
-       kprintf("lapic: at 0x%08x\n", lapic_addr);
+       kprintf("lapic: at %p\n", (void *)lapic_addr);
 }
 
 static TAILQ_HEAD(, lapic_enumerator) lapic_enumerators =
index 2811b2c..9f9ed9e 100644 (file)
@@ -1433,7 +1433,6 @@ getmemsize(int first)
        vm_offset_t physmap[PHYSMAP_ENTRIES*2];
        pt_entry_t *pte;
        quad_t maxmem;
-       const char *cp;
        struct {
                u_int64_t base;
                u_int64_t length;
index 1843ca4..b6c4e4d 100644 (file)
@@ -557,7 +557,7 @@ mp_announce(void)
        for (x = 0; x < mp_napics; ++x) {
                kprintf(" io%d (APIC): apic id: %2d", x, IO_TO_ID(x));
                kprintf(", version: 0x%08x", io_apic_versions[x]);
-               kprintf(", at 0x%08x\n", io_apic_address[x]);
+               kprintf(", at 0x%08lx\n", io_apic_address[x]);
        }
 #else
        kprintf(" Warning: APIC I/O disabled\n");
index cc2e666..fae3014 100644 (file)
@@ -1616,9 +1616,9 @@ pmap_remove_pte(struct pmap *pmap, unsigned *ptq, vm_offset_t va,
                if (oldpte & PG_M) {
 #if defined(PMAP_DIAGNOSTIC)
                        if (pmap_nw_modified((pt_entry_t) oldpte)) {
-                               kprintf(
-       "pmap_remove: modified page not writable: va: 0x%x, pte: 0x%x\n",
-                                   va, oldpte);
+                               kprintf("pmap_remove: modified page not "
+                                       "writable: va: %p, pte: 0x%lx\n",
+                                       (void *)va, (long)oldpte);
                        }
 #endif
                        if (pmap_track_modified(va))
@@ -1798,9 +1798,9 @@ pmap_remove_all(vm_page_t m)
                if (tpte & PG_M) {
 #if defined(PMAP_DIAGNOSTIC)
                        if (pmap_nw_modified((pt_entry_t) tpte)) {
-                               kprintf(
-       "pmap_remove_all: modified page not writable: va: 0x%x, pte: 0x%x\n",
-                                   pv->pv_va, tpte);
+                               kprintf("pmap_remove_all: modified page "
+                                       "not writable: va: %p, pte: 0x%lx\n",
+                                       (void *)pv->pv_va, (long)tpte);
                        }
 #endif
                        if (pmap_track_modified(pv->pv_va))
@@ -1951,8 +1951,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
 #ifdef PMAP_DIAGNOSTIC
        if (va >= KvaEnd)
                panic("pmap_enter: toobig");
-       if ((va >= UPT_MIN_ADDRESS) && (va < UPT_MAX_ADDRESS))
-               panic("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va);
+       if ((va >= UPT_MIN_ADDRESS) && (va < UPT_MAX_ADDRESS)) {
+               panic("pmap_enter: invalid to pmap_enter page "
+                     "table pages (va: %p)", (void *)va);
+       }
 #endif
        if (va < UPT_MAX_ADDRESS && pmap == &kernel_pmap) {
                kprintf("Warning: pmap_enter called on UVA with kernel_pmap\n");
@@ -1979,8 +1981,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
         * Page Directory table entry not valid, we need a new PT page
         */
        if (pte == NULL) {
-               panic("pmap_enter: invalid page directory pdir=%x, va=0x%x\n",
-                    (unsigned) pmap->pm_pdir[PTDPTDI], va);
+               panic("pmap_enter: invalid page directory pdir=0x%lx, va=%p\n",
+                    (long)pmap->pm_pdir[PTDPTDI], (void *)va);
        }
 
        pa = VM_PAGE_TO_PHYS(m) & PG_FRAME;
@@ -2007,9 +2009,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
 
 #if defined(PMAP_DIAGNOSTIC)
                if (pmap_nw_modified((pt_entry_t) origpte)) {
-                       kprintf(
-       "pmap_enter: modified page not writable: va: 0x%x, pte: 0x%x\n",
-                           va, origpte);
+                       kprintf("pmap_enter: modified page not "
+                               "writable: va: %p, pte: 0x%lx\n",
+                               (void *)va, (long )origpte);
                }
 #endif
 
@@ -2045,7 +2047,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
                int err;
                err = pmap_remove_pte(pmap, pte, va, &info);
                if (err)
-                       panic("pmap_enter: pte vanished, va: 0x%x", va);
+                       panic("pmap_enter: pte vanished, va: %p", (void *)va);
        }
 
        /*
@@ -2918,7 +2920,8 @@ pmap_testbit(vm_page_t m, int bit)
 
 #if defined(PMAP_DIAGNOSTIC)
                if (!pv->pv_pmap) {
-                       kprintf("Null pmap (tb) at va: 0x%x\n", pv->pv_va);
+                       kprintf("Null pmap (tb) at va: %p\n",
+                               (void *)pv->pv_va);
                        continue;
                }
 #endif
@@ -2964,7 +2967,8 @@ pmap_clearbit(vm_page_t m, int bit)
 
 #if defined(PMAP_DIAGNOSTIC)
                if (!pv->pv_pmap) {
-                       kprintf("Null pmap (cb) at va: 0x%x\n", pv->pv_va);
+                       kprintf("Null pmap (cb) at va: %p\n",
+                               (void *)pv->pv_va);
                        continue;
                }
 #endif
@@ -3394,10 +3398,11 @@ pmap_pvdump(vm_paddr_t pa)
        m = PHYS_TO_VM_PAGE(pa);
        TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
 #ifdef used_to_be
-               kprintf(" -> pmap %p, va %x, flags %x",
-                   (void *)pv->pv_pmap, pv->pv_va, pv->pv_flags);
+               kprintf(" -> pmap %p, va %p, flags %x",
+                   (void *)pv->pv_pmap, (long)pv->pv_va, pv->pv_flags);
 #endif
-               kprintf(" -> pmap %p, va %x", (void *)pv->pv_pmap, pv->pv_va);
+               kprintf(" -> pmap %p, va %p",
+                       (void *)pv->pv_pmap, (void *)pv->pv_va);
                pads(pv->pv_pmap);
        }
        kprintf(" ");
index 2e66c5e..771101e 100644 (file)
@@ -1024,7 +1024,7 @@ trap_fatal(struct trapframe *frame, vm_offset_t eva)
        kprintf("lapic.id = %08x\n", lapic.id);
 #endif
        if (type == T_PAGEFLT) {
-               kprintf("fault virtual address  = 0x%x\n", eva);
+               kprintf("fault virtual address  = %p\n", (void *)eva);
                kprintf("fault code             = %s %s, %s\n",
                        code & PGEX_U ? "user" : "supervisor",
                        code & PGEX_W ? "write" : "read",
index 1c92e97..e90fedc 100644 (file)
@@ -952,7 +952,7 @@ trap_fatal(struct trapframe *frame, int usermode, vm_offset_t eva)
        kprintf("cpuid = %d\n", mycpu->gd_cpuid);
 #endif
        if (type == T_PAGEFLT) {
-               kprintf("fault virtual address  = 0x%x\n", eva);
+               kprintf("fault virtual address  = %p\n", (void *)eva);
                kprintf("fault code             = %s %s, %s\n",
                        usermode ? "user" : "supervisor",
                        code & PGEX_W ? "write" : "read",
index 1a2ca6c..ec0aa9d 100644 (file)
@@ -1827,7 +1827,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
                int err;
                err = pmap_remove_pte(pmap, pte, va);
                if (err)
-                       panic("pmap_enter: pte vanished, va: 0x%x", va);
+                       panic("pmap_enter: pte vanished, va: %p", (void *)va);
        }
 
        /*
index d52763f..4cb8da1 100644 (file)
@@ -88,7 +88,7 @@ static __inline size_t szmin(size_t a, size_t b) { return (a < b ? a : b); }
 /* Prototypes for non-quad routines. */
 u_int32_t karc4random (void);
 int     bcmp (const void *, const void *, size_t);
-void   *bsearch (const void *, const void *, size_t,
+void   *kbsearch (const void *, const void *, size_t,
                     size_t, int (*)(const void *, const void *));
 #ifndef HAVE_INLINE_FFS
 int     ffs (int);
index b0709d6..6ffa510 100644 (file)
@@ -295,6 +295,9 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
        info.dpos = nfsd->nd_dpos;
        info.v3 = (nfsd->nd_flag & ND_NFSV3);
 
+       guard.tv_sec = 0;       /* fix compiler warning */
+       guard.tv_nsec = 0;
+
        nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
        fhp = &nfh.fh_generic;
        NEGREPLYOUT(nfsm_srvmtofh(&info, nfsd, fhp, &error));
index 540816e..54a31f8 100644 (file)
@@ -1607,6 +1607,9 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp,
                         */
 #ifdef NFSKERB
                        XXX
+#else
+                       ktvout.tv_sec = 0;
+                       ktvout.tv_usec = 0;
 #endif
 
                        *tl++ = rpc_auth_kerb;
@@ -2392,6 +2395,9 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header)
                         */
 #ifdef NFSKERB
                        XXX
+#else
+                       tvout.tv_sec = 0;
+                       tvout.tv_usec = 0;
 #endif
 
                        tvout.tv_sec = fxdr_unsigned(long, tvout.tv_sec);
index cc49340..e71f6f2 100644 (file)
@@ -981,6 +981,9 @@ nfs_getnickauth(struct nfsmount *nmp, struct ucred *cred, char **auth_str,
         */
 #ifdef NFSKERB
        XXX
+#else
+       ktvout.tv_sec = 0;
+       ktvout.tv_usec = 0;
 #endif
 
        *verfp++ = ktvout.tv_sec;
@@ -1019,6 +1022,9 @@ nfs_savenickauth(struct nfsmount *nmp, struct ucred *cred, int len,
                 */
 #ifdef NFSKERB
                XXX
+#else
+               ktvout.tv_sec = 0;
+               ktvout.tv_usec = 0;
 #endif
                ktvout.tv_sec = fxdr_unsigned(long, ktvout.tv_sec);
                ktvout.tv_usec = fxdr_unsigned(long, ktvout.tv_usec);
index aa88021..1ff6e18 100644 (file)
@@ -717,8 +717,10 @@ udf_readdir(struct vop_readdir_args *a)
                uiodir.ncookies = ncookies;
                uiodir.cookies = cookies;
                uiodir.acookies = 0;
-       } else
+       } else {
                uiodir.cookies = NULL;
+               uiodir.ncookies = 0;
+       }
 
        /*
         * Iterate through the file id descriptors.  Give the parent dir