summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2004-09-10 05:44:17 +0000
committerkuriyama <kuriyama@FreeBSD.org>2004-09-10 05:44:17 +0000
commit3deecb5cd52190c4f2779b92625e86c06342f9c6 (patch)
tree0d98b4e76bec4c1b35654daeda82dcc94b68ed3a
parent473098d94ade3efcae370241431267ceb7142248 (diff)
downloadFreeBSD-src-3deecb5cd52190c4f2779b92625e86c06342f9c6.zip
FreeBSD-src-3deecb5cd52190c4f2779b92625e86c06342f9c6.tar.gz
Fix format strings to unbreak with -DDEBUG option.
-rw-r--r--lib/libc/db/btree/bt_debug.c29
-rw-r--r--lib/libc/db/hash/hash.c2
-rw-r--r--lib/libc/db/mpool/mpool.c4
-rw-r--r--lib/libc/gmon/gmon.c4
4 files changed, 20 insertions, 19 deletions
diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c
index 11ed3d8..14aadc6 100644
--- a/lib/libc/db/btree/bt_debug.c
+++ b/lib/libc/db/btree/bt_debug.c
@@ -69,7 +69,7 @@ __bt_dump(dbp)
(void)fprintf(stderr, "%s: pgsz %d",
F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize);
if (F_ISSET(t, R_RECNO))
- (void)fprintf(stderr, " keys %lu", t->bt_nrecs);
+ (void)fprintf(stderr, " keys %u", t->bt_nrecs);
#undef X
#define X(flag, name) \
if (F_ISSET(t, flag)) { \
@@ -108,12 +108,12 @@ __bt_dmpage(h)
char *sep;
m = (BTMETA *)h;
- (void)fprintf(stderr, "magic %lx\n", m->magic);
- (void)fprintf(stderr, "version %lu\n", m->version);
- (void)fprintf(stderr, "psize %lu\n", m->psize);
- (void)fprintf(stderr, "free %lu\n", m->free);
- (void)fprintf(stderr, "nrecs %lu\n", m->nrecs);
- (void)fprintf(stderr, "flags %lu", m->flags);
+ (void)fprintf(stderr, "magic %x\n", m->magic);
+ (void)fprintf(stderr, "version %u\n", m->version);
+ (void)fprintf(stderr, "psize %u\n", m->psize);
+ (void)fprintf(stderr, "free %u\n", m->free);
+ (void)fprintf(stderr, "nrecs %u\n", m->nrecs);
+ (void)fprintf(stderr, "flags %u", m->flags);
#undef X
#define X(flag, name) \
if (m->flags & flag) { \
@@ -212,14 +212,15 @@ __bt_dpage(h)
bl = GETBLEAF(h, cur);
if (bl->flags & P_BIGKEY)
(void)fprintf(stderr,
- "big key page %lu size %u/",
+ "big key page %u size %u/",
*(pgno_t *)bl->bytes,
*(u_int32_t *)(bl->bytes + sizeof(pgno_t)));
else if (bl->ksize)
- (void)fprintf(stderr, "%s/", bl->bytes);
+ (void)fprintf(stderr, "%.*s/",
+ bl->ksize, bl->bytes);
if (bl->flags & P_BIGDATA)
(void)fprintf(stderr,
- "big data page %lu size %u",
+ "big data page %u size %u",
*(pgno_t *)(bl->bytes + bl->ksize),
*(u_int32_t *)(bl->bytes + bl->ksize +
sizeof(pgno_t)));
@@ -231,7 +232,7 @@ __bt_dpage(h)
rl = GETRLEAF(h, cur);
if (rl->flags & P_BIGDATA)
(void)fprintf(stderr,
- "big data page %lu size %u",
+ "big data page %u size %u",
*(pgno_t *)rl->bytes,
*(u_int32_t *)(rl->bytes + sizeof(pgno_t)));
else if (rl->dsize)
@@ -304,13 +305,13 @@ __bt_stat(dbp)
(void)fprintf(stderr, "%d level%s with %ld keys",
levels, levels == 1 ? "" : "s", nkeys);
if (F_ISSET(t, R_RECNO))
- (void)fprintf(stderr, " (%ld header count)", t->bt_nrecs);
+ (void)fprintf(stderr, " (%d header count)", t->bt_nrecs);
(void)fprintf(stderr,
- "\n%lu pages (leaf %ld, internal %ld, overflow %ld)\n",
+ "\n%u pages (leaf %d, internal %d, overflow %d)\n",
pinternal + pleaf + pcont, pleaf, pinternal, pcont);
(void)fprintf(stderr, "%ld cache hits, %ld cache misses\n",
bt_cache_hit, bt_cache_miss);
- (void)fprintf(stderr, "%ld splits (%ld root splits, %ld sort splits)\n",
+ (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)
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index d29d7d0..4dd1267 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -220,7 +220,7 @@ __hash_open(file, flags, mode, info, dflags)
#ifdef DEBUG
(void)fprintf(stderr,
-"%s\n%s%x\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%x\n%s%x\n%s%d\n%s%d\n",
+"%s\n%s%p\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%x\n%s%x\n%s%d\n%s%d\n",
"init_htab:",
"TABLE POINTER ", hashp,
"BUCKET SIZE ", hashp->BSIZE,
diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c
index e3af051..e1c503f 100644
--- a/lib/libc/db/mpool/mpool.c
+++ b/lib/libc/db/mpool/mpool.c
@@ -426,9 +426,9 @@ mpool_stat(mp)
int cnt;
char *sep;
- (void)fprintf(stderr, "%lu pages in the file\n", mp->npages);
+ (void)fprintf(stderr, "%u pages in the file\n", mp->npages);
(void)fprintf(stderr,
- "page size %lu, cacheing %lu pages of %lu page max cache\n",
+ "page size %lu, cacheing %u pages of %u 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);
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index da0c179..b2ba497 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -186,7 +186,7 @@ _mcleanup()
_warn("_mcleanup: gmon.log");
return;
}
- len = sprintf(buf, "[mcleanup1] kcount 0x%x ssiz %d\n",
+ len = sprintf(buf, "[mcleanup1] kcount 0x%p ssiz %lu\n",
p->kcount, p->kcountsize);
_write(log, buf, len);
#endif
@@ -210,7 +210,7 @@ _mcleanup()
toindex = p->tos[toindex].link) {
#ifdef DEBUG
len = sprintf(buf,
- "[mcleanup2] frompc 0x%x selfpc 0x%x count %d\n" ,
+ "[mcleanup2] frompc 0x%lx selfpc 0x%lx count %lu\n" ,
frompc, p->tos[toindex].selfpc,
p->tos[toindex].count);
_write(log, buf, len);
OpenPOWER on IntegriCloud