Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Use PRId64 instead of hard coding "%lld" to fix build pr...



details:   https://anonhg.NetBSD.org/src/rev/e52efa37e98a
branches:  trunk
changeset: 542283:e52efa37e98a
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jan 25 18:12:31 2003 +0000

description:
Use PRId64 instead of hard coding "%lld" to fix build problems under
LP64 ports.

diffstat:

 sys/dev/isa/fd.c             |   8 ++--
 sys/ufs/ext2fs/ext2fs_subr.c |   8 +++--
 sys/ufs/ffs/ffs_softdep.c    |  11 ++++---
 sys/ufs/ffs/ffs_subr.c       |   8 +++--
 sys/ufs/lfs/lfs_alloc.c      |   6 ++--
 sys/ufs/lfs/lfs_segment.c    |  63 +++++++++++++++++++++++--------------------
 sys/ufs/lfs/lfs_vfsops.c     |   6 ++--
 7 files changed, 59 insertions(+), 51 deletions(-)

diffs (truncated from 387 to 300 lines):

diff -r 06edcfd4cbc7 -r e52efa37e98a sys/dev/isa/fd.c
--- a/sys/dev/isa/fd.c  Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/dev/isa/fd.c  Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.34 2003/01/25 13:02:07 tron Exp $     */
+/*     $NetBSD: fd.c,v 1.35 2003/01/25 18:12:31 tron Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.34 2003/01/25 13:02:07 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.35 2003/01/25 18:12:31 tron Exp $");
 
 #include "rnd.h"
 #include "opt_ddb.h"
@@ -1026,8 +1026,8 @@
                        block = (fd->sc_cylin * type->heads + head)
                            * type->sectrac + sec;
                        if (block != fd->sc_blkno) {
-                               printf("fdcintr: block %d != blkno %lld\n",
-                                   block, fd->sc_blkno);
+                               printf("fdcintr: block %d != blkno "
+                                   "%" PRId64 "\n", block, fd->sc_blkno);
 #ifdef DDB
                                 Debugger();
 #endif
diff -r 06edcfd4cbc7 -r e52efa37e98a sys/ufs/ext2fs/ext2fs_subr.c
--- a/sys/ufs/ext2fs/ext2fs_subr.c      Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/ufs/ext2fs/ext2fs_subr.c      Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_subr.c,v 1.8 2003/01/25 12:50:38 tron Exp $     */
+/*     $NetBSD: ext2fs_subr.c,v 1.9 2003/01/25 18:12:31 tron Exp $     */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -38,12 +38,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_subr.c,v 1.8 2003/01/25 12:50:38 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_subr.c,v 1.9 2003/01/25 18:12:31 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
 #include <sys/buf.h>
+#include <sys/inttypes.h>
 #include <ufs/ufs/inode.h>
 #include <ufs/ext2fs/ext2fs.h>
 #include <ufs/ext2fs/ext2fs_extern.h>
@@ -110,7 +111,8 @@
                        ep->b_blkno + btodb(ep->b_bcount) <= start)
                        continue;
                vprint("Disk overlap", vp);
