[FL-2870] Printf function attributes (#1841)

* Furi strings: printf attribute
* Logs: printf attribute
* Plugins: adapt
* Plugins: accommodate
* Unit tests: accommodate

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-10-07 23:35:15 +10:00
committed by GitHub
parent 1f742b611a
commit 4000f0cac5
78 changed files with 187 additions and 156 deletions

View File

@@ -119,7 +119,11 @@ bool storage_file_open(
furi_event_flag_free(event);
FURI_LOG_T(
TAG, "File %p - %p open (%s)", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE, path);
TAG,
"File %p - %p open (%s)",
(void*)((uint32_t)file - SRAM_BASE),
(void*)(file->file_id - SRAM_BASE),
path);
return result;
}
@@ -132,7 +136,11 @@ bool storage_file_close(File* file) {
S_API_MESSAGE(StorageCommandFileClose);
S_API_EPILOGUE;
FURI_LOG_T(TAG, "File %p - %p closed", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE);
FURI_LOG_T(
TAG,
"File %p - %p closed",
(void*)((uint32_t)file - SRAM_BASE),
(void*)(file->file_id - SRAM_BASE));
file->type = FileTypeClosed;
return S_RETURN_BOOL;
@@ -291,7 +299,11 @@ bool storage_dir_open(File* file, const char* path) {
furi_event_flag_free(event);
FURI_LOG_T(
TAG, "Dir %p - %p open (%s)", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE, path);
TAG,
"Dir %p - %p open (%s)",
(void*)((uint32_t)file - SRAM_BASE),
(void*)(file->file_id - SRAM_BASE),
path);
return result;
}
@@ -303,7 +315,11 @@ bool storage_dir_close(File* file) {
S_API_MESSAGE(StorageCommandDirClose);
S_API_EPILOGUE;
FURI_LOG_T(TAG, "Dir %p - %p closed", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE);
FURI_LOG_T(
TAG,
"Dir %p - %p closed",
(void*)((uint32_t)file - SRAM_BASE),
(void*)(file->file_id - SRAM_BASE));
file->type = FileTypeClosed;
@@ -675,7 +691,7 @@ File* storage_file_alloc(Storage* storage) {
file->type = FileTypeClosed;
file->storage = storage;
FURI_LOG_T(TAG, "File/Dir %p alloc", (uint32_t)file - SRAM_BASE);
FURI_LOG_T(TAG, "File/Dir %p alloc", (void*)((uint32_t)file - SRAM_BASE));
return file;
}
@@ -697,7 +713,7 @@ void storage_file_free(File* file) {
}
}
FURI_LOG_T(TAG, "File/Dir %p free", (uint32_t)file - SRAM_BASE);
FURI_LOG_T(TAG, "File/Dir %p free", (void*)((uint32_t)file - SRAM_BASE));
free(file);
}

View File

@@ -77,12 +77,12 @@ static int storage_int_device_read(
FURI_LOG_T(
TAG,
"Device read: block %d, off %d, buffer: %p, size %d, translated address: %p",
"Device read: block %ld, off %ld, buffer: %p, size %ld, translated address: %p",
block,
off,
buffer,
size,
address);
(void*)address);
memcpy(buffer, (void*)address, size);
@@ -100,12 +100,12 @@ static int storage_int_device_prog(
FURI_LOG_T(
TAG,
"Device prog: block %d, off %d, buffer: %p, size %d, translated address: %p",
"Device prog: block %ld, off %ld, buffer: %p, size %ld, translated address: %p",
block,
off,
buffer,
size,
address);
(void*)address);
int ret = 0;
while(size > 0) {
@@ -122,7 +122,7 @@ static int storage_int_device_erase(const struct lfs_config* c, lfs_block_t bloc
LFSData* lfs_data = c->context;
size_t page = lfs_data->start_page + block;
FURI_LOG_D(TAG, "Device erase: page %d, translated page: %x", block, page);
FURI_LOG_D(TAG, "Device erase: page %ld, translated page: %x", block, page);
furi_hal_flash_erase(page);
return 0;
@@ -740,8 +740,8 @@ void storage_int_init(StorageData* storage) {
LFSData* lfs_data = storage_int_lfs_data_alloc();
FURI_LOG_I(
TAG,
"Config: start %p, read %d, write %d, page size: %d, page count: %d, cycles: %d",
lfs_data->start_address,
"Config: start %p, read %ld, write %ld, page size: %ld, page count: %ld, cycles: %ld",
(void*)lfs_data->start_address,
lfs_data->config.read_size,
lfs_data->config.prog_size,
lfs_data->config.block_size,