mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 22:34:12 +08:00
mdbx: fix PRIuPTR/PRIu64 for 32-bit builds.
Change-Id: Ic6462666de666840bc77e0e50fd0d8cd36a125b7
This commit is contained in:
parent
2d5cba61ed
commit
06cb8b45b2
@ -267,7 +267,7 @@ static int pgvisitor(uint64_t pgno, unsigned pgnumber, void *ctx, int deep,
|
|||||||
else
|
else
|
||||||
problem_add("deep", deep, "unknown area", "%s", dbi_name);
|
problem_add("deep", deep, "unknown area", "%s", dbi_name);
|
||||||
|
|
||||||
const uint64_t page_bytes = payload_bytes + header_bytes + unused_bytes;
|
const size_t page_bytes = payload_bytes + header_bytes + unused_bytes;
|
||||||
walk.pgcount += pgnumber;
|
walk.pgcount += pgnumber;
|
||||||
|
|
||||||
const char *pagetype_caption;
|
const char *pagetype_caption;
|
||||||
@ -351,7 +351,7 @@ static int pgvisitor(uint64_t pgno, unsigned pgnumber, void *ctx, int deep,
|
|||||||
if (pgnumber) {
|
if (pgnumber) {
|
||||||
if (page_bytes != page_size) {
|
if (page_bytes != page_size) {
|
||||||
problem_add("page", pgno, "misused",
|
problem_add("page", pgno, "misused",
|
||||||
"%s-page: %" PRIu64 " != %" PRIu64 " (%" PRIuPTR
|
"%s-page: %" PRIuPTR " != %" PRIuPTR " (%" PRIuPTR
|
||||||
"h + %" PRIuPTR "p + %" PRIuPTR "u)",
|
"h + %" PRIuPTR "p + %" PRIuPTR "u)",
|
||||||
pagetype_caption, page_size, page_bytes, header_bytes,
|
pagetype_caption, page_size, page_bytes, header_bytes,
|
||||||
payload_bytes, unused_bytes);
|
payload_bytes, unused_bytes);
|
||||||
@ -689,7 +689,7 @@ static int process_db(MDBX_dbi dbi_handle, char *dbi_name, visitor *handler,
|
|||||||
|
|
||||||
if (record_count != ms.ms_entries)
|
if (record_count != ms.ms_entries)
|
||||||
problem_add("entry", record_count, "differentent number of entries",
|
problem_add("entry", record_count, "differentent number of entries",
|
||||||
"%" PRIuPTR " != %" PRIuPTR, record_count, ms.ms_entries);
|
"%" PRIu64 " != %" PRIu64, record_count, ms.ms_entries);
|
||||||
bailout:
|
bailout:
|
||||||
problems_count = problems_pop(saved_list);
|
problems_count = problems_pop(saved_list);
|
||||||
if (!silent && verbose) {
|
if (!silent && verbose) {
|
||||||
@ -1088,7 +1088,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (!dont_traversal) {
|
if (!dont_traversal) {
|
||||||
struct problem *saved_list;
|
struct problem *saved_list;
|
||||||
uint64_t traversal_problems;
|
size_t traversal_problems;
|
||||||
uint64_t empty_pages, lost_bytes;
|
uint64_t empty_pages, lost_bytes;
|
||||||
|
|
||||||
print("Traversal b-tree by txn#%" PRIaTXN "...\n", txn->mt_txnid);
|
print("Traversal b-tree by txn#%" PRIaTXN "...\n", txn->mt_txnid);
|
||||||
@ -1181,9 +1181,9 @@ int main(int argc, char *argv[]) {
|
|||||||
print(" - summary: average fill %.1f%%",
|
print(" - summary: average fill %.1f%%",
|
||||||
walk.total_payload_bytes * 100.0 / total_page_bytes);
|
walk.total_payload_bytes * 100.0 / total_page_bytes);
|
||||||
if (empty_pages)
|
if (empty_pages)
|
||||||
print(", %" PRIuPTR " empty pages", empty_pages);
|
print(", %" PRIu64 " empty pages", empty_pages);
|
||||||
if (lost_bytes)
|
if (lost_bytes)
|
||||||
print(", %" PRIuPTR " bytes lost", lost_bytes);
|
print(", %" PRIu64 " bytes lost", lost_bytes);
|
||||||
print(", %" PRIuPTR " problems\n", traversal_problems);
|
print(", %" PRIuPTR " problems\n", traversal_problems);
|
||||||
}
|
}
|
||||||
} else if (verbose) {
|
} else if (verbose) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user