-               printf("\tstart %lld, end %lld overlap start %lld, end %lld\n",
+               printf("\tstart %" PRId64 ", end %" PRId64 " overlap start "
+                       "%" PRId64 ", end %" PRId64 "\n",
                        start, last, ep->b_blkno,
                        ep->b_blkno + btodb(ep->b_bcount) - 1);
                panic("Disk buffer overlap");
diff -r 06edcfd4cbc7 -r e52efa37e98a sys/ufs/ffs/ffs_softdep.c
--- a/sys/ufs/ffs/ffs_softdep.c Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/ufs/ffs/ffs_softdep.c Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_softdep.c,v 1.40 2003/01/25 12:52:47 tron Exp $    */
+/*     $NetBSD: ffs_softdep.c,v 1.41 2003/01/25 18:12:32 tron Exp $    */
 
 /*
  * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.40 2003/01/25 12:52:47 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.41 2003/01/25 18:12:32 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -45,6 +45,7 @@
 #include <sys/syslog.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
+#include <sys/inttypes.h>
 #include <miscfs/specfs/specdev.h>
 #include <ufs/ufs/dir.h>
 #include <ufs/ufs/inode.h>
@@ -3419,14 +3420,14 @@
                if (adp->ad_lbn < NDADDR &&
                    ufs_rw32(dp->di_db[adp->ad_lbn], needswap) !=
                    adp->ad_newblkno)
-                       panic("%s: direct pointer #%d mismatch %d != %lld",
+                       panic("%s: direct pointer #%d mismatch %d != %" PRId64,
                            "softdep_write_inodeblock", (int)adp->ad_lbn,
                            ufs_rw32(dp->di_db[adp->ad_lbn], needswap), 
                            adp->ad_newblkno);
                if (adp->ad_lbn >= NDADDR &&
                    ufs_rw32(dp->di_ib[adp->ad_lbn - NDADDR], needswap) !=
                    adp->ad_newblkno)
-                       panic("%s: indirect pointer #%d mismatch %d != %lld",
+                       panic("%s: indirect pointer #%d mismatch %d != %" PRId64,
                            "softdep_write_inodeblock",
                            (int)(adp->ad_lbn - NDADDR),
                            (int)ufs_rw32(dp->di_ib[adp->ad_lbn - NDADDR],
@@ -3791,7 +3792,7 @@
                if (adp->ad_lbn < NDADDR) {
                        if (ufs_rw32(dp->di_db[adp->ad_lbn], needswap) !=
                            adp->ad_oldblkno)
-                               panic("%s: %s #%d mismatch %d != %lld",
+                               panic("%s: %s #%d mismatch %d != %" PRId64,
                                    "handle_written_inodeblock",
                                    "direct pointer", (int)adp->ad_lbn,
                                    ufs_rw32(dp->di_db[adp->ad_lbn], needswap),
diff -r 06edcfd4cbc7 -r e52efa37e98a sys/ufs/ffs/ffs_subr.c
--- a/sys/ufs/ffs/ffs_subr.c    Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/ufs/ffs/ffs_subr.c    Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_subr.c,v 1.26 2003/01/25 12:53:45 tron Exp $       */
+/*     $NetBSD: ffs_subr.c,v 1.27 2003/01/25 18:12:32 tron Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__KERNEL_RCSID)
-__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.26 2003/01/25 12:53:45 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.27 2003/01/25 18:12:32 tron Exp $");
 #endif
 
 #if HAVE_CONFIG_H
@@ -63,6 +63,7 @@
 #include <sys/vnode.h>
 #include <sys/mount.h>
 #include <sys/buf.h>
+#include <sys/inttypes.h>
 #include <ufs/ufs/inode.h>
 #include <ufs/ufs/ufsmount.h>
 #include <ufs/ufs/ufs_extern.h>
@@ -172,7 +173,8 @@
                    ep->b_blkno + btodb(ep->b_bcount) <= start)
                        continue;
                vprint("Disk overlap", vp);
-               printf("\tstart %lld, end %lld overlap start %lld, end %lld\n",
+               printf("\tstart %" PRId64 ", end %" PRId64 " overlap start "
+                   "%" PRId64 ", end %" PRId64 "\n",
                    start, last, ep->b_blkno,
                    ep->b_blkno + btodb(ep->b_bcount) - 1);
                panic("Disk buffer overlap");
diff -r 06edcfd4cbc7 -r e52efa37e98a sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c   Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c   Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_alloc.c,v 1.60 2003/01/25 12:58:21 tron Exp $      */
+/*     $NetBSD: lfs_alloc.c,v 1.61 2003/01/25 18:12:32 tron Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.60 2003/01/25 12:58:21 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.61 2003/01/25 18:12:32 tron Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -589,7 +589,7 @@
 #ifdef DIAGNOSTIC
                if (sup->su_nbytes < DINODE_SIZE) {
                        printf("lfs_vfree: negative byte count"
-                              " (segment %lld short by %d)\n",
+                              " (segment %" PRId64 " short by %d)\n",
                               dtosn(fs, old_iaddr),
                               (int)DINODE_SIZE - sup->su_nbytes);
                        panic("lfs_vfree: negative byte count");
diff -r 06edcfd4cbc7 -r e52efa37e98a sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Sat Jan 25 17:35:53 2003 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Sat Jan 25 18:12:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.92 2003/01/25 12:58:23 tron Exp $    */
+/*     $NetBSD: lfs_segment.c,v 1.93 2003/01/25 18:12:33 tron Exp $    */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.92 2003/01/25 12:58:23 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.93 2003/01/25 18:12:33 tron Exp $");
 
 #define ivndebug(vp,str) printf("ino %d: %s\n",VTOI(vp)->i_number,(str))
 
@@ -648,7 +648,8 @@
                                                printf("lfs_segwrite: ifile still has dirty blocks?!\n");
                                        ++dopanic;
                                        ++warned;
-                                       printf("bp=%p, lbn %lld, flags 0x%lx\n",
+                                       printf("bp=%p, lbn %" PRId64 ", "
+                                               "flags 0x%lx\n",
                                                bp, (long long)bp->b_lblkno,
                                                bp->b_flags);
                                }
@@ -967,7 +968,7 @@
 #ifdef DIAGNOSTIC
                if (sup->su_nbytes + DINODE_SIZE * ndupino < DINODE_SIZE) {
                        printf("lfs_writeinode: negative bytes "
-                              "(segment %lld short by %d, "
+                              "(segment %" PRId64 " short by %d, "
                               "oldsn=%u, cursn=%u, daddr=%d, su_nbytes=%u, "
                               "ndupino=%d)\n",
                               dtosn(fs, daddr),
@@ -1096,16 +1097,17 @@
                } else {
 #ifdef DIAGNOSTIC
                        if ((bp->b_flags & (B_CALL|B_INVAL)) == B_INVAL) {
-                               printf("lfs_gather: lbn %lld is B_INVAL\n",
-                                       bp->b_lblkno);
+                               printf("lfs_gather: lbn %" PRId64 " is "
+                                       "B_INVAL\n", bp->b_lblkno);
                                VOP_PRINT(bp->b_vp);
                        }
                        if (!(bp->b_flags & B_DELWRI))
                                panic("lfs_gather: bp not B_DELWRI");
                        if (!(bp->b_flags & B_LOCKED)) {
-                               printf("lfs_gather: lbn %lld blk %lld"
-                                      " not B_LOCKED\n", bp->b_lblkno,
-                                      dbtofsb(fs, bp->b_blkno));
+                               printf("lfs_gather: lbn %" PRId64 " blk "
+                                       "%" PRId64 " not B_LOCKED\n", 
+                                       bp->b_lblkno,
+                                       dbtofsb(fs, bp->b_blkno));
                                VOP_PRINT(bp->b_vp);
                                panic("lfs_gather: bp not B_LOCKED");
                        }
@@ -1186,7 +1188,7 @@
                sbp->b_blkno = fsbtodb(fs, fs->lfs_offset);
                off = fs->lfs_offset;
                if (sbp->b_blkno == sbp->b_lblkno) {
-                       printf("lfs_updatemeta: ino %d blk %lld"
+                       printf("lfs_updatemeta: ino %d blk %" PRId64
                               " has same lbn and daddr\n",
                               VTOI(vp)->i_number, (long long)off);
                }
@@ -1215,8 +1217,8 @@
 #ifdef DEBUG
                        if (ooff == 0) {
                                printf("lfs_updatemeta[1]: warning: writing "
-                                      "ino %d lbn %lld at 0x%x, was 0x0\n",
-                                      ip->i_number, lbn, off);
+                                       "ino %d lbn %" PRId64 " at 0x%x, :"
+                                       "was 0x0\n", ip->i_number, lbn, off);
                        }
 #endif
                        if (ooff == UNWRITTEN)
@@ -1233,8 +1235,8 @@
 #ifdef DEBUG
                        if (ooff == 0) {
                                printf("lfs_updatemeta[2]: warning: writing "
-                                      "ino %d lbn %lld at 0x%x, was 0x0\n",
-                                      ip->i_number, lbn, off);
+                                       "ino %d lbn %" PRId64 " at 0x%x, was "
+                                       "0x0\n", ip->i_number, lbn, off);
                        }
 #endif
                        if (ooff == UNWRITTEN)
@@ -1244,7 +1246,7 @@
                default:
                        ap = &a[num - 1];
                        if (bread(vp, ap->in_lbn, fs->lfs_bsize, NOCRED, &bp))
-                               panic("lfs_updatemeta: bread bno %lld",
+                               panic("lfs_updatemeta: bread bno %" PRId64,
                                      (long long)ap->in_lbn);
 
                        /* XXX ondisk32 */
@@ -1252,8 +1254,8 @@
 #if DEBUG
                        if (ooff == 0) {
                                printf("lfs_updatemeta[3]: warning: writing "
-                                      "ino %d lbn %lld at 0x%x, was 0x0\n",
-                                      ip->i_number, lbn, off);
+                                       "ino %d lbn %" PRId64 " at 0x%x, was "
+                                       "0x0\n", ip->i_number, lbn, off);
                        }
 #endif
                        if (ooff == UNWRITTEN)
@@ -1264,9 +1266,9 @@
                }
 #ifdef DEBUG
                if (daddr >= fs->lfs_lastpseg && daddr <= off) {
-                       printf("lfs_updatemeta: ino %d, lbn %lld, addr = %x "
-                              "in same pseg\n", VTOI(sp->vp)->i_number,
-                              sbp->b_lblkno, daddr);
+                       printf("lfs_updatemeta: ino %d, lbn %" PRId64 ", "
+                               "addr = %x in same pseg\n",
+                               VTOI(sp->vp)->i_number, sbp->b_lblkno, daddr);
                }



Home | Main Index | Thread Index | Old Index