Fix printf() formats.

This commit is contained in:
christos 1996-03-16 23:17:04 +00:00
parent 3cc52443b5
commit c9e746a335
9 changed files with 27 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lkm.c,v 1.28 1996/02/09 18:59:38 christos Exp $ */ /* $NetBSD: kern_lkm.c,v 1.29 1996/03/16 23:17:04 christos Exp $ */
/* /*
* Copyright (c) 1994 Christopher G. Demetriou * Copyright (c) 1994 Christopher G. Demetriou
@ -240,8 +240,8 @@ lkmioctl(dev, cmd, data, flag, p)
resrvp->addr = curp->area; /* ret kernel addr */ resrvp->addr = curp->area; /* ret kernel addr */
#ifdef DEBUG #ifdef DEBUG
printf("LKM: LMRESERV (actual = 0x%08x)\n", curp->area); printf("LKM: LMRESERV (actual = 0x%08lx)\n", curp->area);
printf("LKM: LMRESERV (adjusted = 0x%08x)\n", printf("LKM: LMRESERV (adjusted = 0x%08lx)\n",
trunc_page(curp->area)); trunc_page(curp->area));
#endif /* DEBUG */ #endif /* DEBUG */
lkm_state = LKMS_RESERVED; lkm_state = LKMS_RESERVED;
@ -273,7 +273,7 @@ lkmioctl(dev, cmd, data, flag, p)
if ((curp->offset + i) < curp->size) { if ((curp->offset + i) < curp->size) {
lkm_state = LKMS_LOADING; lkm_state = LKMS_LOADING;
#ifdef DEBUG #ifdef DEBUG
printf("LKM: LMLOADBUF (loading @ %d of %d, i = %d)\n", printf("LKM: LMLOADBUF (loading @ %ld of %ld, i = %d)\n",
curp->offset, curp->size, i); curp->offset, curp->size, i);
#endif /* DEBUG */ #endif /* DEBUG */
} else { } else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_malloc.c,v 1.14 1996/02/20 23:56:16 cgd Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15 1996/03/16 23:17:06 christos Exp $ */
/* /*
* Copyright (c) 1987, 1991, 1993 * Copyright (c) 1987, 1991, 1993
@ -199,7 +199,7 @@ malloc(size, type, flags)
memname[freep->type] : "???"; memname[freep->type] : "???";
if (kbp->kb_next && if (kbp->kb_next &&
!kernacc(kbp->kb_next, sizeof(struct freelist), 0)) { !kernacc(kbp->kb_next, sizeof(struct freelist), 0)) {
printf("%s %d of object %p size %d %s %s (invalid addr %p)\n", printf("%s %d of object %p size %ld %s %s (invalid addr %p)\n",
"Data modified on freelist: word", "Data modified on freelist: word",
(int32_t *)&kbp->kb_next - (int32_t *)kbp, va, size, (int32_t *)&kbp->kb_next - (int32_t *)kbp, va, size,
"previous type", savedtype, kbp->kb_next); "previous type", savedtype, kbp->kb_next);
@ -223,7 +223,7 @@ malloc(size, type, flags)
for (lp = (int32_t *)va; lp < end; lp++) { for (lp = (int32_t *)va; lp < end; lp++) {
if (*lp == WEIRD_ADDR) if (*lp == WEIRD_ADDR)
continue; continue;
printf("%s %d of object %p size %d %s %s (0x%x != 0x%x)\n", printf("%s %d of object %p size %ld %s %s (0x%x != 0x%x)\n",
"Data modified on freelist: word", lp - (int32_t *)va, "Data modified on freelist: word", lp - (int32_t *)va,
va, size, "previous type", savedtype, *lp, WEIRD_ADDR); va, size, "previous type", savedtype, *lp, WEIRD_ADDR);
break; break;
@ -289,7 +289,7 @@ free(addr, type)
else else
alloc = addrmask[kup->ku_indx]; alloc = addrmask[kup->ku_indx];
if (((u_long)addr & alloc) != 0) if (((u_long)addr & alloc) != 0)
panic("free: unaligned addr 0x%x, size %d, type %s, mask %d\n", panic("free: unaligned addr %p, size %ld, type %s, mask %ld\n",
addr, size, memname[type], alloc); addr, size, memname[type], alloc);
#endif /* DIAGNOSTIC */ #endif /* DIAGNOSTIC */
if (size > MAXALLOCSAVE) { if (size > MAXALLOCSAVE) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_disk.c,v 1.16 1996/02/09 18:59:56 christos Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/* /*
* Copyright (c) 1995 Jason R. Thorpe. All rights reserved. * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
@ -215,7 +215,8 @@ diskerr(bp, dname, what, pri, blkdone, lp)
int sn; int sn;
if (pri != LOG_PRINTF) { if (pri != LOG_PRINTF) {
log(pri, ""); static const char fmt[] = "";
log(pri, fmt);
pr = addlog; pr = addlog;
} else } else
pr = printf; pr = printf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_prf.c,v 1.22 1996/03/14 19:01:11 christos Exp $ */ /* $NetBSD: subr_prf.c,v 1.23 1996/03/16 23:17:10 christos Exp $ */
/*- /*-
* Copyright (c) 1986, 1988, 1991, 1993 * Copyright (c) 1986, 1988, 1991, 1993
@ -54,6 +54,7 @@
#include <sys/tprintf.h> #include <sys/tprintf.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/cpu.h>
#include <dev/cons.h> #include <dev/cons.h>
@ -95,10 +96,6 @@ const char *panicstr;
* and then reboots. If we are called twice, then we avoid trying to sync * and then reboots. If we are called twice, then we avoid trying to sync
* the disks as this often leads to recursive panics. * the disks as this often leads to recursive panics.
*/ */
#ifdef __GNUC__
volatile void boot(int flags); /* boot() does not return */
volatile /* panic() does not return */
#endif
void void
#ifdef __STDC__ #ifdef __STDC__
panic(const char *fmt, ...) panic(const char *fmt, ...)

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_rmap.c,v 1.10 1996/02/04 02:16:49 christos Exp $ */ /* $NetBSD: subr_rmap.c,v 1.11 1996/03/16 23:17:11 christos Exp $ */
/* /*
* Copyright (C) 1992, 1994 Wolfgang Solfrank. * Copyright (C) 1992, 1994 Wolfgang Solfrank.
@ -207,12 +207,12 @@ rmfree(mp, size, addr)
*/ */
if (fp->m_size > size) { if (fp->m_size > size) {
/* range to free is smaller, so drop that */ /* range to free is smaller, so drop that */
printf("rmfree: map '%s' loses space (%d)\n", printf("rmfree: map '%s' loses space (%ld)\n",
mp->m_name, size); mp->m_name, size);
return; return;
} else { } else {
/* drop the smallest slot in the list */ /* drop the smallest slot in the list */
printf("rmfree: map '%s' loses space (%d)\n", printf("rmfree: map '%s' loses space (%ld)\n",
mp->m_name, fp->m_size); mp->m_name, fp->m_size);
ovbcopy(fp + 1, fp, ovbcopy(fp + 1, fp,
(char *)(mp->m_limit - 1) - (char *)fp); (char *)(mp->m_limit - 1) - (char *)fp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysv_shm.c,v 1.36 1996/02/09 19:00:29 christos Exp $ */ /* $NetBSD: sysv_shm.c,v 1.37 1996/03/16 23:17:13 christos Exp $ */
/* /*
* Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved. * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
@ -352,7 +352,7 @@ shmget_existing(p, uap, mode, segnum, retval)
return error; return error;
if (SCARG(uap, size) && SCARG(uap, size) > shmseg->shm_segsz) if (SCARG(uap, size) && SCARG(uap, size) > shmseg->shm_segsz)
return EINVAL; return EINVAL;
if (SCARG(uap, shmflg) & (IPC_CREAT | IPC_EXCL) == if ((SCARG(uap, shmflg) & (IPC_CREAT | IPC_EXCL)) ==
(IPC_CREAT | IPC_EXCL)) (IPC_CREAT | IPC_EXCL))
return EEXIST; return EEXIST;
*retval = IXSEQ_TO_IPCID(segnum, shmseg->shm_perm); *retval = IXSEQ_TO_IPCID(segnum, shmseg->shm_perm);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.66 1996/02/09 19:00:38 christos Exp $ */ /* $NetBSD: tty.c,v 1.67 1996/03/16 23:17:15 christos Exp $ */
/*- /*-
* Copyright (c) 1982, 1986, 1990, 1991, 1993 * Copyright (c) 1982, 1986, 1990, 1991, 1993
@ -1878,7 +1878,7 @@ ttyinfo(tp)
utime.tv_sec += 1; utime.tv_sec += 1;
utime.tv_usec -= 1000000; utime.tv_usec -= 1000000;
} }
ttyprintf(tp, "%d.%02du ", utime.tv_sec, ttyprintf(tp, "%ld.%02ldu ", utime.tv_sec,
utime.tv_usec / 10000); utime.tv_usec / 10000);
/* Round up and print system time. */ /* Round up and print system time. */
@ -1887,7 +1887,7 @@ ttyinfo(tp)
stime.tv_sec += 1; stime.tv_sec += 1;
stime.tv_usec -= 1000000; stime.tv_usec -= 1000000;
} }
ttyprintf(tp, "%d.%02ds ", stime.tv_sec, ttyprintf(tp, "%ld.%02lds ", stime.tv_sec,
stime.tv_usec / 10000); stime.tv_usec / 10000);
#define pgtok(a) (((a) * NBPG) / 1024) #define pgtok(a) (((a) * NBPG) / 1024)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_cluster.c,v 1.10 1996/02/09 19:00:56 christos Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.11 1996/03/16 23:17:18 christos Exp $ */
/*- /*-
* Copyright (c) 1993 * Copyright (c) 1993
@ -296,7 +296,7 @@ cluster_rbuild(vp, filesize, bp, lbn, blkno, size, run, flags)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (size != vp->v_mount->mnt_stat.f_iosize) if (size != vp->v_mount->mnt_stat.f_iosize)
panic("cluster_rbuild: size %d != filesize %d\n", panic("cluster_rbuild: size %ld != filesize %ld\n",
size, vp->v_mount->mnt_stat.f_iosize); size, vp->v_mount->mnt_stat.f_iosize);
#endif #endif
if (size * (lbn + run + 1) > filesize) if (size * (lbn + run + 1) > filesize)
@ -623,7 +623,7 @@ cluster_wbuild(vp, last_bp, size, start_lbn, len, lbn)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (size != vp->v_mount->mnt_stat.f_iosize) if (size != vp->v_mount->mnt_stat.f_iosize)
panic("cluster_wbuild: size %d != filesize %d\n", panic("cluster_wbuild: size %ld != filesize %ld\n",
size, vp->v_mount->mnt_stat.f_iosize); size, vp->v_mount->mnt_stat.f_iosize);
#endif #endif
redo: redo:
@ -706,7 +706,7 @@ redo:
/* Move memory from children to parent */ /* Move memory from children to parent */
if (tbp->b_blkno != (bp->b_blkno + btodb(bp->b_bufsize))) { if (tbp->b_blkno != (bp->b_blkno + btodb(bp->b_bufsize))) {
printf("Clustered Block: %d addr %x bufsize: %d\n", printf("Clustered Block: %d addr %x bufsize: %ld\n",
bp->b_lblkno, bp->b_blkno, bp->b_bufsize); bp->b_lblkno, bp->b_blkno, bp->b_bufsize);
printf("Child Block: %d addr: %x\n", tbp->b_lblkno, printf("Child Block: %d addr: %x\n", tbp->b_lblkno,
tbp->b_blkno); tbp->b_blkno);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_subr.c,v 1.51 1996/02/09 19:01:01 christos Exp $ */ /* $NetBSD: vfs_subr.c,v 1.52 1996/03/16 23:17:20 christos Exp $ */
/* /*
* Copyright (c) 1989, 1993 * Copyright (c) 1989, 1993
@ -1187,7 +1187,7 @@ vprint(label, vp)
if (label != NULL) if (label != NULL)
printf("%s: ", label); printf("%s: ", label);
printf("type %s, usecount %d, writecount %d, refcount %d,", printf("type %s, usecount %d, writecount %d, refcount %ld,",
typename[vp->v_type], vp->v_usecount, vp->v_writecount, typename[vp->v_type], vp->v_usecount, vp->v_writecount,
vp->v_holdcnt); vp->v_holdcnt);
buf[0] = '\0'; buf[0] = '\0';