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

@@ -11,29 +11,29 @@ class AccessorApp {
public:
void run(void);
AccessorApp();
~AccessorApp();
AccessorApp(void);
~AccessorApp(void);
enum class Scene : uint8_t {
Exit,
Start,
};
AccessorAppViewManager* get_view_manager();
AccessorAppViewManager* get_view_manager(void);
void switch_to_next_scene(Scene index);
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
bool switch_to_previous_scene(uint8_t count = 1);
Scene get_previous_scene();
Scene get_previous_scene(void);
void notify_green_blink();
void notify_success();
void notify_green_blink(void);
void notify_success(void);
char* get_text_store();
uint8_t get_text_store_size();
char* get_text_store(void);
uint8_t get_text_store_size(void);
void set_text_store(const char* text...);
WIEGAND* get_wiegand();
OneWireHost* get_one_wire();
WIEGAND* get_wiegand(void);
OneWireHost* get_one_wire(void);
private:
std::list<Scene> previous_scenes_list = {Scene::Exit};

View File

@@ -15,16 +15,16 @@ public:
FuriMessageQueue* event_queue;
AccessorAppViewManager();
~AccessorAppViewManager();
AccessorAppViewManager(void);
~AccessorAppViewManager(void);
void switch_to(ViewType type);
void receive_event(AccessorEvent* event);
void send_event(AccessorEvent* event);
Submenu* get_submenu();
Popup* get_popup();
Submenu* get_submenu(void);
Popup* get_popup(void);
private:
ViewDispatcher* view_dispatcher;

View File

@@ -2,19 +2,19 @@
class WIEGAND {
public:
WIEGAND();
void begin();
void end();
bool available();
unsigned long getCode();
unsigned long getCodeHigh();
int getWiegandType();
WIEGAND(void);
void begin(void);
void end(void);
bool available(void);
unsigned long getCode(void);
unsigned long getCodeHigh(void);
int getWiegandType(void);
static void ReadD0();
static void ReadD1();
static void ReadD0(void);
static void ReadD1(void);
private:
static bool DoWiegandConversion();
static bool DoWiegandConversion(void);
static unsigned long
GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength);

View File

@@ -32,7 +32,7 @@ static void battery_test_battery_info_update_model(void* context) {
notification_message(app->notifications, &sequence_display_backlight_on);
}
BatteryTestApp* battery_test_alloc() {
BatteryTestApp* battery_test_alloc(void) {
BatteryTestApp* app = malloc(sizeof(BatteryTestApp));
// Records

View File

@@ -116,7 +116,7 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
draw_stat(canvas, 104, 42, &I_Health_16x16, health);
}
BatteryInfo* battery_info_alloc() {
BatteryInfo* battery_info_alloc(void) {
BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
battery_info->view = view_alloc();
view_set_context(battery_info->view, battery_info);

View File

@@ -14,7 +14,7 @@ typedef struct {
uint8_t health;
} BatteryInfoModel;
BatteryInfo* battery_info_alloc();
BatteryInfo* battery_info_alloc(void);
void battery_info_free(BatteryInfo* battery_info);

View File

@@ -28,7 +28,7 @@ uint32_t bt_debug_start_view(void* context) {
return BtDebugAppViewSubmenu;
}
BtDebugApp* bt_debug_app_alloc() {
BtDebugApp* bt_debug_app_alloc(void) {
BtDebugApp* app = malloc(sizeof(BtDebugApp));
// Gui

View File

@@ -129,7 +129,7 @@ static void bt_test_carrier_timer_callback(void* context) {
}
}
BtCarrierTest* bt_carrier_test_alloc() {
BtCarrierTest* bt_carrier_test_alloc(void) {
BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest));
bt_carrier_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test);

View File

@@ -3,7 +3,7 @@
typedef struct BtCarrierTest BtCarrierTest;
BtCarrierTest* bt_carrier_test_alloc();
BtCarrierTest* bt_carrier_test_alloc(void);
void bt_carrier_test_free(BtCarrierTest* bt_carrier_test);

View File

@@ -97,7 +97,7 @@ static void bt_test_packet_timer_callback(void* context) {
}
}
BtPacketTest* bt_packet_test_alloc() {
BtPacketTest* bt_packet_test_alloc(void) {
BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest));
bt_packet_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_packet_test->bt_test, bt_packet_test);

View File

@@ -3,7 +3,7 @@
typedef struct BtPacketTest BtPacketTest;
BtPacketTest* bt_packet_test_alloc();
BtPacketTest* bt_packet_test_alloc(void);
void bt_packet_test_free(BtPacketTest* bt_packet_test);

View File

@@ -305,7 +305,7 @@ void bt_test_process_back(BtTest* bt_test) {
}
}
BtTest* bt_test_alloc() {
BtTest* bt_test_alloc(void) {
BtTest* bt_test = malloc(sizeof(BtTest));
bt_test->view = view_alloc();
view_set_context(bt_test->view, bt_test);

View File

@@ -12,7 +12,7 @@ typedef void (*BtTestBackCallback)(void* context);
typedef struct BtTestParam BtTestParam;
typedef void (*BtTestParamChangeCallback)(BtTestParam* param);
BtTest* bt_test_alloc();
BtTest* bt_test_alloc(void);
void bt_test_free(BtTest* bt_test);

View File

@@ -90,7 +90,7 @@ uint32_t ccid_test_exit(void* context) {
return VIEW_NONE;
}
CcidTestApp* ccid_test_app_alloc() {
CcidTestApp* ccid_test_app_alloc(void) {
CcidTestApp* app = malloc(sizeof(CcidTestApp));
// Gui

View File

@@ -50,7 +50,7 @@ static void crash_test_submenu_callback(void* context, uint32_t index) {
furi_halt("Crash test: furi_halt");
break;
default:
furi_crash("Programming error");
furi_crash();
}
}
@@ -59,7 +59,7 @@ static uint32_t crash_test_exit_callback(void* context) {
return VIEW_NONE;
}
CrashTest* crash_test_alloc() {
CrashTest* crash_test_alloc(void) {
CrashTest* instance = malloc(sizeof(CrashTest));
View* view = NULL;

View File

@@ -26,7 +26,7 @@ static void gui_input_events_callback(const void* value, void* ctx) {
}
}
static DirectDraw* direct_draw_alloc() {
static DirectDraw* direct_draw_alloc(void) {
DirectDraw* instance = malloc(sizeof(DirectDraw));
instance->input = furi_record_open(RECORD_INPUT_EVENTS);

View File

@@ -121,7 +121,7 @@ static void display_config_set_contrast(VariableItem* item) {
display_test_reload_config(instance);
}
DisplayTest* display_test_alloc() {
DisplayTest* display_test_alloc(void) {
DisplayTest* instance = malloc(sizeof(DisplayTest));
View* view = NULL;

View File

@@ -154,7 +154,7 @@ static void view_display_test_timer_callback(void* context) {
instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
}
ViewDisplayTest* view_display_test_alloc() {
ViewDisplayTest* view_display_test_alloc(void) {
ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest));
instance->view = view_alloc();

View File

@@ -5,7 +5,7 @@
typedef struct ViewDisplayTest ViewDisplayTest;
ViewDisplayTest* view_display_test_alloc();
ViewDisplayTest* view_display_test_alloc(void);
void view_display_test_free(ViewDisplayTest* instance);

View File

@@ -81,7 +81,7 @@ static void expansion_test_app_serial_rx_callback(
}
}
static ExpansionTestApp* expansion_test_app_alloc() {
static ExpansionTestApp* expansion_test_app_alloc(void) {
ExpansionTestApp* instance = malloc(sizeof(ExpansionTestApp));
instance->buf = furi_stream_buffer_alloc(RECEIVE_BUFFER_SIZE, 1);
return instance;

View File

@@ -12,7 +12,7 @@ static bool lfrfid_debug_back_event_callback(void* context) {
return scene_manager_handle_back_event(app->scene_manager);
}
static LfRfidDebug* lfrfid_debug_alloc() {
static LfRfidDebug* lfrfid_debug_alloc(void) {
LfRfidDebug* app = malloc(sizeof(LfRfidDebug));
app->view_dispatcher = view_dispatcher_alloc();

View File

@@ -170,7 +170,7 @@ static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* conte
return consumed;
}
LfRfidTuneView* lfrfid_debug_view_tune_alloc() {
LfRfidTuneView* lfrfid_debug_view_tune_alloc(void) {
LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView));
tune_view->view = view_alloc();
view_set_context(tune_view->view, tune_view);

View File

@@ -3,7 +3,7 @@
typedef struct LfRfidTuneView LfRfidTuneView;
LfRfidTuneView* lfrfid_debug_view_tune_alloc();
LfRfidTuneView* lfrfid_debug_view_tune_alloc(void);
void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view);

View File

@@ -53,7 +53,7 @@ static uint32_t locale_test_exit(void* context) {
return VIEW_NONE;
}
static LocaleTestApp* locale_test_alloc() {
static LocaleTestApp* locale_test_alloc(void) {
LocaleTestApp* app = malloc(sizeof(LocaleTestApp));
// Gui

View File

@@ -83,7 +83,7 @@ static bool rpc_debug_app_rpc_init_rpc(RpcDebugApp* app, const char* args) {
return ret;
}
static RpcDebugApp* rpc_debug_app_alloc() {
static RpcDebugApp* rpc_debug_app_alloc(void) {
RpcDebugApp* app = malloc(sizeof(RpcDebugApp));
app->gui = furi_record_open(RECORD_GUI);

View File

@@ -21,7 +21,7 @@ typedef struct {
Cli* cli;
} SpeakerDebugApp;
static SpeakerDebugApp* speaker_app_alloc() {
static SpeakerDebugApp* speaker_app_alloc(void) {
SpeakerDebugApp* app = (SpeakerDebugApp*)malloc(sizeof(SpeakerDebugApp));
app->music_worker = music_worker_alloc();
app->message_queue = furi_message_queue_alloc(8, sizeof(SpeakerDebugAppMessage));

View File

@@ -38,7 +38,7 @@ typedef enum {
PrincetonDecoderStepCheckDuration,
} PrincetonDecoderStep;
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc() {
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void) {
SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton));
return instance;
}

View File

@@ -15,7 +15,7 @@ typedef void (*SubGhzDecoderPrincetonCallback)(SubGhzDecoderPrinceton* parser, v
* Allocate SubGhzEncoderPrinceton
* @return pointer to SubGhzEncoderPrinceton instance
*/
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc();
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void);
/**
* Free SubGhzEncoderPrinceton instance
@@ -69,7 +69,7 @@ LevelDuration subghz_encoder_princeton_for_testing_yield(void* context);
* Allocate SubGhzDecoderPrinceton
* @return SubGhzDecoderPrinceton*
*/
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc();
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc(void);
/**
* Free SubGhzDecoderPrinceton

View File

@@ -21,7 +21,7 @@ static void subghz_test_app_tick_event_callback(void* context) {
scene_manager_handle_tick_event(app->scene_manager);
}
SubGhzTestApp* subghz_test_app_alloc() {
SubGhzTestApp* subghz_test_app_alloc(void) {
SubGhzTestApp* app = malloc(sizeof(SubGhzTestApp));
// GUI

View File

@@ -186,7 +186,7 @@ void subghz_test_carrier_rssi_timer_callback(void* context) {
false);
}
SubGhzTestCarrier* subghz_test_carrier_alloc() {
SubGhzTestCarrier* subghz_test_carrier_alloc(void) {
SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier));
// View allocation and configuration

View File

@@ -15,7 +15,7 @@ void subghz_test_carrier_set_callback(
SubGhzTestCarrierCallback callback,
void* context);
SubGhzTestCarrier* subghz_test_carrier_alloc();
SubGhzTestCarrier* subghz_test_carrier_alloc(void);
void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier);

View File

@@ -236,7 +236,7 @@ void subghz_test_packet_exit(void* context) {
furi_hal_subghz_sleep();
}
SubGhzTestPacket* subghz_test_packet_alloc() {
SubGhzTestPacket* subghz_test_packet_alloc(void) {
SubGhzTestPacket* instance = malloc(sizeof(SubGhzTestPacket));
// View allocation and configuration

View File

@@ -15,7 +15,7 @@ void subghz_test_packet_set_callback(
SubGhzTestPacketCallback callback,
void* context);
SubGhzTestPacket* subghz_test_packet_alloc();
SubGhzTestPacket* subghz_test_packet_alloc(void);
void subghz_test_packet_free(SubGhzTestPacket* subghz_test_packet);

View File

@@ -164,7 +164,7 @@ void subghz_test_static_exit(void* context) {
furi_hal_subghz_sleep();
}
SubGhzTestStatic* subghz_test_static_alloc() {
SubGhzTestStatic* subghz_test_static_alloc(void) {
SubGhzTestStatic* instance = malloc(sizeof(SubGhzTestStatic));
// View allocation and configuration

View File

@@ -15,7 +15,7 @@ void subghz_test_static_set_callback(
SubGhzTestStaticCallback callback,
void* context);
SubGhzTestStatic* subghz_test_static_alloc();
SubGhzTestStatic* subghz_test_static_alloc(void);
void subghz_test_static_free(SubGhzTestStatic* subghz_static);

View File

@@ -734,7 +734,7 @@ MU_TEST_SUITE(test_bit_lib) {
MU_RUN_TEST(test_bit_lib_bytes_to_num_bcd);
}
int run_minunit_test_bit_lib() {
int run_minunit_test_bit_lib(void) {
MU_RUN_SUITE(test_bit_lib);
return MU_EXIT_CODE;
}

View File

@@ -17,7 +17,7 @@ typedef struct {
BtTest* bt_test = NULL;
void bt_test_alloc() {
void bt_test_alloc(void) {
bt_test = malloc(sizeof(BtTest));
bt_test->storage = furi_record_open(RECORD_STORAGE);
bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE);
@@ -27,7 +27,7 @@ void bt_test_alloc() {
bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE);
}
void bt_test_free() {
void bt_test_free(void) {
furi_check(bt_test);
free(bt_test->nvm_ram_buff_ref);
free(bt_test->nvm_ram_buff_dut);
@@ -37,7 +37,7 @@ void bt_test_free() {
bt_test = NULL;
}
static void bt_test_keys_storage_profile() {
static void bt_test_keys_storage_profile(void) {
// Emulate nvm change on initial connection
const int nvm_change_size_on_connection = 88;
for(size_t i = 0; i < nvm_change_size_on_connection; i++) {
@@ -82,7 +82,7 @@ static void bt_test_keys_storage_profile() {
"Wrong buffer loaded");
}
static void bt_test_keys_remove_test_file() {
static void bt_test_keys_remove_test_file(void) {
mu_assert(
storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH),
"Can't remove test file");
@@ -104,7 +104,7 @@ MU_TEST_SUITE(test_bt) {
bt_test_free();
}
int run_minunit_test_bt() {
int run_minunit_test_bt(void) {
MU_RUN_SUITE(test_bt);
return MU_EXIT_CODE;
}

View File

@@ -182,7 +182,7 @@ MU_TEST_SUITE(test_datetime_datetime_to_timestamp_suite) {
MU_RUN_TEST(test_datetime_datetime_to_timestamp_max);
}
int run_minunit_test_datetime() {
int run_minunit_test_datetime(void) {
MU_RUN_SUITE(test_datetime_timestamp_to_datetime_suite);
MU_RUN_SUITE(test_datetime_datetime_to_timestamp_suite);
MU_RUN_SUITE(test_datetime_validate_datetime);

View File

@@ -25,7 +25,7 @@ MU_TEST_SUITE(dialogs_file_browser_options) {
MU_RUN_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields);
}
int run_minunit_test_dialogs_file_browser_options() {
int run_minunit_test_dialogs_file_browser_options(void) {
MU_RUN_SUITE(dialogs_file_browser_options);
return MU_EXIT_CODE;

View File

@@ -194,7 +194,7 @@ MU_TEST_SUITE(test_expansion_suite) {
MU_RUN_TEST(test_expansion_garbage_input);
}
int run_minunit_test_expansion() {
int run_minunit_test_expansion(void) {
MU_RUN_SUITE(test_expansion_suite);
return MU_EXIT_CODE;
}

View File

@@ -331,7 +331,7 @@ MU_TEST_SUITE(flipper_format_string_suite) {
MU_RUN_TEST(flipper_format_file_test);
}
int run_minunit_test_flipper_format_string() {
int run_minunit_test_flipper_format_string(void) {
MU_RUN_SUITE(flipper_format_string_suite);
return MU_EXIT_CODE;
}

View File

@@ -103,14 +103,14 @@ static bool storage_write_string(const char* path, const char* data) {
return result;
}
static void tests_setup() {
static void tests_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
mu_assert(storage_simply_mkdir(storage, TEST_DIR_NAME), "Cannot create dir");
furi_record_close(RECORD_STORAGE);
}
static void tests_teardown() {
static void tests_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
furi_record_close(RECORD_STORAGE);
@@ -545,7 +545,7 @@ MU_TEST_SUITE(flipper_format) {
tests_teardown();
}
int run_minunit_test_flipper_format() {
int run_minunit_test_flipper_format(void) {
MU_RUN_SUITE(flipper_format);
return MU_EXIT_CODE;
}

View File

@@ -54,7 +54,7 @@ MU_TEST_SUITE(float_tools_suite) {
MU_RUN_TEST(float_tools_equal_test);
}
int run_minunit_test_float_tools() {
int run_minunit_test_float_tools(void) {
MU_RUN_SUITE(float_tools_suite);
return MU_EXIT_CODE;
}

View File

@@ -4,7 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
void test_furi_memmgr() {
void test_furi_memmgr(void) {
void* ptr;
// allocate memory case

View File

@@ -15,7 +15,7 @@ void test_pubsub_handler(const void* arg, void* ctx) {
pubsub_context_value = *(uint32_t*)ctx;
}
void test_furi_pubsub() {
void test_furi_pubsub(void) {
FuriPubSub* test_pubsub = NULL;
FuriPubSubSubscription* test_pubsub_subscription = NULL;

View File

@@ -5,7 +5,7 @@
#define TEST_RECORD_NAME "test/holding"
void test_furi_create_open() {
void test_furi_create_open(void) {
// Test that record does not exist
mu_check(furi_record_exists(TEST_RECORD_NAME) == false);

View File

@@ -462,7 +462,7 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_string_utf8);
}
int run_minunit_test_furi_string() {
int run_minunit_test_furi_string(void) {
MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE;

View File

@@ -50,7 +50,7 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_memmgr);
}
int run_minunit_test_furi() {
int run_minunit_test_furi(void) {
MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE;

View File

@@ -409,16 +409,16 @@ static const uint8_t tv_gcm_tag_4[16] = {
0x1B,
};
static void furi_hal_crypto_ctr_setup() {
static void furi_hal_crypto_ctr_setup(void) {
}
static void furi_hal_crypto_ctr_teardown() {
static void furi_hal_crypto_ctr_teardown(void) {
}
static void furi_hal_crypto_gcm_setup() {
static void furi_hal_crypto_gcm_setup(void) {
}
static void furi_hal_crypto_gcm_teardown() {
static void furi_hal_crypto_gcm_teardown(void) {
}
MU_TEST(furi_hal_crypto_ctr_1) {
@@ -595,7 +595,7 @@ MU_TEST_SUITE(furi_hal_crypto_gcm_test) {
MU_RUN_TEST(furi_hal_crypto_gcm_4);
}
int run_minunit_test_furi_hal_crypto() {
int run_minunit_test_furi_hal_crypto(void) {
MU_RUN_SUITE(furi_hal_crypto_ctr_test);
MU_RUN_SUITE(furi_hal_crypto_gcm_test);
return MU_EXIT_CODE;

View File

@@ -14,19 +14,19 @@
#define EEPROM_PAGE_SIZE 16
#define EEPROM_WRITE_DELAY_MS 6
static void furi_hal_i2c_int_setup() {
static void furi_hal_i2c_int_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
}
static void furi_hal_i2c_int_teardown() {
static void furi_hal_i2c_int_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_power);
}
static void furi_hal_i2c_ext_setup() {
static void furi_hal_i2c_ext_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
}
static void furi_hal_i2c_ext_teardown() {
static void furi_hal_i2c_ext_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_external);
}
@@ -227,7 +227,7 @@ MU_TEST_SUITE(furi_hal_i2c_ext_suite) {
MU_RUN_TEST(furi_hal_i2c_ext_eeprom);
}
int run_minunit_test_furi_hal() {
int run_minunit_test_furi_hal(void) {
MU_RUN_SUITE(furi_hal_i2c_int_suite);
MU_RUN_SUITE(furi_hal_i2c_ext_suite);
return MU_EXIT_CODE;

View File

@@ -17,7 +17,7 @@ typedef struct {
static InfraredTest* test;
static void infrared_test_alloc() {
static void infrared_test_alloc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
test = malloc(sizeof(InfraredTest));
test->decoder_handler = infrared_alloc_decoder();
@@ -26,7 +26,7 @@ static void infrared_test_alloc() {
test->file_path = furi_string_alloc();
}
static void infrared_test_free() {
static void infrared_test_free(void) {
furi_check(test);
infrared_free_decoder(test->decoder_handler);
infrared_free_encoder(test->encoder_handler);
@@ -543,7 +543,7 @@ MU_TEST_SUITE(infrared_test) {
MU_RUN_TEST(infrared_test_encoder_decoder_all);
}
int run_minunit_test_infrared() {
int run_minunit_test_infrared(void) {
MU_RUN_SUITE(infrared_test);
return MU_EXIT_CODE;
}

View File

@@ -547,7 +547,7 @@ MU_TEST_SUITE(test_lfrfid_protocols_suite) {
MU_RUN_TEST(test_lfrfid_protocol_fdxb_emulate_simple);
}
int run_minunit_test_lfrfid_protocols() {
int run_minunit_test_lfrfid_protocols(void) {
MU_RUN_SUITE(test_lfrfid_protocols_suite);
return MU_EXIT_CODE;
}

View File

@@ -69,7 +69,7 @@ MU_TEST_SUITE(manifest_suite) {
MU_RUN_TEST(manifest_iteration_test);
}
int run_minunit_test_manifest() {
int run_minunit_test_manifest(void) {
MU_RUN_SUITE(manifest_suite);
return MU_EXIT_CODE;
}

View File

@@ -28,12 +28,12 @@ typedef struct {
static NfcTest* nfc_test = NULL;
static void nfc_test_alloc() {
static void nfc_test_alloc(void) {
nfc_test = malloc(sizeof(NfcTest));
nfc_test->storage = furi_record_open(RECORD_STORAGE);
}
static void nfc_test_free() {
static void nfc_test_free(void) {
furi_check(nfc_test);
furi_record_close(RECORD_STORAGE);
@@ -292,7 +292,7 @@ MU_TEST(ntag_213_locked_reader) {
nfc_free(poller);
}
static void mf_ultralight_write() {
static void mf_ultralight_write(void) {
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
@@ -342,7 +342,7 @@ static void mf_ultralight_write() {
nfc_free(poller);
}
static void mf_classic_reader() {
static void mf_classic_reader(void) {
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
@@ -368,7 +368,7 @@ static void mf_classic_reader() {
nfc_free(poller);
}
static void mf_classic_write() {
static void mf_classic_write(void) {
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
@@ -396,7 +396,7 @@ static void mf_classic_write() {
nfc_free(poller);
}
static void mf_classic_value_block() {
static void mf_classic_value_block(void) {
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
@@ -548,7 +548,7 @@ MU_TEST_SUITE(nfc) {
nfc_test_free();
}
int run_minunit_test_nfc() {
int run_minunit_test_nfc(void) {
MU_RUN_SUITE(nfc);
return MU_EXIT_CODE;
}

View File

@@ -115,7 +115,7 @@ static void nfc_prepare_col_res_data(
}
}
Nfc* nfc_alloc() {
Nfc* nfc_alloc(void) {
Nfc* instance = malloc(sizeof(Nfc));
return instance;

View File

@@ -63,7 +63,7 @@ MU_TEST_SUITE(test_power_suite) {
power_test_deinit();
}
int run_minunit_test_power() {
int run_minunit_test_power(void) {
MU_RUN_SUITE(test_power_suite);
return MU_EXIT_CODE;
}

View File

@@ -18,7 +18,7 @@ typedef struct {
static const uint32_t protocol_0_decoder_result = 0xDEADBEEF;
static void* protocol_0_alloc() {
static void* protocol_0_alloc(void) {
void* data = malloc(sizeof(Protocol0Data));
return data;
}
@@ -63,7 +63,7 @@ typedef struct {
static const uint64_t protocol_1_decoder_result = 0x1234567890ABCDEF;
static void* protocol_1_alloc() {
static void* protocol_1_alloc(void) {
void* data = malloc(sizeof(Protocol1Data));
return data;
}
@@ -216,7 +216,7 @@ MU_TEST_SUITE(test_protocol_dict_suite) {
MU_RUN_TEST(test_protocol_dict);
}
int run_minunit_test_protocol_dict() {
int run_minunit_test_protocol_dict(void) {
MU_RUN_SUITE(test_protocol_dict_suite);
return MU_EXIT_CODE;
}

View File

@@ -1840,7 +1840,7 @@ MU_TEST_SUITE(test_rpc_session) {
furi_record_close(RECORD_STORAGE);
}
int run_minunit_test_rpc() {
int run_minunit_test_rpc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_sd_status(storage) != FSE_OK) {
FURI_LOG_E(TAG, "SD card not mounted - skip storage tests");

View File

@@ -266,7 +266,7 @@ MU_TEST_SUITE(test_dirwalk_suite) {
furi_record_close(RECORD_STORAGE);
}
int run_minunit_test_dirwalk() {
int run_minunit_test_dirwalk(void) {
MU_RUN_SUITE(test_dirwalk_suite);
return MU_EXIT_CODE;
}

View File

@@ -36,7 +36,7 @@ static bool storage_file_create(Storage* storage, const char* path, const char*
return result;
}
static void storage_file_open_lock_setup() {
static void storage_file_open_lock_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);
storage_simply_remove(storage, STORAGE_LOCKED_FILE);
@@ -47,7 +47,7 @@ static void storage_file_open_lock_setup() {
furi_record_close(RECORD_STORAGE);
}
static void storage_file_open_lock_teardown() {
static void storage_file_open_lock_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_check(storage_simply_remove(storage, STORAGE_LOCKED_FILE));
furi_record_close(RECORD_STORAGE);
@@ -702,7 +702,7 @@ MU_TEST_SUITE(test_md5_calc_suite) {
MU_RUN_TEST(test_md5_calc);
}
int run_minunit_test_storage() {
int run_minunit_test_storage(void) {
MU_RUN_SUITE(storage_file);
MU_RUN_SUITE(storage_file_64k);
MU_RUN_SUITE(storage_dir);

View File

@@ -526,7 +526,7 @@ MU_TEST_SUITE(stream_suite) {
MU_RUN_TEST(stream_buffered_large_file_test);
}
int run_minunit_test_stream() {
int run_minunit_test_stream(void) {
MU_RUN_SUITE(stream_suite);
return MU_EXIT_CODE;
}

View File

@@ -314,7 +314,7 @@ static LevelDuration subghz_hal_async_tx_test_yield(void* context) {
furi_crash("Yield after reset");
}
} else {
furi_crash("Programming error");
furi_crash();
}
}
@@ -904,7 +904,7 @@ MU_TEST_SUITE(subghz) {
subghz_test_deinit();
}
int run_minunit_test_subghz() {
int run_minunit_test_subghz(void) {
MU_RUN_SUITE(subghz);
return MU_EXIT_CODE;
}

View File

@@ -66,7 +66,7 @@ const UnitTest unit_tests[] = {
{.name = "expansion", .entry = run_minunit_test_expansion},
};
void minunit_print_progress() {
void minunit_print_progress(void) {
static const char progress[] = {'\\', '|', '/', '-'};
static uint8_t progress_counter = 0;
static uint32_t last_tick = 0;
@@ -157,7 +157,7 @@ void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
furi_record_close(RECORD_LOADER);
}
void unit_tests_on_system_start() {
void unit_tests_on_system_start(void) {
#ifdef SRV_CLI
Cli* cli = furi_record_open(RECORD_CLI);

View File

@@ -82,7 +82,7 @@ MU_TEST_SUITE(test_varint_suite) {
MU_RUN_TEST(test_varint_rand_i);
}
int run_minunit_test_varint() {
int run_minunit_test_varint(void) {
MU_RUN_SUITE(test_varint_suite);
return MU_EXIT_CODE;
}

View File

@@ -55,7 +55,7 @@ uint32_t usb_test_exit(void* context) {
return VIEW_NONE;
}
UsbTestApp* usb_test_app_alloc() {
UsbTestApp* usb_test_app_alloc(void) {
UsbTestApp* app = malloc(sizeof(UsbTestApp));
// Gui