1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00

Api Symbols: replace asserts with checks (#3507)

* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
あく
2024-03-19 23:43:52 +09:00
committed by GitHub
parent a09ec4d976
commit acc39a4bc0
571 changed files with 3565 additions and 2704 deletions

View File

@@ -107,7 +107,7 @@ static uint32_t hid_exit(void* context) {
return VIEW_NONE;
}
Hid* hid_alloc() {
Hid* hid_alloc(void) {
Hid* app = malloc(sizeof(Hid));
// Gui

View File

@@ -2,9 +2,11 @@
#include <gui/view.h>
typedef struct Hid Hid;
typedef struct HidMedia HidMedia;
HidMedia* hid_media_alloc();
HidMedia* hid_media_alloc(Hid* hid);
void hid_media_free(HidMedia* hid_media);

View File

@@ -101,7 +101,7 @@ static void storage_move_to_sd_unmount_callback(const void* message, void* conte
}
}
static StorageMoveToSd* storage_move_to_sd_alloc() {
static StorageMoveToSd* storage_move_to_sd_alloc(void) {
StorageMoveToSd* app = malloc(sizeof(StorageMoveToSd));
app->gui = furi_record_open(RECORD_GUI);

View File

@@ -103,7 +103,7 @@ static void updater_start_app(void* context, uint32_t arg) {
furi_record_close(RECORD_LOADER);
}
void updater_on_system_start() {
void updater_on_system_start(void) {
#ifdef SRV_CLI
Cli* cli = (Cli*)furi_record_open(RECORD_CLI);
cli_add_command(cli, "update", CliCommandFlagDefault, updater_cli_ep, NULL);

View File

@@ -45,7 +45,7 @@ void updater_scene_main_on_enter(void* context) {
view_dispatcher_switch_to_view(updater->view_dispatcher, UpdaterViewMain);
}
static void updater_scene_cancel_update() {
static void updater_scene_cancel_update(void) {
update_operation_disarm();
furi_hal_power_reset();
}

View File

@@ -387,7 +387,7 @@ static void update_task_worker_thread_cb(FuriThreadState state, void* context) {
}
}
UpdateTask* update_task_alloc() {
UpdateTask* update_task_alloc(void) {
UpdateTask* update_task = malloc(sizeof(UpdateTask));
update_task->state.stage = UpdateTaskStageProgress;

View File

@@ -69,7 +69,7 @@ typedef struct UpdateTask UpdateTask;
typedef void (
*updateProgressCb)(const char* status, const uint8_t stage_pct, bool failed, void* state);
UpdateTask* update_task_alloc();
UpdateTask* update_task_alloc(void);
void update_task_free(UpdateTask* update_task);

View File

@@ -102,7 +102,7 @@ static void updater_main_draw_callback(Canvas* canvas, void* _model) {
}
}
UpdaterMainView* updater_main_alloc() {
UpdaterMainView* updater_main_alloc(void) {
UpdaterMainView* main_view = malloc(sizeof(UpdaterMainView));
main_view->view = view_alloc();

View File

@@ -9,7 +9,7 @@ typedef void (*UpdaterMainInputCallback)(InputType type, void* context);
View* updater_main_get_view(UpdaterMainView* main_view);
UpdaterMainView* updater_main_alloc();
UpdaterMainView* updater_main_alloc(void);
void updater_main_free(UpdaterMainView* main_view);