summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bench/wtperf/wtperf.c4
-rw-r--r--dist/s_string.ok1
-rw-r--r--examples/c/ex_async.c2
-rw-r--r--examples/c/ex_config_parse.c4
-rw-r--r--examples/c/ex_extractor.c13
-rw-r--r--examples/c/ex_schema.c32
-rw-r--r--src/block/block_ckpt.c3
-rw-r--r--src/block/block_open.c2
-rw-r--r--src/config/config.c9
-rw-r--r--src/log/log.c23
-rw-r--r--src/lsm/lsm_manager.c6
-rw-r--r--src/lsm/lsm_merge.c10
-rw-r--r--src/lsm/lsm_tree.c8
-rw-r--r--src/lsm/lsm_work_unit.c4
-rw-r--r--src/lsm/lsm_worker.c9
-rw-r--r--src/schema/schema_plan.c12
-rw-r--r--src/session/session_api.c2
-rw-r--r--src/support/huffman.c9
-rw-r--r--src/txn/txn.c2
-rw-r--r--src/txn/txn_recover.c14
-rw-r--r--test/bloom/test_bloom.c8
-rw-r--r--test/checkpoint/test_checkpoint.c2
-rw-r--r--test/cursor_order/cursor_order.c6
-rw-r--r--test/fops/file.c2
-rw-r--r--test/format/wts.c16
-rw-r--r--test/manydbs/manydbs.c3
-rw-r--r--test/recovery/random-abort.c5
-rw-r--r--test/recovery/truncated-log.c7
28 files changed, 123 insertions, 95 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index b04c6ba662d..340c400ba7e 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -1668,7 +1668,7 @@ execute_workload(CONFIG *cfg)
for (threads = cfg->workers, i = 0,
workp = cfg->workload; i < cfg->workload_cnt; ++i, ++workp) {
lprintf(cfg, 0, 1,
- "Starting workload #%d: %" PRId64 " threads, inserts=%"
+ "Starting workload #%u: %" PRId64 " threads, inserts=%"
PRId64 ", reads=%" PRId64 ", updates=%" PRId64
", truncate=%" PRId64 ", throttle=%" PRId64,
i + 1, workp->threads, workp->insert,
@@ -2285,7 +2285,7 @@ main(int argc, char *argv[])
req_len = strlen(",async=(enabled=true,threads=)") + 4;
cfg->async_config = dcalloc(req_len, 1);
snprintf(cfg->async_config, req_len,
- ",async=(enabled=true,threads=%d)",
+ ",async=(enabled=true,threads=%" PRIu32 ")",
cfg->async_threads);
}
if ((ret = config_compress(cfg)) != 0)
diff --git a/dist/s_string.ok b/dist/s_string.ok
index c582f3380bd..44e2442a348 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -994,6 +994,7 @@ t's
tV
tablename
tcbench
+td
testutil
th
tid
diff --git a/examples/c/ex_async.c b/examples/c/ex_async.c
index 584c3e54b87..ecdbd2f4fea 100644
--- a/examples/c/ex_async.c
+++ b/examples/c/ex_async.c
@@ -218,7 +218,7 @@ main(void)
*/
ret = conn->close(conn, NULL);
- printf("Searched for %d keys\n", ex_asynckeys.num_keys);
+ printf("Searched for %" PRIu32 " keys\n", ex_asynckeys.num_keys);
return (ret);
}
diff --git a/examples/c/ex_config_parse.c b/examples/c/ex_config_parse.c
index 124eff21130..caa7ffa8fe0 100644
--- a/examples/c/ex_config_parse.c
+++ b/examples/c/ex_config_parse.c
@@ -99,7 +99,7 @@ main(void)
while ((ret = parser->next(parser, &k, &v)) == 0) {
printf("%.*s:", (int)k.len, k.str);
if (v.type == WT_CONFIG_ITEM_NUM)
- printf("%d\n", (int)v.val);
+ printf("%" PRId64 "\n", v.val);
else
printf("%.*s\n", (int)v.len, v.str);
}
@@ -126,7 +126,7 @@ main(void)
"log.file_max configuration: %s", wiredtiger_strerror(ret));
return (ret);
}
- printf("log file max: %d\n", (int)v.val);
+ printf("log file max: %" PRId64 "\n", v.val);
/*! [nested get] */
ret = parser->close(parser);
diff --git a/examples/c/ex_extractor.c b/examples/c/ex_extractor.c
index fff9c79f8e0..8623f4759fc 100644
--- a/examples/c/ex_extractor.c
+++ b/examples/c/ex_extractor.c
@@ -99,11 +99,13 @@ my_extract(WT_EXTRACTOR *extractor, WT_SESSION *session,
* key(s). WiredTiger will perform the required operation
* (such as a remove()).
*/
- fprintf(stderr, "EXTRACTOR: index op for year %d: %s %s\n",
+ fprintf(stderr,
+ "EXTRACTOR: index op for year %" PRIu16 ": %s %s\n",
year, first_name, last_name);
result_cursor->set_key(result_cursor, year);
if ((ret = result_cursor->insert(result_cursor)) != 0) {
- fprintf(stderr, "EXTRACTOR: op year %d: error %d\n",
+ fprintf(stderr,
+ "EXTRACTOR: op year %" PRIu16 ": error %d\n",
year, ret);
return (ret);
}
@@ -157,7 +159,7 @@ read_index(WT_SESSION *session)
*/
for (i = 0; i < 10 && RET_OK(ret); i++) {
year = (uint16_t)((rand() % YEAR_SPAN) + YEAR_BASE);
- printf("Year %d:\n", year);
+ printf("Year %" PRIu16 ":\n", year);
cursor->set_key(cursor, year);
if ((ret = cursor->search(cursor)) != 0)
break;
@@ -181,7 +183,7 @@ read_index(WT_SESSION *session)
}
}
if (!RET_OK(ret))
- fprintf(stderr, "Error %d for year %d\n", ret, year);
+ fprintf(stderr, "Error %d for year %" PRIu16 "\n", ret, year);
ret = cursor->close(cursor);
return (ret);
@@ -245,7 +247,8 @@ setup_table(WT_SESSION *session)
cursor->set_key(cursor, p.id);
cursor->set_value(cursor,
p.last_name, p.first_name, p.term_start, p.term_end);
- fprintf(stderr, "SETUP: table insert %d-%d: %s %s\n",
+ fprintf(stderr,
+ "SETUP: table insert %" PRIu16 "-%" PRIu16 ": %s %s\n",
p.term_start, p.term_end,
p.first_name, p.last_name);
ret = cursor->insert(cursor);
diff --git a/examples/c/ex_schema.c b/examples/c/ex_schema.c
index f3d3a1b9cb4..70fc7eb2e62 100644
--- a/examples/c/ex_schema.c
+++ b/examples/c/ex_schema.c
@@ -165,7 +165,8 @@ main(void)
ret = cursor->get_key(cursor, &recno);
ret = cursor->get_value(cursor, &country, &year, &population);
printf("ID %" PRIu64, recno);
- printf(": country %s, year %u, population %" PRIu64 "\n",
+ printf(
+ ": country %s, year %" PRIu16 ", population %" PRIu64 "\n",
country, year, population);
}
ret = cursor->close(cursor);
@@ -186,7 +187,8 @@ main(void)
ret = wiredtiger_struct_unpack(session,
value.data, value.size,
"5sHQ", &country, &year, &population);
- printf(": country %s, year %u, population %" PRIu64 "\n",
+ printf(
+ ": country %s, year %" PRIu16 ", population %" PRIu64 "\n",
country, year, population);
}
/*! [List the records in the table using raw mode.] */
@@ -202,7 +204,9 @@ main(void)
cursor->set_key(cursor, 2);
if ((ret = cursor->search(cursor)) == 0) {
ret = cursor->get_value(cursor, &country, &year, &population);
- printf("ID 2: country %s, year %u, population %" PRIu64 "\n",
+ printf(
+ "ID 2: "
+ "country %s, year %" PRIu16 ", population %" PRIu64 "\n",
country, year, population);
}
/*! [Read population from the primary column group] */
@@ -230,8 +234,8 @@ main(void)
cursor->set_key(cursor, "AU\0\0\0");
ret = cursor->search(cursor);
ret = cursor->get_value(cursor, &country, &year, &population);
- printf("AU: country %s, year %u, population %" PRIu64 "\n",
- country, (unsigned int)year, population);
+ printf("AU: country %s, year %" PRIu16 ", population %" PRIu64 "\n",
+ country, year, population);
/*! [Search in a simple index] */
ret = cursor->close(cursor);
@@ -242,8 +246,9 @@ main(void)
cursor->set_key(cursor, "USA\0\0", (uint16_t)1900);
ret = cursor->search(cursor);
ret = cursor->get_value(cursor, &country, &year, &population);
- printf("US 1900: country %s, year %u, population %" PRIu64 "\n",
- country, (unsigned int)year, population);
+ printf(
+ "US 1900: country %s, year %" PRIu16 ", population %" PRIu64 "\n",
+ country, year, population);
/*! [Search in a composite index] */
ret = cursor->close(cursor);
@@ -256,7 +261,7 @@ main(void)
"table:poptable(country,year)", NULL, NULL, &cursor);
while ((ret = cursor->next(cursor)) == 0) {
ret = cursor->get_value(cursor, &country, &year);
- printf("country %s, year %u\n", country, year);
+ printf("country %s, year %" PRIu16 "\n", country, year);
}
/*! [Return a subset of values from the table] */
ret = cursor->close(cursor);
@@ -274,7 +279,7 @@ main(void)
ret = cursor->get_value(cursor, &value);
ret = wiredtiger_struct_unpack(
session, value.data, value.size, "5sH", &country, &year);
- printf("country %s, year %u\n", country, year);
+ printf("country %s, year %" PRIu16 "\n", country, year);
}
/*! [Return a subset of values from the table using raw mode] */
ret = cursor->close(cursor);
@@ -289,7 +294,7 @@ main(void)
while ((ret = cursor->next(cursor)) == 0) {
ret = cursor->get_key(cursor, &country, &year);
ret = cursor->get_value(cursor, &recno);
- printf("row ID %" PRIu64 ": country %s, year %u\n",
+ printf("row ID %" PRIu64 ": country %s, year %" PRIu16 "\n",
recno, country, year);
}
/*! [Return the table's record number key using an index] */
@@ -306,7 +311,7 @@ main(void)
while ((ret = cursor->next(cursor)) == 0) {
ret = cursor->get_key(cursor, &country, &year);
ret = cursor->get_value(cursor, &population);
- printf("population %" PRIu64 ": country %s, year %u\n",
+ printf("population %" PRIu64 ": country %s, year %" PRIu16 "\n",
population, country, year);
}
/*! [Return a subset of the value columns from an index] */
@@ -321,7 +326,7 @@ main(void)
"index:poptable:country_plus_year()", NULL, NULL, &cursor);
while ((ret = cursor->next(cursor)) == 0) {
ret = cursor->get_key(cursor, &country, &year);
- printf("country %s, year %u\n", country, year);
+ printf("country %s, year %" PRIu16 "\n", country, year);
}
/*! [Access only the index] */
ret = cursor->close(cursor);
@@ -351,7 +356,8 @@ main(void)
ret = join_cursor->get_value(join_cursor, &country, &year,
&population);
printf("ID %" PRIu64, recno);
- printf(": country %s, year %u, population %" PRIu64 "\n",
+ printf(
+ ": country %s, year %" PRIu16 ", population %" PRIu64 "\n",
country, year, population);
}
/*! [Join cursors] */
diff --git a/src/block/block_ckpt.c b/src/block/block_ckpt.c
index 03059c8f23a..812bf99acfb 100644
--- a/src/block/block_ckpt.c
+++ b/src/block/block_ckpt.c
@@ -812,8 +812,7 @@ __ckpt_string(WT_SESSION_IMPL *session,
WT_RET(__wt_block_buffer_to_ckpt(session, block, addr, ci));
WT_RET(__wt_buf_fmt(session, buf,
- "version=%d",
- ci->version));
+ "version=%" PRIu8, ci->version));
if (ci->root_offset == WT_BLOCK_INVALID_OFFSET)
WT_RET(__wt_buf_catfmt(session, buf, ", root=[Empty]"));
else
diff --git a/src/block/block_open.c b/src/block/block_open.c
index d9b2f908737..adb745c99e7 100644
--- a/src/block/block_open.c
+++ b/src/block/block_open.c
@@ -369,7 +369,7 @@ __desc_read(WT_SESSION_IMPL *session, WT_BLOCK *block)
WT_ERR_MSG(session, WT_ERROR,
"unsupported WiredTiger file version: this build only "
"supports major/minor versions up to %d/%d, and the file "
- "is version %d/%d",
+ "is version %" PRIu16 "/%" PRIu16,
WT_BLOCK_MAJOR_VERSION, WT_BLOCK_MINOR_VERSION,
desc->majorv, desc->minorv);
diff --git a/src/config/config.c b/src/config/config.c
index f480ab83dbd..9d14353f730 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -15,10 +15,13 @@
static int
__config_err(WT_CONFIG *conf, const char *msg, int err)
{
+ ptrdiff_t d;
+
+ d = conf->cur - conf->orig;
+
WT_RET_MSG(conf->session, err,
- "Error parsing '%.*s' at byte %u: %s",
- (int)(conf->end - conf->orig), conf->orig,
- (u_int)(conf->cur - conf->orig), msg);
+ "Error parsing '%.*s' at offset %td: %s",
+ (int)(conf->end - conf->orig), conf->orig, d, msg);
}
/*
diff --git a/src/log/log.c b/src/log/log.c
index 0b84b5b2b19..0b47308cfd8 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -118,9 +118,9 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
*/
if (log->sync_dir_lsn.l.file < min_lsn->l.file) {
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
- "log_force_sync: sync directory %s to LSN %d/%lu",
- log->log_dir_fh->name,
- min_lsn->l.file, min_lsn->l.offset));
+ "log_force_sync: sync directory %s to LSN %" PRIu32
+ "/%" PRIu32,
+ log->log_dir_fh->name, min_lsn->l.file, min_lsn->l.offset));
WT_ERR(__wt_directory_sync_fh(session, log->log_dir_fh));
log->sync_dir_lsn = *min_lsn;
WT_STAT_FAST_CONN_INCR(session, log_sync_dir);
@@ -130,7 +130,7 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
*/
if (__wt_log_cmp(&log->sync_lsn, min_lsn) < 0) {
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
- "log_force_sync: sync %s to LSN %d/%lu",
+ "log_force_sync: sync %s to LSN %" PRIu32 "/%" PRIu32,
log->log_fh->name, min_lsn->l.file, min_lsn->l.offset));
WT_ERR(__wt_fsync(session, log->log_fh));
log->sync_lsn = *min_lsn;
@@ -697,7 +697,7 @@ __log_openfile(WT_SESSION_IMPL *session,
WT_ERR_MSG(session, WT_ERROR,
"unsupported WiredTiger file version: this build "
" only supports major/minor versions up to %d/%d, "
- " and the file is version %d/%d",
+ " and the file is version %" PRIu16 "/%" PRIu16,
WT_LOG_MAJOR_VERSION, WT_LOG_MINOR_VERSION,
desc->majorv, desc->minorv);
}
@@ -1129,7 +1129,8 @@ __wt_log_open(WT_SESSION_IMPL *session)
}
log->fileid = lastlog;
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
- "log_open: first log %d last log %d", firstlog, lastlog));
+ "log_open: first log %" PRIu32 " last log %" PRIu32,
+ firstlog, lastlog));
if (firstlog == UINT32_MAX) {
WT_ASSERT(session, logcount == 0);
WT_INIT_LSN(&log->first_lsn);
@@ -1395,7 +1396,8 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep)
(log->sync_dir_lsn.l.file < sync_lsn.l.file)) {
WT_ASSERT(session, log->log_dir_fh != NULL);
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
- "log_release: sync directory %s to LSN %u/%lu",
+ "log_release: sync directory %s to LSN %" PRIu32
+ "/%" PRIu32,
log->log_dir_fh->name,
sync_lsn.l.file, sync_lsn.l.offset));
WT_ERR(__wt_directory_sync_fh(
@@ -1410,7 +1412,8 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep)
if (F_ISSET(slot, WT_SLOT_SYNC) &&
__wt_log_cmp(&log->sync_lsn, &slot->slot_end_lsn) < 0) {
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
- "log_release: sync log %s to LSN %u/%lu",
+ "log_release: sync log %s to LSN %" PRIu32
+ "/%" PRIu32,
log->log_fh->name,
sync_lsn.l.file, sync_lsn.l.offset));
WT_STAT_FAST_CONN_INCR(session, log_sync);
@@ -1477,7 +1480,7 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
if (LF_ISSET(WT_LOGSCAN_RECOVER))
WT_RET(__wt_verbose(session, WT_VERB_LOG,
- "__wt_log_scan truncating to %u/%u",
+ "__wt_log_scan truncating to %" PRIu32 "/%" PRIu32,
log->trunc_lsn.l.file, log->trunc_lsn.l.offset));
if (log != NULL) {
@@ -2139,7 +2142,7 @@ __wt_log_flush(WT_SESSION_IMPL *session, uint32_t flags)
WT_RET(__wt_log_flush_lsn(session, &lsn, false));
WT_RET(__wt_verbose(session, WT_VERB_LOG,
- "log_flush: flags %d LSN %u/%lu",
+ "log_flush: flags %#" PRIx32 " LSN %" PRIu32 "/%" PRIu32,
flags, lsn.l.file, lsn.l.offset));
/*
* If the user wants write-no-sync, there is nothing more to do.
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index cf581475d2c..24707abdb5a 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -433,8 +433,10 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session)
session, WT_LSM_WORK_BLOOM, 0, lsm_tree));
WT_ERR(__wt_verbose(session,
WT_VERB_LSM_MANAGER,
- "MGR %s: queue %d mod %d nchunks %d"
- " flags 0x%x aggressive %d pushms %" PRIu64
+ "MGR %s: queue %" PRIu32 " mod %d "
+ "nchunks %" PRIu32
+ " flags %#" PRIx32 " aggressive %" PRIu32
+ " pushms %" PRIu64
" fillms %" PRIu64,
lsm_tree->name, lsm_tree->queue_ref,
lsm_tree->modified, lsm_tree->nchunks,
diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c
index 29325066da7..f7176067f19 100644
--- a/src/lsm/lsm_merge.c
+++ b/src/lsm/lsm_merge.c
@@ -60,7 +60,7 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
{
struct timespec now;
uint64_t msec_since_last_merge, msec_to_create_merge;
- u_int new_aggressive;
+ uint32_t new_aggressive;
new_aggressive = 0;
@@ -124,8 +124,9 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
if (new_aggressive > lsm_tree->merge_aggressiveness) {
WT_RET(__wt_verbose(session, WT_VERB_LSM,
- "LSM merge %s got aggressive (old %u new %u), "
- "merge_min %d, %u / %" PRIu64,
+ "LSM merge %s got aggressive "
+ "(old %" PRIu32 " new %" PRIu32 "), "
+ "merge_min %u, %" PRIu64 " / %" PRIu64,
lsm_tree->name, lsm_tree->merge_aggressiveness,
new_aggressive, lsm_tree->merge_min,
msec_since_last_merge, lsm_tree->chunk_fill_ms));
@@ -410,7 +411,8 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id)
start_chunk, end_chunk, dest_id, record_count, generation));
for (verb = start_chunk; verb <= end_chunk; verb++)
WT_ERR(__wt_verbose(session, WT_VERB_LSM,
- "Merging %s: Chunk[%u] id %u, gen: %" PRIu32
+ "Merging %s: Chunk[%u] id %" PRIu32
+ ", gen: %" PRIu32
", size: %" PRIu64 ", records: %" PRIu64,
lsm_tree->name, verb, lsm_tree->chunk[verb]->id,
lsm_tree->chunk[verb]->generation,
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index 7c188bf3dc7..91339501663 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -1314,8 +1314,8 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
if (chunk != NULL) {
WT_ERR(__wt_verbose(session, WT_VERB_LSM,
"Compact force flush %s flags 0x%" PRIx32
- " chunk %u flags 0x%"
- PRIx32, name, lsm_tree->flags, chunk->id, chunk->flags));
+ " chunk %" PRIu32 " flags 0x%" PRIx32,
+ name, lsm_tree->flags, chunk->id, chunk->flags));
flushing = true;
/*
* Make sure the in-memory chunk gets flushed do not push a
@@ -1348,7 +1348,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) {
WT_ERR(__wt_verbose(session,
WT_VERB_LSM,
- "Compact flush done %s chunk %u. "
+ "Compact flush done %s chunk %" PRIu32 ". "
"Start compacting progress %" PRIu64,
name, chunk->id,
lsm_tree->merge_progressing));
@@ -1359,7 +1359,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
progress = lsm_tree->merge_progressing;
} else {
WT_ERR(__wt_verbose(session, WT_VERB_LSM,
- "Compact flush retry %s chunk %u",
+ "Compact flush retry %s chunk %" PRIu32,
name, chunk->id));
WT_ERR(__wt_lsm_manager_push_entry(session,
WT_LSM_WORK_FLUSH, WT_LSM_WORK_FORCE,
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c
index 7723818f607..88054f86d65 100644
--- a/src/lsm/lsm_work_unit.c
+++ b/src/lsm/lsm_work_unit.c
@@ -72,7 +72,7 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session,
{
WT_DECL_RET;
WT_LSM_CHUNK *chunk, *evict_chunk, *flush_chunk;
- u_int i;
+ uint32_t i;
*chunkp = NULL;
chunk = evict_chunk = flush_chunk = NULL;
@@ -118,7 +118,7 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session,
if (chunk != NULL) {
WT_ERR(__wt_verbose(session, WT_VERB_LSM,
- "Flush%s: return chunk %u of %u: %s",
+ "Flush%s: return chunk %" PRIu32 " of %" PRIu32 ": %s",
force ? " w/ force" : "",
i, lsm_tree->nchunks, chunk->uri));
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index 7562cb1cae3..b8a85e4a5e5 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -20,7 +20,7 @@ int
__wt_lsm_worker_start(WT_SESSION_IMPL *session, WT_LSM_WORKER_ARGS *args)
{
WT_RET(__wt_verbose(session, WT_VERB_LSM_MANAGER,
- "Start LSM worker %d type 0x%x", args->id, args->type));
+ "Start LSM worker %u type %#" PRIx32, args->id, args->type));
return (__wt_thread_create(session, &args->tid, __lsm_worker, args));
}
@@ -59,9 +59,8 @@ __lsm_worker_general_op(
*/
if (chunk != NULL) {
WT_ERR(__wt_verbose(session, WT_VERB_LSM,
- "Flush%s chunk %d %s",
- force ? " w/ force" : "",
- chunk->id, chunk->uri));
+ "Flush%s chunk %" PRIu32 " %s",
+ force ? " w/ force" : "", chunk->id, chunk->uri));
ret = __wt_lsm_checkpoint_chunk(
session, entry->lsm_tree, chunk);
WT_ASSERT(session, chunk->refcnt > 0);
@@ -164,7 +163,7 @@ __lsm_worker(void *arg)
if (ret != 0) {
err: __wt_lsm_manager_free_work_unit(session, entry);
WT_PANIC_MSG(session, ret,
- "Error in LSM worker thread %d", cookie->id);
+ "Error in LSM worker thread %u", cookie->id);
}
return (WT_THREAD_RET_VALUE);
}
diff --git a/src/schema/schema_plan.c b/src/schema/schema_plan.c
index 612a2d2d192..12a1aa9c22f 100644
--- a/src/schema/schema_plan.c
+++ b/src/schema/schema_plan.c
@@ -212,7 +212,7 @@ __wt_struct_plan(WT_SESSION_IMPL *session, WT_TABLE *table,
WT_ASSERT(session, !value_only ||
coltype == WT_PROJ_VALUE);
WT_RET(__wt_buf_catfmt(
- session, plan, "%d%c", cg, coltype));
+ session, plan, "%u%c", cg, coltype));
/*
* Set the current column group and column
@@ -226,7 +226,7 @@ __wt_struct_plan(WT_SESSION_IMPL *session, WT_TABLE *table,
if (current_col < col) {
if (col - current_col > 1)
WT_RET(__wt_buf_catfmt(session,
- plan, "%d", col - current_col));
+ plan, "%u", col - current_col));
WT_RET(__wt_buf_catfmt(session,
plan, "%c", WT_PROJ_SKIP));
}
@@ -375,8 +375,8 @@ __wt_struct_reformat(WT_SESSION_IMPL *session, WT_TABLE *table,
pv.type = 'u';
if (pv.havesize)
- WT_RET(__wt_buf_catfmt(
- session, format, "%d%c", (int)pv.size, pv.type));
+ WT_RET(__wt_buf_catfmt(session,
+ format, "%" PRIu32 "%c", pv.size, pv.type));
else
WT_RET(__wt_buf_catfmt(session, format, "%c", pv.type));
} while (have_next);
@@ -399,8 +399,8 @@ __wt_struct_truncate(WT_SESSION_IMPL *session,
while (ncols-- > 0) {
WT_RET(__pack_next(&pack, &pv));
if (pv.havesize)
- WT_RET(__wt_buf_catfmt(
- session, format, "%d%c", (int)pv.size, pv.type));
+ WT_RET(__wt_buf_catfmt(session,
+ format, "%" PRIu32 "%c", pv.size, pv.type));
else
WT_RET(__wt_buf_catfmt(session, format, "%c", pv.type));
}
diff --git a/src/session/session_api.c b/src/session/session_api.c
index 3153ca458eb..a03fa586a9a 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -1598,7 +1598,7 @@ __open_session(WT_CONNECTION_IMPL *conn,
if (i == conn->session_size)
WT_ERR_MSG(session, ENOMEM,
"only configured to support %" PRIu32 " sessions"
- " (including %d additional internal sessions)",
+ " (including %" PRIu32 " additional internal sessions)",
conn->session_size, WT_EXTRA_INTERNAL_SESSIONS);
/*
diff --git a/src/support/huffman.c b/src/support/huffman.c
index edd0bc9f648..1e1aaeab5b5 100644
--- a/src/support/huffman.c
+++ b/src/support/huffman.c
@@ -492,11 +492,12 @@ __wt_huffman_open(WT_SESSION_IMPL *session,
uint8_t symbol;
uint32_t weighted_length;
- printf("leaf depth %" PRIu16 "..%" PRIu16 ", memory use: "
- "codes %u# * %uB + code2symbol %u# * %uB\n",
+ printf("leaf depth %" PRIu16 "..%" PRIu16
+ ", memory use: codes %u# * %" WT_SIZET_FMT
+ "B + code2symbol %u# * %" WT_SIZET_FMT "B\n",
huffman->min_depth, huffman->max_depth,
- huffman->numSymbols, (u_int)sizeof(WT_HUFFMAN_CODE),
- 1U << huffman->max_depth, (u_int)sizeof(uint16_t));
+ huffman->numSymbols, sizeof(WT_HUFFMAN_CODE),
+ 1U << huffman->max_depth, sizeof(uint16_t));
/*
* measure quality of computed Huffman codes, for different max bit
diff --git a/src/txn/txn.c b/src/txn/txn.c
index e8fd8c0c119..7a768a8fe20 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -344,7 +344,7 @@ retry:
current_id - oldest_id > 10000 && oldest_session != NULL) {
(void)__wt_verbose(session, WT_VERB_TRANSACTION,
"old snapshot %" PRIu64
- " pinned in session %d [%s]"
+ " pinned in session %" PRIu32 " [%s]"
" with snap_min %" PRIu64 "\n",
oldest_id, oldest_session->id,
oldest_session->lastop,
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c
index f41691bbc3b..1ea4dba1152 100644
--- a/src/txn/txn_recover.c
+++ b/src/txn/txn_recover.c
@@ -88,11 +88,11 @@ __recovery_cursor(WT_SESSION_IMPL *session, WT_RECOVERY *r,
* Helper to a cursor if this operation is to be applied during recovery.
*/
#define GET_RECOVERY_CURSOR(session, r, lsnp, fileid, cp) \
- WT_ERR(__recovery_cursor( \
- (session), (r), (lsnp), (fileid), false, (cp))); \
- WT_ERR(__wt_verbose((session), WT_VERB_RECOVERY, \
- "%s op %d to file %d at LSN %u/%u", \
- (cursor == NULL) ? "Skipping" : "Applying", \
+ WT_ERR(__recovery_cursor(session, r, lsnp, fileid, false, cp)); \
+ WT_ERR(__wt_verbose(session, WT_VERB_RECOVERY, \
+ "%s op %" PRIu32 " to file %" PRIu32 " at LSN %" PRIu32 \
+ "/%" PRIu32, \
+ cursor == NULL ? "Skipping" : "Applying", \
optype, fileid, lsnp->l.file, lsnp->l.offset)); \
if (cursor == NULL) \
break
@@ -334,7 +334,7 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config)
r->files[fileid].ckpt_lsn = lsn;
WT_RET(__wt_verbose(r->session, WT_VERB_RECOVERY,
- "Recovering %s with id %u @ (%" PRIu32 ", %" PRIu32 ")",
+ "Recovering %s with id %" PRIu32 " @ (%" PRIu32 ", %" PRIu32 ")",
uri, fileid, lsn.l.file, lsn.l.offset));
return (0);
@@ -496,7 +496,7 @@ __wt_txn_recover(WT_SESSION_IMPL *session)
*/
r.metadata_only = false;
WT_ERR(__wt_verbose(session, WT_VERB_RECOVERY,
- "Main recovery loop: starting at %u/%u",
+ "Main recovery loop: starting at %" PRIu32 "/%" PRIu32,
r.ckpt_lsn.l.file, r.ckpt_lsn.l.offset));
WT_ERR(__wt_log_needs_recovery(session, &r.ckpt_lsn, &needs_rec));
/*
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c
index 183dc3d2d42..f95bc7faaf9 100644
--- a/test/bloom/test_bloom.c
+++ b/test/bloom/test_bloom.c
@@ -160,7 +160,7 @@ run(void)
for (i = 0; i < g.c_ops; i++) {
item.data = g.entries[i];
if ((ret = __wt_bloom_insert(bloomp, &item)) != 0)
- testutil_die(ret, "__wt_bloom_insert: %d", i);
+ testutil_die(ret, "__wt_bloom_insert: %" PRIu32, i);
}
testutil_check(__wt_bloom_finalize(bloomp));
@@ -168,7 +168,8 @@ run(void)
for (i = 0; i < g.c_ops; i++) {
item.data = g.entries[i];
if ((ret = __wt_bloom_get(bloomp, &item)) != 0) {
- fprintf(stderr, "get failed at record: %d\n", i);
+ fprintf(stderr,
+ "get failed at record: %" PRIu32 "\n", i);
testutil_die(ret, "__wt_bloom_get");
}
}
@@ -201,7 +202,8 @@ run(void)
testutil_die(ret, "__wt_bloom_get");
}
free((void *)item.data);
- printf("Out of %d ops, got %d false positives, %.4f%%\n",
+ printf(
+ "Out of %" PRIu32 " ops, got %" PRIu32 " false positives, %.4f%%\n",
g.c_ops, fp, 100.0 * fp/g.c_ops);
testutil_check(__wt_bloom_drop(bloomp, NULL));
}
diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c
index 0f28a86b675..c5524b3c63e 100644
--- a/test/checkpoint/test_checkpoint.c
+++ b/test/checkpoint/test_checkpoint.c
@@ -136,7 +136,7 @@ main(int argc, char *argv[])
printf("%s: process %" PRIu64 "\n", g.progname, (uint64_t)getpid());
for (cnt = 1; (runs == 0 || cnt <= runs) && g.status == 0; ++cnt) {
- printf(" %d: %u workers, %u tables\n",
+ printf(" %d: %d workers, %d tables\n",
cnt, g.nworkers, g.ntables);
(void)cleanup(); /* Clean up previous runs */
diff --git a/test/cursor_order/cursor_order.c b/test/cursor_order/cursor_order.c
index 68d2f092c60..d8cfc0c1421 100644
--- a/test/cursor_order/cursor_order.c
+++ b/test/cursor_order/cursor_order.c
@@ -154,8 +154,10 @@ main(int argc, char *argv[])
printf("%s: process %" PRIu64 "\n", progname, (uint64_t)getpid());
for (cnt = 1; runs == 0 || cnt <= runs; ++cnt) {
- printf(" %d: %u reverse scanners, %u writers\n", cnt,
- (int)cfg->reverse_scanners, (int)cfg->append_inserters);
+ printf(
+ " %d: %" PRIu64
+ " reverse scanners, %" PRIu64 " writers\n",
+ cnt, cfg->reverse_scanners, cfg->append_inserters);
shutdown(); /* Clean up previous runs */
diff --git a/test/fops/file.c b/test/fops/file.c
index 4cd92e7b590..ea15f1ee80d 100644
--- a/test/fops/file.c
+++ b/test/fops/file.c
@@ -147,7 +147,7 @@ obj_create_unique(int force)
/* Generate a unique object name. */
if ((ret = pthread_rwlock_wrlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_wrlock single");
- (void)snprintf(new_uri, sizeof(new_uri), "%s.%d", uri, ++uid);
+ (void)snprintf(new_uri, sizeof(new_uri), "%s.%u", uri, ++uid);
if ((ret = pthread_rwlock_unlock(&single)) != 0)
testutil_die(ret, "pthread_rwlock_unlock single");
diff --git a/test/format/wts.c b/test/format/wts.c
index a0e57dc2bee..81e484296e2 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -53,7 +53,8 @@ compressor(uint32_t compress_flag)
default:
break;
}
- testutil_die(EINVAL, "illegal compression flag: 0x%x", compress_flag);
+ testutil_die(EINVAL,
+ "illegal compression flag: %#" PRIx32, compress_flag);
}
/*
@@ -71,7 +72,8 @@ encryptor(uint32_t encrypt_flag)
default:
break;
}
- testutil_die(EINVAL, "illegal encryption flag: 0x%x", encrypt_flag);
+ testutil_die(EINVAL,
+ "illegal encryption flag: %#" PRIx32, encrypt_flag);
}
static int
@@ -313,7 +315,7 @@ wts_create(void)
p += snprintf(p, REMAIN(p, end),
"key_format=%s,"
"allocation_size=512,%s"
- "internal_page_max=%d,leaf_page_max=%d",
+ "internal_page_max=%" PRIu32 ",leaf_page_max=%" PRIu32,
(g.type == ROW) ? "u" : "r",
g.c_firstfit ? "block_allocation=first," : "",
maxintlpage, maxleafpage);
@@ -325,15 +327,15 @@ wts_create(void)
maxintlkey = mmrand(NULL, maxintlpage / 50, maxintlpage / 40);
if (maxintlkey > 20)
p += snprintf(p, REMAIN(p, end),
- ",internal_key_max=%d", maxintlkey);
+ ",internal_key_max=%" PRIu32, maxintlkey);
maxleafkey = mmrand(NULL, maxleafpage / 50, maxleafpage / 40);
if (maxleafkey > 20)
p += snprintf(p, REMAIN(p, end),
- ",leaf_key_max=%d", maxleafkey);
+ ",leaf_key_max=%" PRIu32, maxleafkey);
maxleafvalue = mmrand(NULL, maxleafpage * 10, maxleafpage / 40);
if (maxleafvalue > 40 && maxleafvalue < 100 * 1024)
p += snprintf(p, REMAIN(p, end),
- ",leaf_value_max=%d", maxleafvalue);
+ ",leaf_value_max=%" PRIu32, maxleafvalue);
switch (g.type) {
case FIX:
@@ -361,7 +363,7 @@ wts_create(void)
",huffman_value=english");
if (g.c_dictionary)
p += snprintf(p, REMAIN(p, end),
- ",dictionary=%d", mmrand(NULL, 123, 517));
+ ",dictionary=%" PRIu32, mmrand(NULL, 123, 517));
break;
}
diff --git a/test/manydbs/manydbs.c b/test/manydbs/manydbs.c
index 5ca0bcbbb5f..80d4be2ca3d 100644
--- a/test/manydbs/manydbs.c
+++ b/test/manydbs/manydbs.c
@@ -101,7 +101,8 @@ run_ops(int dbs)
*/
if (session == NULL) {
__wt_random_init(&rnd);
- if ((session = calloc((size_t)dbs, sizeof(WT_SESSION *))) == NULL)
+ if ((session =
+ calloc((size_t)dbs, sizeof(WT_SESSION *))) == NULL)
testutil_die(ENOMEM, "session array malloc");
if ((cursor = calloc((size_t)dbs, sizeof(WT_CURSOR *))) == NULL)
testutil_die(ENOMEM, "cursor array malloc");
diff --git a/test/recovery/random-abort.c b/test/recovery/random-abort.c
index c9cc10d2db3..f9c3ed28814 100644
--- a/test/recovery/random-abort.c
+++ b/test/recovery/random-abort.c
@@ -249,9 +249,10 @@ main(int argc, char *argv[])
if ((ret = conn->close(conn, NULL)) != 0)
testutil_die(ret, "WT_CONNECTION:close");
if (absent) {
- printf("%u record(s) absent from %u\n", absent, count);
+ printf("%" PRIu32 " record(s) absent from %" PRIu32 "\n",
+ absent, count);
return (EXIT_FAILURE);
}
- printf("%u records verified\n", count);
+ printf("%" PRIu32 " records verified\n", count);
return (EXIT_SUCCESS);
}
diff --git a/test/recovery/truncated-log.c b/test/recovery/truncated-log.c
index 23269e99d35..24e05b5482b 100644
--- a/test/recovery/truncated-log.c
+++ b/test/recovery/truncated-log.c
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
* the middle of that last record (i.e. ahead of that offset).
*/
new_offset = offset + V_SIZE;
- printf("Parent: Truncate to %u\n", (uint32_t)new_offset);
+ printf("Parent: Truncate to %" PRIu64 "\n", new_offset);
if ((ret = truncate(LOG_FILE_1, (wt_off_t)new_offset)) != 0)
testutil_die(errno, "truncate");
@@ -267,9 +267,10 @@ main(int argc, char *argv[])
if ((ret = conn->close(conn, NULL)) != 0)
testutil_die(ret, "WT_CONNECTION:close");
if (count > max_key) {
- printf("expected %u records found %u\n", max_key, count);
+ printf("expected %" PRIu32 " records found %" PRIu32 "\n",
+ max_key, count);
return (EXIT_FAILURE);
}
- printf("%u records verified\n", count);
+ printf("%" PRIu32 " records verified\n", count);
return (EXIT_SUCCESS);
}