From 20022658befa29e3e66f79560572f56fc44b59f7 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Mon, 27 Aug 2018 11:05:09 +0300 Subject: [PATCH] mdbx-tools: remove "" from printf-strings. --- src/tools/mdbx_chk.c | 24 ++++++++++++------------ src/tools/mdbx_load.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/tools/mdbx_chk.c b/src/tools/mdbx_chk.c index 8fec23e3..36c2308f 100644 --- a/src/tools/mdbx_chk.c +++ b/src/tools/mdbx_chk.c @@ -263,8 +263,8 @@ static int pgvisitor(uint64_t pgno, unsigned pgnumber, void *ctx, if (header_bytes < (int)sizeof(long) || (size_t)header_bytes >= envstat.ms_psize - sizeof(long)) problem_add("page", pgno, "illegal header-length", - "%" PRIuPTR " < %i < %" PRIuPTR "", sizeof(long), - header_bytes, envstat.ms_psize - sizeof(long)); + "%" PRIuPTR " < %i < %" PRIuPTR, sizeof(long), header_bytes, + envstat.ms_psize - sizeof(long)); if (payload_bytes < 1) { if (nentries > 1) { problem_add("page", pgno, "zero size-of-entry", @@ -294,8 +294,8 @@ static int pgvisitor(uint64_t pgno, unsigned pgnumber, void *ctx, if (pgnumber) { do { if (pgno >= lastpgno) - problem_add("page", pgno, "wrong page-no", - "%" PRIu64 " > %" PRIu64 "", pgno, lastpgno); + problem_add("page", pgno, "wrong page-no", "%" PRIu64 " > %" PRIu64, + pgno, lastpgno); else if (walk.pagemap[pgno]) problem_add("page", pgno, "already used", "in %s", walk.dbi_names[walk.pagemap[pgno]]); @@ -331,17 +331,17 @@ static int handle_freedb(const uint64_t record_number, const MDBX_val *key, if (key->iov_len != sizeof(txnid_t)) problem_add("entry", record_number, "wrong txn-id size", - "key-size %" PRIiPTR "", key->iov_len); + "key-size %" PRIiPTR, key->iov_len); else if (txnid < 1 || txnid > envinfo.mi_recent_txnid) - problem_add("entry", record_number, "wrong txn-id", "%" PRIaTXN "", txnid); + problem_add("entry", record_number, "wrong txn-id", "%" PRIaTXN, txnid); if (data->iov_len < sizeof(pgno_t) || data->iov_len % sizeof(pgno_t)) - problem_add("entry", record_number, "wrong idl size", "%" PRIuPTR "", + problem_add("entry", record_number, "wrong idl size", "%" PRIuPTR, data->iov_len); else { const pgno_t number = *iptr++; if (number < 1 || number > MDBX_LIST_MAX) - problem_add("entry", record_number, "wrong idl length", "%" PRIiPTR "", + problem_add("entry", record_number, "wrong idl length", "%" PRIiPTR, number); else if ((number + 1) * sizeof(pgno_t) > data->iov_len) problem_add("entry", record_number, "trimmed idl", @@ -363,12 +363,12 @@ static int handle_freedb(const uint64_t record_number, const MDBX_val *key, const pgno_t pg = iptr[i]; if (pg < NUM_METAS || pg > envinfo.mi_last_pgno) problem_add("entry", record_number, "wrong idl entry", - "%u < %" PRIaPGNO " < %" PRIu64 "", NUM_METAS, pg, + "%u < %" PRIaPGNO " < %" PRIu64, NUM_METAS, pg, envinfo.mi_last_pgno); else if (MDBX_PNL_DISORDERED(prev, pg)) { bad = " [bad sequence]"; problem_add("entry", record_number, "bad sequence", - "%" PRIaPGNO " <> %" PRIaPGNO "", prev, pg); + "%" PRIaPGNO " <> %" PRIaPGNO, prev, pg); } prev = pg; while (i + span < number && @@ -535,7 +535,7 @@ static int process_db(MDBX_dbi dbi, char *name, visitor *handler, bool silent) { if (prev_key.iov_base) { if ((flags & MDBX_DUPFIXED) && prev_data.iov_len != data.iov_len) { problem_add("entry", record_count, "different data length", - "%" PRIuPTR " != %" PRIuPTR "", prev_data.iov_len, + "%" PRIuPTR " != %" PRIuPTR, prev_data.iov_len, data.iov_len); } @@ -581,7 +581,7 @@ static int process_db(MDBX_dbi dbi, char *name, visitor *handler, bool silent) { if (record_count != ms.ms_entries) problem_add("entry", record_count, "differentent number of entries", - "%" PRIuPTR " != %" PRIuPTR "", record_count, ms.ms_entries); + "%" PRIuPTR " != %" PRIuPTR, record_count, ms.ms_entries); bailout: problems_count = problems_pop(saved_list); if (!silent && verbose) { diff --git a/src/tools/mdbx_load.c b/src/tools/mdbx_load.c index 4a337a1a..a18b50c4 100644 --- a/src/tools/mdbx_load.c +++ b/src/tools/mdbx_load.c @@ -136,7 +136,7 @@ static void readhdr(void) { ptr = memchr(dbuf.iov_base, '\n', dbuf.iov_len); if (ptr) *ptr = '\0'; - i = sscanf((char *)dbuf.iov_base + STRLENOF("mapsize="), "%" PRIu64 "", + i = sscanf((char *)dbuf.iov_base + STRLENOF("mapsize="), "%" PRIu64, &envinfo.mi_mapsize); if (i != 1) { fprintf(stderr, "%s: line %" PRIiSIZE ": invalid mapsize %s\n", prog,