[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

@@ -32,7 +32,7 @@ static void rpc_system_app_start_process(const PB_Main* request, void* context)
furi_assert(!rpc_app->last_id);
furi_assert(!rpc_app->last_data);
FURI_LOG_D(TAG, "StartProcess: id %d", request->command_id);
FURI_LOG_D(TAG, "StartProcess: id %ld", request->command_id);
PB_CommandStatus result = PB_CommandStatus_ERROR_APP_CANT_START;
@@ -63,7 +63,7 @@ static void rpc_system_app_start_process(const PB_Main* request, void* context)
furi_record_close(RECORD_LOADER);
FURI_LOG_D(TAG, "StartProcess: response id %d, result %d", request->command_id, result);
FURI_LOG_D(TAG, "StartProcess: response id %ld, result %d", request->command_id, result);
rpc_send_and_release_empty(session, request->command_id, result);
}
@@ -108,7 +108,7 @@ static void rpc_system_app_exit_request(const PB_Main* request, void* context) {
PB_CommandStatus status;
if(rpc_app->app_callback) {
FURI_LOG_D(TAG, "ExitRequest: id %d", request->command_id);
FURI_LOG_D(TAG, "ExitRequest: id %ld", request->command_id);
furi_assert(!rpc_app->last_id);
furi_assert(!rpc_app->last_data);
rpc_app->last_id = request->command_id;
@@ -116,7 +116,7 @@ static void rpc_system_app_exit_request(const PB_Main* request, void* context) {
} else {
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
FURI_LOG_E(
TAG, "ExitRequest: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
TAG, "ExitRequest: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
rpc_send_and_release_empty(session, request->command_id, status);
}
}
@@ -132,7 +132,7 @@ static void rpc_system_app_load_file(const PB_Main* request, void* context) {
PB_CommandStatus status;
if(rpc_app->app_callback) {
FURI_LOG_D(TAG, "LoadFile: id %d", request->command_id);
FURI_LOG_D(TAG, "LoadFile: id %ld", request->command_id);
furi_assert(!rpc_app->last_id);
furi_assert(!rpc_app->last_data);
rpc_app->last_id = request->command_id;
@@ -141,7 +141,7 @@ static void rpc_system_app_load_file(const PB_Main* request, void* context) {
} else {
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
FURI_LOG_E(
TAG, "LoadFile: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
TAG, "LoadFile: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
rpc_send_and_release_empty(session, request->command_id, status);
}
}
@@ -166,7 +166,7 @@ static void rpc_system_app_button_press(const PB_Main* request, void* context) {
} else {
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
FURI_LOG_E(
TAG, "ButtonPress: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
TAG, "ButtonPress: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
rpc_send_and_release_empty(session, request->command_id, status);
}
}
@@ -190,7 +190,7 @@ static void rpc_system_app_button_release(const PB_Main* request, void* context)
} else {
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
FURI_LOG_E(
TAG, "ButtonRelease: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
TAG, "ButtonRelease: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
rpc_send_and_release_empty(session, request->command_id, status);
}
}
@@ -243,7 +243,7 @@ void rpc_system_app_confirm(RpcAppSystem* rpc_app, RpcAppSystemEvent event, bool
free(rpc_app->last_data);
rpc_app->last_data = NULL;
}
FURI_LOG_D(TAG, "AppConfirm: event %d last_id %d status %d", event, last_id, status);
FURI_LOG_D(TAG, "AppConfirm: event %d last_id %ld status %d", event, last_id, status);
rpc_send_and_release_empty(session, last_id, status);
break;
default:

View File

@@ -44,7 +44,7 @@ void rpc_cli_command_start_session(Cli* cli, FuriString* args, void* context) {
Rpc* rpc = context;
uint32_t mem_before = memmgr_get_free_heap();
FURI_LOG_D(TAG, "Free memory %d", mem_before);
FURI_LOG_D(TAG, "Free memory %ld", mem_before);
furi_hal_usb_lock();
RpcSession* rpc_session = rpc_session_open(rpc);

View File

@@ -158,9 +158,9 @@ void rpc_debug_print_message(const PB_Main* message) {
case PB_Main_storage_info_response_tag: {
furi_string_cat_printf(str, "\tinfo_response {\r\n");
furi_string_cat_printf(
str, "\t\ttotal_space: %lu\r\n", message->content.storage_info_response.total_space);
str, "\t\ttotal_space: %llu\r\n", message->content.storage_info_response.total_space);
furi_string_cat_printf(
str, "\t\tfree_space: %lu\r\n", message->content.storage_info_response.free_space);
str, "\t\tfree_space: %llu\r\n", message->content.storage_info_response.free_space);
break;
}
case PB_Main_storage_stat_request_tag: {