-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
warnings fix #308
base: master
Are you sure you want to change the base?
warnings fix #308
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -390,7 +390,7 @@ static fdb_err_t read_kv(fdb_kvdb_t db, fdb_kv_t kv) | |||||
/* try read the KV name, maybe read name has error */ | ||||||
kv_name_addr = kv->addr.start + KV_HDR_DATA_SIZE; | ||||||
_fdb_flash_read((fdb_db_t)db, kv_name_addr, (uint32_t *)kv->name, FDB_WG_ALIGN(name_len)); | ||||||
FDB_INFO("Error: Read the KV (%.*s@0x%08" PRIX32 ") CRC32 check failed!\n", name_len, kv->name, kv->addr.start); | ||||||
FDB_INFO("Error: Read the KV (%.*s@0x%08" PRIX32 ") CRC32 check failed!\n", (int)name_len, kv->name, kv->addr.start); | ||||||
} else { | ||||||
kv->crc_is_ok = true; | ||||||
/* the name is behind aligned KV header */ | ||||||
|
@@ -1076,7 +1076,7 @@ static uint32_t new_kv(fdb_kvdb_t db, kv_sec_info_t sector, size_t kv_size) | |||||
already_gc = true; | ||||||
goto __retry; | ||||||
} else if (already_gc) { | ||||||
FDB_INFO("Error: Alloc an KV (size %" PRIuLEAST16 ") failed after GC. KV full.\n", kv_size); | ||||||
FDB_INFO("Error: Alloc an KV (size %" PRIuPTR ") failed after GC. KV full.\n", (uintptr_t)kv_size); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Is it possible to modify it like this? |
||||||
db->gc_request = false; | ||||||
} | ||||||
} | ||||||
|
@@ -1505,8 +1505,8 @@ void fdb_kv_print(fdb_kvdb_t db) | |||||
kv_iterator(db, &kv, &using_size, db, print_kv_cb); | ||||||
|
||||||
FDB_PRINT("\nmode: next generation\n"); | ||||||
FDB_PRINT("size: %" PRIu32 "/%" PRIu32 " bytes.\n", (uint32_t)using_size + ((SECTOR_NUM - FDB_GC_EMPTY_SEC_THRESHOLD) * SECTOR_HDR_DATA_SIZE), | ||||||
db_max_size(db) - db_sec_size(db) * FDB_GC_EMPTY_SEC_THRESHOLD); | ||||||
FDB_PRINT("size: %lu/%lu bytes.\n", (unsigned long)((uint32_t)using_size + ((SECTOR_NUM - FDB_GC_EMPTY_SEC_THRESHOLD) * SECTOR_HDR_DATA_SIZE)), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Is it possible to modify it like this? |
||||||
(unsigned long)db_max_size(db) - (unsigned long)db_sec_size(db) * FDB_GC_EMPTY_SEC_THRESHOLD); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/* unlock the KV cache */ | ||||||
db_unlock(db); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size type is not suitable for outputting in pointer format. Is there any other way?