svn commit: r190342 - in head/lib/libc/db: btree mpool

Xin LI delphij at FreeBSD.org
Mon Mar 23 16:22:10 PDT 2009


Author: delphij
Date: Mon Mar 23 23:22:09 2009
New Revision: 190342
URL: http://svn.freebsd.org/changeset/base/190342

Log:
  use more proper format string.
  
  Obtained from:	NetBSD via OpenBSD

Modified:
  head/lib/libc/db/btree/bt_debug.c
  head/lib/libc/db/mpool/mpool.c

Modified: head/lib/libc/db/btree/bt_debug.c
==============================================================================
--- head/lib/libc/db/btree/bt_debug.c	Mon Mar 23 22:35:30 2009	(r190341)
+++ head/lib/libc/db/btree/bt_debug.c	Mon Mar 23 23:22:09 2009	(r190342)
@@ -61,7 +61,7 @@ __bt_dump(DB *dbp)
 	char *sep;
 
 	t = dbp->internal;
-	(void)fprintf(stderr, "%s: pgsz %d",
+	(void)fprintf(stderr, "%s: pgsz %u",
 	    F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize);
 	if (F_ISSET(t, R_RECNO))
 		(void)fprintf(stderr, " keys %u", t->bt_nrecs);
@@ -157,7 +157,7 @@ __bt_dpage(PAGE *h)
 	indx_t cur, top;
 	char *sep;
 
-	(void)fprintf(stderr, "    page %d: (", h->pgno);
+	(void)fprintf(stderr, "    page %u: (", h->pgno);
 #undef X
 #define	X(flag, name) \
 	if (h->flags & flag) { \
@@ -174,7 +174,7 @@ __bt_dpage(PAGE *h)
 	(void)fprintf(stderr, ")\n");
 #undef X
 
-	(void)fprintf(stderr, "\tprev %2d next %2d", h->prevpg, h->nextpg);
+	(void)fprintf(stderr, "\tprev %2u next %2u", h->prevpg, h->nextpg);
 	if (h->flags & P_OVERFLOW)
 		return;
 
@@ -292,27 +292,27 @@ __bt_stat(DB *dbp)
 		(void)mpool_put(t->bt_mp, h, 0);
 	}
 
-	(void)fprintf(stderr, "%d level%s with %ld keys",
+	(void)fprintf(stderr, "%d level%s with %lu keys",
 	    levels, levels == 1 ? "" : "s", nkeys);
 	if (F_ISSET(t, R_RECNO))
-		(void)fprintf(stderr, " (%d header count)", t->bt_nrecs);
+		(void)fprintf(stderr, " (%u header count)", t->bt_nrecs);
 	(void)fprintf(stderr,
-	    "\n%u pages (leaf %d, internal %d, overflow %d)\n",
+	    "\n%u pages (leaf %u, internal %u, overflow %u)\n",
 	    pinternal + pleaf + pcont, pleaf, pinternal, pcont);
-	(void)fprintf(stderr, "%ld cache hits, %ld cache misses\n",
+	(void)fprintf(stderr, "%lu cache hits, %lu cache misses\n",
 	    bt_cache_hit, bt_cache_miss);
 	(void)fprintf(stderr, "%lu splits (%lu root splits, %lu sort splits)\n",
 	    bt_split, bt_rootsplit, bt_sortsplit);
 	pleaf *= t->bt_psize - BTDATAOFF;
 	if (pleaf)
 		(void)fprintf(stderr,
-		    "%.0f%% leaf fill (%ld bytes used, %ld bytes free)\n",
+		    "%.0f%% leaf fill (%lu bytes used, %lu bytes free)\n",
 		    ((double)(pleaf - lfree) / pleaf) * 100,
 		    pleaf - lfree, lfree);
 	pinternal *= t->bt_psize - BTDATAOFF;
 	if (pinternal)
 		(void)fprintf(stderr,
-		    "%.0f%% internal fill (%ld bytes used, %ld bytes free\n",
+		    "%.0f%% internal fill (%lu bytes used, %lu bytes free\n",
 		    ((double)(pinternal - ifree) / pinternal) * 100,
 		    pinternal - ifree, ifree);
 	if (bt_pfxsaved)

Modified: head/lib/libc/db/mpool/mpool.c
==============================================================================
--- head/lib/libc/db/mpool/mpool.c	Mon Mar 23 22:35:30 2009	(r190341)
+++ head/lib/libc/db/mpool/mpool.c	Mon Mar 23 23:22:09 2009	(r190342)
@@ -406,9 +406,9 @@ mpool_stat(MPOOL *mp)
 	int cnt;
 	char *sep;
 
-	(void)fprintf(stderr, "%u pages in the file\n", mp->npages);
+	(void)fprintf(stderr, "%lu pages in the file\n", mp->npages);
 	(void)fprintf(stderr,
-	    "page size %lu, cacheing %u pages of %u page max cache\n",
+	    "page size %lu, cacheing %lu pages of %lu page max cache\n",
 	    mp->pagesize, mp->curcache, mp->maxcache);
 	(void)fprintf(stderr, "%lu page puts, %lu page gets, %lu page new\n",
 	    mp->pageput, mp->pageget, mp->pagenew);


More information about the svn-src-all mailing list