diff --git a/.clang-format b/.clang-format index ad9757ab..3337a740 100644 --- a/.clang-format +++ b/.clang-format @@ -83,4 +83,4 @@ SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp03 TabWidth: 4 -UseTab: Never \ No newline at end of file +UseTab: Never diff --git a/.github/workflows/build_toolchain.yml b/.github/workflows/build_toolchain.yml index 2068730c..452dfbee 100644 --- a/.github/workflows/build_toolchain.yml +++ b/.github/workflows/build_toolchain.yml @@ -43,4 +43,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 cache-from: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache - cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max \ No newline at end of file + cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max diff --git a/.github/workflows/check_submodules.yml b/.github/workflows/check_submodules.yml index db3a3afb..b02f9a8d 100644 --- a/.github/workflows/check_submodules.yml +++ b/.github/workflows/check_submodules.yml @@ -14,4 +14,4 @@ jobs: with: path: assets/protobuf branch: dev - fetch_depth: 50 \ No newline at end of file + fetch_depth: 50 diff --git a/applications/about/about.c b/applications/about/about.c index 9e3fd34e..7c8a4c69 100644 --- a/applications/about/about.c +++ b/applications/about/about.c @@ -149,6 +149,7 @@ const AboutDialogScreen about_screens[] = { const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen); int32_t about_settings_app(void* p) { + UNUSED(p); DialogsApp* dialogs = furi_record_open("dialogs"); DialogMessage* message = dialog_message_alloc(); diff --git a/applications/accessor/accessor.cpp b/applications/accessor/accessor.cpp index 000c214b..d7b687ed 100644 --- a/applications/accessor/accessor.cpp +++ b/applications/accessor/accessor.cpp @@ -2,9 +2,10 @@ // app enter function extern "C" int32_t accessor_app(void* p) { + UNUSED(p); AccessorApp* app = new AccessorApp(); app->run(); delete app; return 255; -} \ No newline at end of file +} diff --git a/applications/accessor/accessor_app.h b/applications/accessor/accessor_app.h index ce18c177..2afd796d 100644 --- a/applications/accessor/accessor_app.h +++ b/applications/accessor/accessor_app.h @@ -51,4 +51,4 @@ private: OneWireHost* onewire_host; NotificationApp* notification; -}; \ No newline at end of file +}; diff --git a/applications/accessor/accessor_view_manager.cpp b/applications/accessor/accessor_view_manager.cpp index 604e4304..f54ad62f 100644 --- a/applications/accessor/accessor_view_manager.cpp +++ b/applications/accessor/accessor_view_manager.cpp @@ -64,7 +64,7 @@ void AccessorAppViewManager::send_event(AccessorEvent* event) { furi_check(result == osOK); } -uint32_t AccessorAppViewManager::previous_view_callback(void* context) { +uint32_t AccessorAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { AccessorEvent event; event.type = AccessorEvent::Type::Back; @@ -76,4 +76,4 @@ uint32_t AccessorAppViewManager::previous_view_callback(void* context) { void AccessorAppViewManager::add_view(ViewType view_type, View* view) { view_dispatcher_add_view(view_dispatcher, static_cast(view_type), view); -} \ No newline at end of file +} diff --git a/applications/accessor/accessor_view_manager.h b/applications/accessor/accessor_view_manager.h index 1e9d8e04..f2c6f2bb 100644 --- a/applications/accessor/accessor_view_manager.h +++ b/applications/accessor/accessor_view_manager.h @@ -36,4 +36,4 @@ private: // view elements Submenu* submenu; Popup* popup; -}; \ No newline at end of file +}; diff --git a/applications/accessor/helpers/wiegand.h b/applications/accessor/helpers/wiegand.h index 2822d95a..8127f428 100644 --- a/applications/accessor/helpers/wiegand.h +++ b/applications/accessor/helpers/wiegand.h @@ -27,4 +27,4 @@ private: static int _wiegandType; static unsigned long _code; static unsigned long _codeHigh; -}; \ No newline at end of file +}; diff --git a/applications/accessor/scene/accessor_scene_generic.h b/applications/accessor/scene/accessor_scene_generic.h index b403f152..62a4eafe 100644 --- a/applications/accessor/scene/accessor_scene_generic.h +++ b/applications/accessor/scene/accessor_scene_generic.h @@ -10,4 +10,4 @@ public: virtual void on_exit(AccessorApp* app) = 0; private: -}; \ No newline at end of file +}; diff --git a/applications/accessor/scene/accessor_scene_start.h b/applications/accessor/scene/accessor_scene_start.h index 3be88bb3..1717d1e7 100644 --- a/applications/accessor/scene/accessor_scene_start.h +++ b/applications/accessor/scene/accessor_scene_start.h @@ -6,4 +6,4 @@ public: void on_enter(AccessorApp* app) final; bool on_event(AccessorApp* app, AccessorEvent* event) final; void on_exit(AccessorApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/archive/archive.c b/applications/archive/archive.c index 79f26f0e..5a38700b 100644 --- a/applications/archive/archive.c +++ b/applications/archive/archive.c @@ -66,6 +66,7 @@ void archive_free(ArchiveApp* archive) { } int32_t archive_app(void* p) { + UNUSED(p); ArchiveApp* archive = archive_alloc(); scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); view_dispatcher_run(archive->view_dispatcher); diff --git a/applications/archive/helpers/archive_apps.c b/applications/archive/helpers/archive_apps.c index e1c429a7..f5edbbb3 100644 --- a/applications/archive/helpers/archive_apps.c +++ b/applications/archive/helpers/archive_apps.c @@ -7,8 +7,8 @@ static const char* known_apps[] = { }; ArchiveAppTypeEnum archive_get_app_type(const char* path) { - for(size_t i = 0; i < SIZEOF_ARRAY(known_apps); i++) { - if(strncmp(path, known_apps[i], strlen(known_apps[i])) != STRING_FAILURE) { + for(size_t i = 0; i < COUNT_OF(known_apps); i++) { + if(strncmp(path, known_apps[i], strlen(known_apps[i])) == 0) { return i; } } @@ -16,6 +16,7 @@ ArchiveAppTypeEnum archive_get_app_type(const char* path) { } bool archive_app_is_available(void* context, const char* path) { + UNUSED(context); furi_assert(path); ArchiveAppTypeEnum app = archive_get_app_type(path); diff --git a/applications/archive/helpers/archive_apps.h b/applications/archive/helpers/archive_apps.h index 5abc27a5..8bc90458 100644 --- a/applications/archive/helpers/archive_apps.h +++ b/applications/archive/helpers/archive_apps.h @@ -11,7 +11,7 @@ static const ArchiveFileTypeEnum app_file_types[] = { [ArchiveAppTypeUnknown] = ArchiveFileTypeUnknown, }; -static inline const ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) { +static inline ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) { return app_file_types[app]; } diff --git a/applications/archive/helpers/archive_browser.c b/applications/archive/helpers/archive_browser.c index cbe57c06..faf10de9 100644 --- a/applications/archive/helpers/archive_browser.c +++ b/applications/archive/helpers/archive_browser.c @@ -6,7 +6,8 @@ bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx) { size_t array_size = files_array_size(model->files); - if((idx >= model->array_offset + array_size) || (idx < model->array_offset)) { + if((idx >= (uint32_t)model->array_offset + array_size) || + (idx < (uint32_t)model->array_offset)) { return false; } @@ -20,12 +21,14 @@ void archive_update_offset(ArchiveBrowserView* browser) { browser->view, (ArchiveBrowserViewModel * model) { uint16_t bounds = model->item_cnt > 3 ? 2 : model->item_cnt; - if(model->item_cnt > 3 && model->item_idx >= model->item_cnt - 1) { + if((model->item_cnt > 3u) && ((uint32_t)model->item_idx >= (model->item_cnt - 1))) { model->list_offset = model->item_idx - 3; } else if(model->list_offset < model->item_idx - bounds) { - model->list_offset = CLAMP(model->item_idx - 2, model->item_cnt - bounds, 0); + model->list_offset = + CLAMP((uint32_t)model->item_idx - 2, model->item_cnt - bounds, 0u); } else if(model->list_offset > model->item_idx - bounds) { - model->list_offset = CLAMP(model->item_idx - 1, model->item_cnt - bounds, 0); + model->list_offset = + CLAMP((uint32_t)model->item_idx - 1, model->item_cnt - bounds, 0u); } return true; @@ -77,7 +80,7 @@ void archive_set_item_count(ArchiveBrowserView* browser, uint32_t count) { with_view_model( browser->view, (ArchiveBrowserViewModel * model) { model->item_cnt = count; - model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0); + model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u); return false; }); archive_update_offset(browser); @@ -94,7 +97,7 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) { model->item_idx - model->array_offset, model->item_idx - model->array_offset + 1); model->item_cnt--; - model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0); + model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u); items_cnt = model->item_cnt; return false; }); @@ -113,14 +116,14 @@ void archive_file_array_swap(ArchiveBrowserView* browser, int8_t dir) { browser->view, (ArchiveBrowserViewModel * model) { ArchiveFile_t temp; size_t array_size = files_array_size(model->files) - 1; - uint8_t swap_idx = CLAMP(model->item_idx + dir, array_size, 0); + uint8_t swap_idx = CLAMP((size_t)(model->item_idx + dir), array_size, 0u); if(model->item_idx == 0 && dir < 0) { ArchiveFile_t_init(&temp); files_array_pop_at(&temp, model->files, array_size); files_array_push_at(model->files, model->item_idx, temp); ArchiveFile_t_clear(&temp); - } else if(model->item_idx == array_size && dir > 0) { + } else if(((uint32_t)model->item_idx == array_size) && (dir > 0)) { ArchiveFile_t_init(&temp); files_array_pop_at(&temp, model->files, 0); files_array_push_at(model->files, array_size, temp); @@ -157,7 +160,7 @@ bool archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) { } else { offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1; } - offset_new = CLAMP(offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0); + offset_new = CLAMP((uint32_t)offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0u); } return false; }); @@ -196,7 +199,7 @@ ArchiveFile_t* archive_get_file_at(ArchiveBrowserView* browser, size_t idx) { with_view_model( browser->view, (ArchiveBrowserViewModel * model) { - idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0); + idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0u); selected = files_array_size(model->files) ? files_array_get(model->files, idx) : NULL; return false; }); @@ -247,6 +250,7 @@ void archive_set_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) { }); } void archive_set_last_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) { + UNUSED(tab); // FIXME? furi_assert(browser); with_view_model( diff --git a/applications/archive/helpers/archive_browser.h b/applications/archive/helpers/archive_browser.h index 593a9be0..3395541e 100644 --- a/applications/archive/helpers/archive_browser.h +++ b/applications/archive/helpers/archive_browser.h @@ -42,7 +42,7 @@ static const ArchiveFileTypeEnum known_type[] = { [ArchiveTabBrowser] = ArchiveFileTypeUnknown, }; -static inline const ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) { +static inline ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) { return known_type[tab]; } diff --git a/applications/archive/helpers/archive_files.c b/applications/archive/helpers/archive_files.c index 156e66f5..3b1e8944 100644 --- a/applications/archive/helpers/archive_files.c +++ b/applications/archive/helpers/archive_files.c @@ -54,7 +54,7 @@ void archive_set_file_type(ArchiveFile_t* file, FileInfo* file_info, const char* } else { furi_assert(file_info); - for(size_t i = 0; i < SIZEOF_ARRAY(known_ext); i++) { + for(size_t i = 0; i < COUNT_OF(known_ext); i++) { if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue; if(string_search_str(file->name, known_ext[i], 0) != STRING_FAILURE) { if(i == ArchiveFileTypeBadUsb) { diff --git a/applications/archive/scenes/archive_scene_browser.c b/applications/archive/scenes/archive_scene_browser.c index 0091bc99..9df3463b 100644 --- a/applications/archive/scenes/archive_scene_browser.c +++ b/applications/archive/scenes/archive_scene_browser.c @@ -31,6 +31,7 @@ static void archive_loader_callback(const void* message, void* context) { } static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected) { + UNUSED(browser); Loader* loader = furi_record_open("loader"); LoaderStatus status; diff --git a/applications/archive/views/archive_browser_view.c b/applications/archive/views/archive_browser_view.c index ed75621d..dc6962f2 100644 --- a/applications/archive/views/archive_browser_view.c +++ b/applications/archive/views/archive_browser_view.c @@ -106,17 +106,17 @@ static void draw_list(Canvas* canvas, ArchiveBrowserViewModel* model) { size_t array_size = files_array_size(model->files); bool scrollbar = model->item_cnt > 4; - for(size_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) { + for(uint32_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) { string_t str_buff; char cstr_buff[MAX_NAME_LEN]; - size_t idx = CLAMP(i + model->list_offset, model->item_cnt, 0); + int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u); uint8_t x_offset = (model->move_fav && model->item_idx == idx) ? MOVE_OFFSET : 0; ArchiveFileTypeEnum file_type = ArchiveFileTypeLoading; if(archive_is_item_in_array(model, idx)) { - ArchiveFile_t* file = - files_array_get(model->files, CLAMP(idx - model->array_offset, array_size - 1, 0)); + ArchiveFile_t* file = files_array_get( + model->files, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0)); strlcpy(cstr_buff, string_get_cstr(file->name), string_size(file->name) + 1); archive_trim_file_path(cstr_buff, archive_is_known_app(file->type)); string_init_set_str(str_buff, cstr_buff); @@ -216,7 +216,7 @@ static bool is_file_list_load_required(ArchiveBrowserViewModel* model) { } if(((model->array_offset + array_size) < model->item_cnt) && - (model->item_idx > (model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) { + (model->item_idx > (int32_t)(model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) { return true; } @@ -376,4 +376,4 @@ void browser_free(ArchiveBrowserView* browser) { view_free(browser->view); free(browser); -} \ No newline at end of file +} diff --git a/applications/archive/views/archive_browser_view.h b/applications/archive/views/archive_browser_view.h index 3aabe962..db079d6b 100644 --- a/applications/archive/views/archive_browser_view.h +++ b/applications/archive/views/archive_browser_view.h @@ -13,8 +13,8 @@ #define MAX_NAME_LEN 255 #define MAX_EXT_LEN 6 #define FRAME_HEIGHT 12 -#define MENU_ITEMS 4 -#define MOVE_OFFSET 5 +#define MENU_ITEMS 4u +#define MOVE_OFFSET 5u typedef enum { ArchiveTabFavorites, diff --git a/applications/bad_usb/scenes/bad_usb_scene_file_select.c b/applications/bad_usb/scenes/bad_usb_scene_file_select.c index b1ab3194..82f03bab 100644 --- a/applications/bad_usb/scenes/bad_usb_scene_file_select.c +++ b/applications/bad_usb/scenes/bad_usb_scene_file_select.c @@ -31,10 +31,13 @@ void bad_usb_scene_file_select_on_enter(void* context) { } bool bad_usb_scene_file_select_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); // BadUsbApp* bad_usb = context; return false; } void bad_usb_scene_file_select_on_exit(void* context) { + UNUSED(context); // BadUsbApp* bad_usb = context; } diff --git a/applications/bad_usb/views/bad_usb_view.c b/applications/bad_usb/views/bad_usb_view.c index 22e5143d..5b6fe6e8 100644 --- a/applications/bad_usb/views/bad_usb_view.c +++ b/applications/bad_usb/views/bad_usb_view.c @@ -142,6 +142,7 @@ void bad_usb_set_ok_callback(BadUsb* bad_usb, BadUsbOkCallback callback, void* c furi_assert(callback); with_view_model( bad_usb->view, (BadUsbModel * model) { + UNUSED(model); bad_usb->callback = callback; bad_usb->context = context; return true; diff --git a/applications/bt/bt_cli.c b/applications/bt/bt_cli.c index 64d69a12..122eedf9 100644 --- a/applications/bt/bt_cli.c +++ b/applications/bt/bt_cli.c @@ -13,6 +13,9 @@ static const char* bt_cli_address_types[] = { }; static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); string_t buffer; string_init(buffer); furi_hal_bt_dump_state(buffer); @@ -21,6 +24,7 @@ static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) { } static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int power = 0; @@ -47,6 +51,7 @@ static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; do { @@ -72,6 +77,7 @@ static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int pattern = 0; int datarate = 1; @@ -115,6 +121,7 @@ static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_packet_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int datarate = 1; @@ -152,6 +159,8 @@ static void bt_cli_scan_callback(GapAddress address, void* context) { } static void bt_cli_command_scan(Cli* cli, string_t args, void* context) { + UNUSED(context); + UNUSED(args); osMessageQueueId_t queue = osMessageQueueNew(20, sizeof(GapAddress), NULL); furi_hal_bt_start_scan(bt_cli_scan_callback, queue); @@ -189,6 +198,7 @@ static void bt_cli_print_usage() { } static void bt_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); furi_record_open("bt"); string_t cmd; diff --git a/applications/bt/bt_debug_app/bt_debug_app.c b/applications/bt/bt_debug_app/bt_debug_app.c index a4363b91..58119f5d 100644 --- a/applications/bt/bt_debug_app/bt_debug_app.c +++ b/applications/bt/bt_debug_app/bt_debug_app.c @@ -19,10 +19,12 @@ void bt_debug_submenu_callback(void* context, uint32_t index) { } uint32_t bt_debug_exit(void* context) { + UNUSED(context); return VIEW_NONE; } uint32_t bt_debug_start_view(void* context) { + UNUSED(context); return BtDebugAppViewSubmenu; } @@ -94,6 +96,7 @@ void bt_debug_app_free(BtDebugApp* app) { } int32_t bt_debug_app(void* p) { + UNUSED(p); if(furi_hal_bt_get_radio_stack() != FuriHalBtStackHciLayer) { FURI_LOG_E(TAG, "Incorrect radio stack, replace with HciLayer for tests."); DialogsApp* dialogs = furi_record_open("dialogs"); diff --git a/applications/bt/bt_debug_app/views/bt_carrier_test.c b/applications/bt/bt_debug_app/views/bt_carrier_test.c index 22b80cd8..0e0b3792 100755 --- a/applications/bt/bt_debug_app/views/bt_carrier_test.c +++ b/applications/bt/bt_debug_app/views/bt_carrier_test.c @@ -141,7 +141,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Mode", - SIZEOF_ARRAY(bt_param_mode), + COUNT_OF(bt_param_mode), bt_carrier_test_mode_changed, bt_carrier_test); bt_test_set_current_value_index(param, 0); @@ -151,7 +151,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Channel", - SIZEOF_ARRAY(bt_param_channel), + COUNT_OF(bt_param_channel), bt_carrier_test_channel_changed, bt_carrier_test); bt_test_set_current_value_index(param, 0); @@ -162,7 +162,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Power", - SIZEOF_ARRAY(bt_param_power), + COUNT_OF(bt_param_power), bt_carrier_test_param_channel, bt_carrier_test); bt_test_set_current_value_index(param, 0); diff --git a/applications/bt/bt_debug_app/views/bt_packet_test.c b/applications/bt/bt_debug_app/views/bt_packet_test.c index e9d3883a..e9b3bd75 100644 --- a/applications/bt/bt_debug_app/views/bt_packet_test.c +++ b/applications/bt/bt_debug_app/views/bt_packet_test.c @@ -109,7 +109,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Mode", - SIZEOF_ARRAY(bt_param_mode), + COUNT_OF(bt_param_mode), bt_packet_test_mode_changed, bt_packet_test); bt_test_set_current_value_index(param, 0); @@ -119,7 +119,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Channel", - SIZEOF_ARRAY(bt_param_channel), + COUNT_OF(bt_param_channel), bt_packet_test_channel_changed, bt_packet_test); bt_test_set_current_value_index(param, 0); @@ -129,7 +129,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Data rate", - SIZEOF_ARRAY(bt_param_data_rate), + COUNT_OF(bt_param_data_rate), bt_packet_test_param_channel, bt_packet_test); bt_test_set_current_value_index(param, 0); diff --git a/applications/bt/bt_hid_app/bt_hid.c b/applications/bt/bt_hid_app/bt_hid.c index ab13f6f3..4b1037cd 100755 --- a/applications/bt/bt_hid_app/bt_hid.c +++ b/applications/bt/bt_hid_app/bt_hid.c @@ -33,10 +33,12 @@ void bt_hid_dialog_callback(DialogExResult result, void* context) { } uint32_t bt_hid_exit_confirm_view(void* context) { + UNUSED(context); return BtHidViewExitConfirm; } uint32_t bt_hid_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -139,6 +141,7 @@ void bt_hid_app_free(BtHid* app) { } int32_t bt_hid_app(void* p) { + UNUSED(p); // Switch profile to Hid BtHid* app = bt_hid_app_alloc(); bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app); diff --git a/applications/bt/bt_settings_app/bt_settings_app.c b/applications/bt/bt_settings_app/bt_settings_app.c index d9dfa74d..cb55e931 100755 --- a/applications/bt/bt_settings_app/bt_settings_app.c +++ b/applications/bt/bt_settings_app/bt_settings_app.c @@ -76,6 +76,7 @@ void bt_settings_app_free(BtSettingsApp* app) { } extern int32_t bt_settings_app(void* p) { + UNUSED(p); BtSettingsApp* app = bt_settings_app_alloc(); view_dispatcher_run(app->view_dispatcher); bt_settings_save(&app->settings); diff --git a/applications/cli/cli.c b/applications/cli/cli.c index 4e200d6b..eefbb305 100644 --- a/applications/cli/cli.c +++ b/applications/cli/cli.c @@ -130,10 +130,12 @@ void cli_motd() { } void cli_nl(Cli* cli) { + UNUSED(cli); printf("\r\n"); } void cli_prompt(Cli* cli) { + UNUSED(cli); printf("\r\n>: %s", string_get_cstr(cli->line)); fflush(stdout); } @@ -451,6 +453,7 @@ void cli_session_close(Cli* cli) { } int32_t cli_srv(void* p) { + UNUSED(p); Cli* cli = cli_alloc(); // Init basic cli commands diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index bdec231b..2d059bd3 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -12,6 +12,8 @@ #define CLI_DATE_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %d" void cli_command_device_info_callback(const char* key, const char* value, bool last, void* context) { + UNUSED(context); + UNUSED(last); printf("%-24s: %s\r\n", key, value); } @@ -20,11 +22,14 @@ void cli_command_device_info_callback(const char* key, const char* value, bool l * This command is intended to be used by humans */ void cli_command_device_info(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); furi_hal_info_get(cli_command_device_info_callback, context); } void cli_command_help(Cli* cli, string_t args, void* context) { - (void)args; + UNUSED(args); + UNUSED(context); printf("Commands we have:"); // Command count @@ -62,6 +67,9 @@ void cli_command_help(Cli* cli, string_t args, void* context) { } void cli_command_date(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); + FuriHalRtcDateTime datetime = {0}; if(string_size(args) > 0) { @@ -135,6 +143,8 @@ void cli_command_log_tx_callback(const uint8_t* buffer, size_t size, void* conte } void cli_command_log(Cli* cli, string_t args, void* context) { + UNUSED(args); + UNUSED(context); StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1); uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE]; @@ -152,6 +162,8 @@ void cli_command_log(Cli* cli, string_t args, void* context) { } void cli_command_vibro(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); if(!string_cmp(args, "0")) { NotificationApp* notification = furi_record_open("notification"); notification_message_block(notification, &sequence_reset_vibro); @@ -166,6 +178,8 @@ void cli_command_vibro(Cli* cli, string_t args, void* context) { } void cli_command_debug(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); if(!string_cmp(args, "0")) { furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug); loader_update_menu(); @@ -180,6 +194,8 @@ void cli_command_debug(Cli* cli, string_t args, void* context) { } void cli_command_led(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); // Get first word as light name NotificationMessage notification_led_message; string_t light_name; @@ -233,6 +249,7 @@ void cli_command_led(Cli* cli, string_t args, void* context) { } void cli_command_gpio_set(Cli* cli, string_t args, void* context) { + UNUSED(context); char pin_names[][4] = { "PC0", "PC1", @@ -313,6 +330,8 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) { return; } } +#else + UNUSED(cli); #endif LL_GPIO_SetPinMode(gpio[num].port, gpio[num].pin, LL_GPIO_MODE_OUTPUT); @@ -325,6 +344,10 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) { } void cli_command_ps(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + const uint8_t threads_num_max = 32; osThreadId_t threads_id[threads_num_max]; uint8_t thread_num = osThreadEnumerate(threads_id, threads_num_max); @@ -344,6 +367,10 @@ void cli_command_ps(Cli* cli, string_t args, void* context) { } void cli_command_free(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + printf("Free heap size: %d\r\n", memmgr_get_free_heap()); printf("Total heap size: %d\r\n", memmgr_get_total_heap()); printf("Minimum heap size: %d\r\n", memmgr_get_minimum_free_heap()); @@ -351,10 +378,18 @@ void cli_command_free(Cli* cli, string_t args, void* context) { } void cli_command_free_blocks(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + memmgr_heap_printf_free_blocks(); } void cli_command_i2c(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + furi_hal_i2c_acquire(&furi_hal_i2c_handle_external); printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n" "Clock: 100khz, 7bit address\r\n" @@ -391,4 +426,4 @@ void cli_commands_init(Cli* cli) { cli_add_command(cli, "led", CliCommandFlagDefault, cli_command_led, NULL); cli_add_command(cli, "gpio_set", CliCommandFlagDefault, cli_command_gpio_set, NULL); cli_add_command(cli, "i2c", CliCommandFlagDefault, cli_command_i2c, NULL); -} +} \ No newline at end of file diff --git a/applications/cli/cli_commands.h b/applications/cli/cli_commands.h index b82dae29..184eeb37 100644 --- a/applications/cli/cli_commands.h +++ b/applications/cli/cli_commands.h @@ -2,4 +2,4 @@ #include "cli_i.h" -void cli_commands_init(Cli* cli); \ No newline at end of file +void cli_commands_init(Cli* cli); diff --git a/applications/cli/cli_vcp.c b/applications/cli/cli_vcp.c index f570aee1..84edca18 100644 --- a/applications/cli/cli_vcp.c +++ b/applications/cli/cli_vcp.c @@ -86,6 +86,7 @@ static void cli_vcp_deinit() { } static int32_t vcp_worker(void* context) { + UNUSED(context); bool tx_idle = true; size_t missed_rx = 0; uint8_t last_tx_pkt_len = 0; @@ -148,7 +149,7 @@ static int32_t vcp_worker(void* context) { if(len > 0) { furi_check( xStreamBufferSend(vcp->rx_stream, vcp->data_buffer, len, osWaitForever) == - len); + (size_t)len); } } else { #ifdef CLI_VCP_DEBUG @@ -275,16 +276,19 @@ static void cli_vcp_tx(const uint8_t* buffer, size_t size) { } static void cli_vcp_tx_stdout(void* _cookie, const char* data, size_t size) { + UNUSED(_cookie); cli_vcp_tx((const uint8_t*)data, size); } static void vcp_state_callback(void* context, uint8_t state) { + UNUSED(context); if(state == 0) { osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtDisconnect); } } static void vcp_on_cdc_control_line(void* context, uint8_t state) { + UNUSED(context); // bit 0: DTR state, bit 1: RTS state bool dtr = state & (1 << 0); @@ -296,11 +300,13 @@ static void vcp_on_cdc_control_line(void* context, uint8_t state) { } static void vcp_on_cdc_rx(void* context) { + UNUSED(context); uint32_t ret = osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtRx); furi_check((ret & osFlagsError) == 0); } static void vcp_on_cdc_tx_complete(void* context) { + UNUSED(context); osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtTx); } diff --git a/applications/crypto/crypto_cli.c b/applications/crypto/crypto_cli.c index 7cd9d5cc..a5ea80f8 100644 --- a/applications/crypto/crypto_cli.c +++ b/applications/crypto/crypto_cli.c @@ -164,6 +164,7 @@ void crypto_cli_decrypt(Cli* cli, string_t args) { } void crypto_cli_has_key(Cli* cli, string_t args) { + UNUSED(cli); int key_slot = 0; uint8_t iv[16]; @@ -185,6 +186,7 @@ void crypto_cli_has_key(Cli* cli, string_t args) { } void crypto_cli_store_key(Cli* cli, string_t args) { + UNUSED(cli); int key_slot = 0; int key_size = 0; string_t key_type; @@ -277,6 +279,7 @@ void crypto_cli_store_key(Cli* cli, string_t args) { } static void crypto_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/debug_tools/blink_test.c b/applications/debug_tools/blink_test.c index 35f9f434..2efaa4da 100644 --- a/applications/debug_tools/blink_test.c +++ b/applications/debug_tools/blink_test.c @@ -27,6 +27,7 @@ static void blink_test_update(void* ctx) { } static void blink_test_draw_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 2, 10, "Blink application"); @@ -41,6 +42,7 @@ static void blink_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t blink_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(BlinkEvent), NULL); // Configure view port diff --git a/applications/debug_tools/display_test/display_test.c b/applications/debug_tools/display_test/display_test.c index 1a9a0e43..95aea1de 100644 --- a/applications/debug_tools/display_test/display_test.c +++ b/applications/debug_tools/display_test/display_test.c @@ -70,10 +70,12 @@ static void display_test_submenu_callback(void* context, uint32_t index) { } static uint32_t display_test_previous_callback(void* context) { + UNUSED(context); return DisplayTestViewSubmenu; } static uint32_t display_test_exit_callback(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -210,6 +212,7 @@ void display_test_free(DisplayTest* instance) { } int32_t display_test_run(DisplayTest* instance) { + UNUSED(instance); view_dispatcher_switch_to_view(instance->view_dispatcher, DisplayTestViewSubmenu); view_dispatcher_run(instance->view_dispatcher); @@ -217,6 +220,8 @@ int32_t display_test_run(DisplayTest* instance) { } int32_t display_test_app(void* p) { + UNUSED(p); + DisplayTest* instance = display_test_alloc(); int32_t ret = display_test_run(instance); diff --git a/applications/debug_tools/display_test/view_display_test.c b/applications/debug_tools/display_test/view_display_test.c index cc5f5dcf..133195d0 100644 --- a/applications/debug_tools/display_test/view_display_test.c +++ b/applications/debug_tools/display_test/view_display_test.c @@ -13,6 +13,7 @@ struct ViewDisplayTest { }; static void view_display_test_draw_callback_intro(Canvas* canvas, void* _model) { + UNUSED(_model); canvas_draw_str(canvas, 12, 24, "Use < and > to switch tests"); canvas_draw_str(canvas, 12, 36, "Use ^ and v to switch size"); canvas_draw_str(canvas, 32, 48, "Use (o) to flip"); diff --git a/applications/debug_tools/keypad_test.c b/applications/debug_tools/keypad_test.c index ae980317..705a1542 100644 --- a/applications/debug_tools/keypad_test.c +++ b/applications/debug_tools/keypad_test.c @@ -60,6 +60,7 @@ static void keypad_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t keypad_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL); furi_check(event_queue); diff --git a/applications/debug_tools/text_box_test.c b/applications/debug_tools/text_box_test.c index 1c7ce18b..bc56e88b 100644 --- a/applications/debug_tools/text_box_test.c +++ b/applications/debug_tools/text_box_test.c @@ -70,6 +70,7 @@ static void text_box_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t text_box_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL); furi_check(event_queue); @@ -90,7 +91,7 @@ int32_t text_box_test_app(void* p) { Gui* gui = furi_record_open("gui"); gui_add_view_port(gui, view_port, GuiLayerFullscreen); - uint32_t test_renders_num = SIZEOF_ARRAY(text_box_test_render); + uint32_t test_renders_num = COUNT_OF(text_box_test_render); InputEvent event; while(osMessageQueueGet(event_queue, &event, NULL, osWaitForever) == osOK) { TextBoxTestState* state = acquire_mutex_block(&state_mutex); diff --git a/applications/debug_tools/uart_echo.c b/applications/debug_tools/uart_echo.c index 0e4ee1d8..206c6c06 100644 --- a/applications/debug_tools/uart_echo.c +++ b/applications/debug_tools/uart_echo.c @@ -80,11 +80,13 @@ static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) { } static bool uart_echo_view_input_callback(InputEvent* event, void* context) { - bool consumed = false; - return consumed; + UNUSED(event); + UNUSED(context); + return false; } static uint32_t uart_echo_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -170,7 +172,10 @@ static int32_t uart_echo_worker(void* context) { notification_message(app->notification, &sequence_notification); with_view_model( - app->view, (UartDumpModel * model) { return true; }); + app->view, (UartDumpModel * model) { + UNUSED(model); + return true; + }); } } @@ -261,6 +266,7 @@ static void uart_echo_app_free(UartEchoApp* app) { } int32_t uart_echo_app(void* p) { + UNUSED(p); UartEchoApp* app = uart_echo_app_alloc(); view_dispatcher_run(app->view_dispatcher); uart_echo_app_free(app); diff --git a/applications/debug_tools/usb_mouse.c b/applications/debug_tools/usb_mouse.c index 6943e189..a136375a 100644 --- a/applications/debug_tools/usb_mouse.c +++ b/applications/debug_tools/usb_mouse.c @@ -18,6 +18,7 @@ typedef struct { } UsbMouseEvent; static void usb_mouse_render_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); @@ -37,6 +38,7 @@ static void usb_mouse_input_callback(InputEvent* input_event, void* ctx) { } int32_t usb_mouse_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(UsbMouseEvent), NULL); furi_check(event_queue); ViewPort* view_port = view_port_alloc(); diff --git a/applications/debug_tools/usb_test.c b/applications/debug_tools/usb_test.c index 0e8f068f..44a17ceb 100644 --- a/applications/debug_tools/usb_test.c +++ b/applications/debug_tools/usb_test.c @@ -51,6 +51,7 @@ void usb_test_submenu_callback(void* context, uint32_t index) { } uint32_t usb_test_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -113,6 +114,7 @@ void usb_test_app_free(UsbTestApp* app) { } int32_t usb_test_app(void* p) { + UNUSED(p); UsbTestApp* app = usb_test_app_alloc(); view_dispatcher_run(app->view_dispatcher); diff --git a/applications/debug_tools/vibro_test.c b/applications/debug_tools/vibro_test.c index 07ce93b7..af6d336d 100644 --- a/applications/debug_tools/vibro_test.c +++ b/applications/debug_tools/vibro_test.c @@ -6,6 +6,7 @@ #include void vibro_test_draw_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 2, 10, "Vibro application"); @@ -22,6 +23,7 @@ void vibro_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t vibro_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(InputEvent), NULL); // Configure view port diff --git a/applications/desktop/animations/animation_manager.c b/applications/desktop/animations/animation_manager.c index ea241ec3..f8e93716 100644 --- a/applications/desktop/animations/animation_manager.c +++ b/applications/desktop/animations/animation_manager.c @@ -364,6 +364,7 @@ static bool animation_manager_is_valid_idle_animation( static StorageAnimation* animation_manager_select_idle_animation(AnimationManager* animation_manager) { + UNUSED(animation_manager); StorageAnimationList_t animation_list; StorageAnimationList_init(animation_list); animation_storage_fill_animation_list(&animation_list); diff --git a/applications/desktop/animations/animation_storage.c b/applications/desktop/animations/animation_storage.c index aa0f274b..8f2740a7 100644 --- a/applications/desktop/animations/animation_storage.c +++ b/applications/desktop/animations/animation_storage.c @@ -130,7 +130,7 @@ void animation_storage_fill_animation_list(StorageAnimationList_t* animation_lis flipper_format_free(file); // add hard-coded animations - for(int i = 0; i < dolphin_internal_size; ++i) { + for(size_t i = 0; i < dolphin_internal_size; ++i) { StorageAnimationList_push_back(*animation_list, (StorageAnimation*)&dolphin_internal[i]); } @@ -142,7 +142,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) { furi_assert(strlen(name)); StorageAnimation* storage_animation = NULL; - for(int i = 0; i < dolphin_blocking_size; ++i) { + for(size_t i = 0; i < dolphin_blocking_size; ++i) { if(!strcmp(dolphin_blocking[i].manifest_info.name, name)) { storage_animation = (StorageAnimation*)&dolphin_blocking[i]; break; @@ -150,7 +150,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) { } if(!storage_animation) { - for(int i = 0; i < dolphin_internal_size; ++i) { + for(size_t i = 0; i < dolphin_internal_size; ++i) { if(!strcmp(dolphin_internal[i].manifest_info.name, name)) { storage_animation = (StorageAnimation*)&dolphin_internal[i]; break; @@ -365,7 +365,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo animation->frame_bubble_sequences = malloc(sizeof(FrameBubble*) * animation->frame_bubble_sequences_count); - uint32_t current_slot = 0; + int32_t current_slot = 0; for(int i = 0; i < animation->frame_bubble_sequences_count; ++i) { FURI_CONST_ASSIGN_PTR( animation->frame_bubble_sequences[i], malloc(sizeof(FrameBubble))); @@ -374,7 +374,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo const FrameBubble* bubble = animation->frame_bubble_sequences[0]; int8_t index = -1; for(;;) { - if(!flipper_format_read_uint32(ff, "Slot", ¤t_slot, 1)) break; + if(!flipper_format_read_int32(ff, "Slot", ¤t_slot, 1)) break; if((current_slot != 0) && (index == -1)) break; if(current_slot == index) { diff --git a/applications/desktop/desktop.c b/applications/desktop/desktop.c index 7686a145..34c169e0 100644 --- a/applications/desktop/desktop.c +++ b/applications/desktop/desktop.c @@ -33,6 +33,7 @@ static void desktop_loader_callback(const void* message, void* context) { } static void desktop_lock_icon_callback(Canvas* canvas, void* context) { + UNUSED(context); furi_assert(canvas); canvas_draw_icon(canvas, 0, 0, &I_Lock_8x8); } @@ -298,6 +299,7 @@ static bool desktop_is_first_start() { } int32_t desktop_srv(void* p) { + UNUSED(p); Desktop* desktop = desktop_alloc(); bool loaded = LOAD_DESKTOP_SETTINGS(&desktop->settings); diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c index 7486d4aa..c0b3190e 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c @@ -53,4 +53,5 @@ bool desktop_settings_scene_pin_disable_on_event(void* context, SceneManagerEven } void desktop_settings_scene_pin_disable_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c index 882b8f0a..a023d6b7 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c @@ -18,6 +18,7 @@ static void pin_error_back_callback(void* context) { } static void pin_error_done_callback(const PinCode* pin_code, void* context) { + UNUSED(pin_code); furi_assert(context); DesktopSettingsApp* app = context; view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_EXIT); diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c index 22727a7a..b8d630f2 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c @@ -41,4 +41,5 @@ bool desktop_settings_scene_pin_setup_howto_on_event(void* context, SceneManager } void desktop_settings_scene_pin_setup_howto_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_fault.c b/applications/desktop/scenes/desktop_scene_fault.c index b75b32aa..36c958af 100644 --- a/applications/desktop/scenes/desktop_scene_fault.c +++ b/applications/desktop/scenes/desktop_scene_fault.c @@ -47,5 +47,6 @@ bool desktop_scene_fault_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_fault_on_exit(void* context) { + UNUSED(context); furi_hal_rtc_set_fault_data(0); } diff --git a/applications/desktop/scenes/desktop_scene_first_start.c b/applications/desktop/scenes/desktop_scene_first_start.c index 9563094c..dbdf8919 100644 --- a/applications/desktop/scenes/desktop_scene_first_start.c +++ b/applications/desktop/scenes/desktop_scene_first_start.c @@ -50,4 +50,5 @@ bool desktop_scene_first_start_on_event(void* context, SceneManagerEvent event) } void desktop_scene_first_start_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_lock_menu.c b/applications/desktop/scenes/desktop_scene_lock_menu.c index 11478810..a86bb184 100644 --- a/applications/desktop/scenes/desktop_scene_lock_menu.c +++ b/applications/desktop/scenes/desktop_scene_lock_menu.c @@ -81,4 +81,5 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_lock_menu_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_locked.c b/applications/desktop/scenes/desktop_scene_locked.c index 90df2226..f4c08d32 100644 --- a/applications/desktop/scenes/desktop_scene_locked.c +++ b/applications/desktop/scenes/desktop_scene_locked.c @@ -109,4 +109,5 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_locked_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_pin_timeout.c b/applications/desktop/scenes/desktop_scene_pin_timeout.c index 3c267a0d..ebe825e6 100644 --- a/applications/desktop/scenes/desktop_scene_pin_timeout.c +++ b/applications/desktop/scenes/desktop_scene_pin_timeout.c @@ -43,4 +43,5 @@ bool desktop_scene_pin_timeout_on_event(void* context, SceneManagerEvent event) } void desktop_scene_pin_timeout_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/views/desktop_view_pin_timeout.c b/applications/desktop/views/desktop_view_pin_timeout.c index d9827339..6e1e807f 100644 --- a/applications/desktop/views/desktop_view_pin_timeout.c +++ b/applications/desktop/views/desktop_view_pin_timeout.c @@ -51,6 +51,8 @@ static void desktop_view_pin_timeout_timer_callback(TimerHandle_t timer) { } static bool desktop_view_pin_timeout_input(InputEvent* event, void* context) { + UNUSED(event); + UNUSED(context); return true; } diff --git a/applications/dialogs/dialogs.c b/applications/dialogs/dialogs.c index 2c8d2418..cf4a2ad6 100644 --- a/applications/dialogs/dialogs.c +++ b/applications/dialogs/dialogs.c @@ -11,6 +11,7 @@ static DialogsApp* dialogs_app_alloc() { } static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* message) { + UNUSED(app); switch(message->command) { case DialogsAppCommandFileOpen: message->return_data->bool_value = @@ -25,6 +26,7 @@ static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* mess } int32_t dialogs_srv(void* p) { + UNUSED(p); DialogsApp* app = dialogs_app_alloc(); furi_record_create("dialogs", app); diff --git a/applications/dialogs/dialogs.h b/applications/dialogs/dialogs.h index 2a05ef41..9c71c098 100644 --- a/applications/dialogs/dialogs.h +++ b/applications/dialogs/dialogs.h @@ -132,4 +132,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_api.c b/applications/dialogs/dialogs_api.c index 261d9d4e..c4efb287 100644 --- a/applications/dialogs/dialogs_api.c +++ b/applications/dialogs/dialogs_api.c @@ -70,4 +70,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te dialog_message_set_buttons(message, "Back", NULL, NULL); dialog_message_show(context, message); dialog_message_free(message); -} \ No newline at end of file +} diff --git a/applications/dialogs/dialogs_i.h b/applications/dialogs/dialogs_i.h index 7b601eda..b61e10ab 100644 --- a/applications/dialogs/dialogs_i.h +++ b/applications/dialogs/dialogs_i.h @@ -12,4 +12,4 @@ struct DialogsApp { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_message.h b/applications/dialogs/dialogs_message.h index 48324b15..d7b5fabf 100644 --- a/applications/dialogs/dialogs_message.h +++ b/applications/dialogs/dialogs_message.h @@ -43,4 +43,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_module_file_select.h b/applications/dialogs/dialogs_module_file_select.h index da012fb4..749fe9c1 100644 --- a/applications/dialogs/dialogs_module_file_select.h +++ b/applications/dialogs/dialogs_module_file_select.h @@ -9,4 +9,4 @@ bool dialogs_app_process_module_file_select(const DialogsAppMessageDataFileSelec #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_module_message.h b/applications/dialogs/dialogs_module_message.h index 189870ac..b4f1b162 100644 --- a/applications/dialogs/dialogs_module_message.h +++ b/applications/dialogs/dialogs_module_message.h @@ -9,4 +9,4 @@ DialogMessageButton dialogs_app_process_module_message(const DialogsAppMessageDa #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/view_holder.h b/applications/dialogs/view_holder.h index 785ad20a..8e7db3b8 100644 --- a/applications/dialogs/view_holder.h +++ b/applications/dialogs/view_holder.h @@ -95,4 +95,4 @@ void view_holder_update(View* view, void* context); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dolphin/dolphin.c b/applications/dolphin/dolphin.c index 60068aff..47960286 100644 --- a/applications/dolphin/dolphin.c +++ b/applications/dolphin/dolphin.c @@ -118,6 +118,7 @@ void dolphin_event_send_wait(Dolphin* dolphin, DolphinEvent* event) { } void dolphin_event_release(Dolphin* dolphin, DolphinEvent* event) { + UNUSED(dolphin); if(event->flag) { osEventFlagsSet(event->flag, DOLPHIN_LOCK_EVENT_FLAG); } @@ -149,6 +150,7 @@ static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin) { } int32_t dolphin_srv(void* p) { + UNUSED(p); Dolphin* dolphin = dolphin_alloc(); furi_record_create("dolphin", dolphin); diff --git a/applications/dolphin/helpers/dolphin_state.h b/applications/dolphin/helpers/dolphin_state.h index 07d0b427..3e02fb87 100644 --- a/applications/dolphin/helpers/dolphin_state.h +++ b/applications/dolphin/helpers/dolphin_state.h @@ -12,7 +12,7 @@ typedef struct { uint32_t flags; uint32_t icounter; - uint32_t butthurt; + int32_t butthurt; uint64_t timestamp; } DolphinStoreData; diff --git a/applications/dolphin/passport/passport.c b/applications/dolphin/passport/passport.c index 3df88a83..13bf086b 100644 --- a/applications/dolphin/passport/passport.c +++ b/applications/dolphin/passport/passport.c @@ -90,6 +90,7 @@ static void render_callback(Canvas* canvas, void* ctx) { } int32_t passport_app(void* p) { + UNUSED(p); osSemaphoreId_t semaphore = osSemaphoreNew(1, 0, NULL); furi_assert(semaphore); diff --git a/applications/gpio/gpio_app.c b/applications/gpio/gpio_app.c index 7dfce836..b5f5184a 100644 --- a/applications/gpio/gpio_app.c +++ b/applications/gpio/gpio_app.c @@ -95,6 +95,7 @@ void gpio_app_free(GpioApp* app) { } int32_t gpio_app(void* p) { + UNUSED(p); GpioApp* gpio_app = gpio_app_alloc(); view_dispatcher_run(gpio_app->view_dispatcher); diff --git a/applications/gpio/scenes/gpio_scene_test.c b/applications/gpio/scenes/gpio_scene_test.c index 009e2ff4..b015d809 100644 --- a/applications/gpio/scenes/gpio_scene_test.c +++ b/applications/gpio/scenes/gpio_scene_test.c @@ -19,9 +19,12 @@ void gpio_scene_test_on_enter(void* context) { } bool gpio_scene_test_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } void gpio_scene_test_on_exit(void* context) { + UNUSED(context); gpio_item_configure_all_pins(GpioModeAnalog); } diff --git a/applications/gpio/scenes/gpio_scene_usb_uart_config.c b/applications/gpio/scenes/gpio_scene_usb_uart_config.c index 6fba0d1e..653a306a 100644 --- a/applications/gpio/scenes/gpio_scene_usb_uart_config.c +++ b/applications/gpio/scenes/gpio_scene_usb_uart_config.c @@ -28,12 +28,9 @@ static const uint32_t baudrate_list[] = { }; bool gpio_scene_usb_uart_cfg_on_event(void* context, SceneManagerEvent event) { - //GpioApp* app = context; - bool consumed = false; - - if(event.type == SceneManagerEventTypeCustom) { - } - return consumed; + UNUSED(context); + UNUSED(event); + return false; } static void line_vcp_cb(VariableItem* item) { diff --git a/applications/gpio/usb_uart_bridge.c b/applications/gpio/usb_uart_bridge.c index 8f27340e..f70cf640 100644 --- a/applications/gpio/usb_uart_bridge.c +++ b/applications/gpio/usb_uart_bridge.c @@ -101,6 +101,7 @@ static void usb_uart_vcp_init(UsbUartBridge* usb_uart, uint8_t vcp_ch) { } static void usb_uart_vcp_deinit(UsbUartBridge* usb_uart, uint8_t vcp_ch) { + UNUSED(usb_uart); furi_hal_cdc_set_callbacks(vcp_ch, NULL, NULL); FURI_LOG_I("", "Deinit %d", vcp_ch); if(vcp_ch != 0) { @@ -120,6 +121,7 @@ static void usb_uart_serial_init(UsbUartBridge* usb_uart, uint8_t uart_ch) { } static void usb_uart_serial_deinit(UsbUartBridge* usb_uart, uint8_t uart_ch) { + UNUSED(usb_uart); furi_hal_uart_set_irq_cb(uart_ch, NULL, NULL); if(uart_ch == FuriHalUartIdUSART1) furi_hal_console_enable(); @@ -143,7 +145,7 @@ static void usb_uart_set_baudrate(UsbUartBridge* usb_uart, uint32_t baudrate) { static void usb_uart_update_ctrl_lines(UsbUartBridge* usb_uart) { if(usb_uart->cfg.flow_pins != 0) { - furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins)); uint8_t state = furi_hal_cdc_get_ctrl_line_state(usb_uart->cfg.vcp_ch); furi_hal_gpio_write(flow_pins[usb_uart->cfg.flow_pins - 1][0], !(state & USB_CDC_BIT_RTS)); @@ -171,7 +173,7 @@ static int32_t usb_uart_worker(void* context) { usb_uart_serial_init(usb_uart, usb_uart->cfg.uart_ch); usb_uart_set_baudrate(usb_uart, usb_uart->cfg.baudrate); if(usb_uart->cfg.flow_pins != 0) { - furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins)); furi_hal_gpio_init_simple( flow_pins[usb_uart->cfg.flow_pins - 1][0], GpioModeOutputPushPull); furi_hal_gpio_init_simple( @@ -238,9 +240,7 @@ static int32_t usb_uart_worker(void* context) { flow_pins[usb_uart->cfg.flow_pins - 1][1], GpioModeAnalog); } if(usb_uart->cfg_new.flow_pins != 0) { - furi_assert( - (usb_uart->cfg_new.flow_pins - 1) < - (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg_new.flow_pins - 1) < COUNT_OF(flow_pins)); furi_hal_gpio_init_simple( flow_pins[usb_uart->cfg_new.flow_pins - 1][0], GpioModeOutputPushPull); furi_hal_gpio_init_simple( @@ -318,14 +318,18 @@ static void vcp_on_cdc_rx(void* context) { } static void vcp_state_callback(void* context, uint8_t state) { + UNUSED(context); + UNUSED(state); } static void vcp_on_cdc_control_line(void* context, uint8_t state) { + UNUSED(state); UsbUartBridge* usb_uart = (UsbUartBridge*)context; osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtCtrlLineSet); } static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config) { + UNUSED(config); UsbUartBridge* usb_uart = (UsbUartBridge*)context; osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtLineCfgSet); } diff --git a/applications/gpio/views/gpio_test.c b/applications/gpio/views/gpio_test.c index cf05dafa..37c2f408 100755 --- a/applications/gpio/views/gpio_test.c +++ b/applications/gpio/views/gpio_test.c @@ -123,6 +123,7 @@ void gpio_test_set_ok_callback(GpioTest* gpio_test, GpioTestOkCallback callback, furi_assert(callback); with_view_model( gpio_test->view, (GpioTestModel * model) { + UNUSED(model); gpio_test->callback = callback; gpio_test->context = context; return false; diff --git a/applications/gpio/views/gpio_usb_uart.c b/applications/gpio/views/gpio_usb_uart.c index cd507570..d2d371b6 100644 --- a/applications/gpio/views/gpio_usb_uart.c +++ b/applications/gpio/views/gpio_usb_uart.c @@ -130,6 +130,7 @@ void gpio_usb_uart_set_callback(GpioUsbUart* usb_uart, GpioUsbUartCallback callb with_view_model( usb_uart->view, (GpioUsbUartModel * model) { + UNUSED(model); usb_uart->callback = callback; usb_uart->context = context; return false; diff --git a/applications/gui/gui.c b/applications/gui/gui.c index 9ecfdebb..4fc0935e 100644 --- a/applications/gui/gui.c +++ b/applications/gui/gui.c @@ -469,6 +469,7 @@ Gui* gui_alloc() { } int32_t gui_srv(void* p) { + UNUSED(p); Gui* gui = gui_alloc(); furi_record_create("gui", gui); diff --git a/applications/gui/icon.c b/applications/gui/icon.c index bbc77516..98f35b12 100644 --- a/applications/gui/icon.c +++ b/applications/gui/icon.c @@ -10,4 +10,4 @@ uint8_t icon_get_height(const Icon* instance) { const uint8_t* icon_get_data(const Icon* instance) { return instance->frames[0]; -} \ No newline at end of file +} diff --git a/applications/gui/icon.h b/applications/gui/icon.h index ebe40266..e33c4d34 100644 --- a/applications/gui/icon.h +++ b/applications/gui/icon.h @@ -39,4 +39,4 @@ const uint8_t* icon_get_data(const Icon* instance); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/button_menu.c b/applications/gui/modules/button_menu.c index 8f38efc4..36fd6f3a 100644 --- a/applications/gui/modules/button_menu.c +++ b/applications/gui/modules/button_menu.c @@ -331,7 +331,7 @@ void button_menu_set_selected_item(ButtonMenu* button_menu, uint32_t index) { ButtonMenuItemArray_it_t it; for(ButtonMenuItemArray_it(it, model->items); !ButtonMenuItemArray_end_p(it); ButtonMenuItemArray_next(it), ++item_position) { - if(ButtonMenuItemArray_cref(it)->index == index) { + if((uint32_t)ButtonMenuItemArray_cref(it)->index == index) { model->position = item_position; break; } diff --git a/applications/gui/modules/button_panel.c b/applications/gui/modules/button_panel.c index c2328d20..e3ae59a3 100644 --- a/applications/gui/modules/button_panel.c +++ b/applications/gui/modules/button_panel.c @@ -215,8 +215,8 @@ static void button_panel_view_draw_callback(Canvas* canvas, void* _model) { static void button_panel_process_down(ButtonPanel* button_panel) { with_view_model( button_panel->view, (ButtonPanelModel * model) { - size_t new_selected_item_x = model->selected_item_x; - size_t new_selected_item_y = model->selected_item_y; + uint16_t new_selected_item_x = model->selected_item_x; + uint16_t new_selected_item_y = model->selected_item_y; size_t i; if(new_selected_item_y >= (model->reserve_y - 1)) return false; @@ -291,8 +291,8 @@ static void button_panel_process_left(ButtonPanel* button_panel) { static void button_panel_process_right(ButtonPanel* button_panel) { with_view_model( button_panel->view, (ButtonPanelModel * model) { - size_t new_selected_item_x = model->selected_item_x; - size_t new_selected_item_y = model->selected_item_y; + uint16_t new_selected_item_x = model->selected_item_x; + uint16_t new_selected_item_y = model->selected_item_y; size_t i; if(new_selected_item_x >= (model->reserve_x - 1)) return false; diff --git a/applications/gui/modules/byte_input.h b/applications/gui/modules/byte_input.h index b2f94f3c..42c4b5d6 100644 --- a/applications/gui/modules/byte_input.h +++ b/applications/gui/modules/byte_input.h @@ -66,4 +66,4 @@ void byte_input_set_header_text(ByteInput* byte_input, const char* text); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/empty_screen.c b/applications/gui/modules/empty_screen.c index 61b4af36..0a51bc71 100644 --- a/applications/gui/modules/empty_screen.c +++ b/applications/gui/modules/empty_screen.c @@ -6,10 +6,13 @@ struct EmptyScreen { }; static void empty_screen_view_draw_callback(Canvas* canvas, void* _model) { + UNUSED(_model); canvas_clear(canvas); } static bool empty_screen_view_input_callback(InputEvent* event, void* context) { + UNUSED(event); + UNUSED(context); return false; } diff --git a/applications/gui/modules/empty_screen.h b/applications/gui/modules/empty_screen.h index 43d2fe04..23ebeb3a 100644 --- a/applications/gui/modules/empty_screen.h +++ b/applications/gui/modules/empty_screen.h @@ -38,4 +38,4 @@ View* empty_screen_get_view(EmptyScreen* empty_screen); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/file_select.h b/applications/gui/modules/file_select.h index 7318c87c..ed3d5b60 100644 --- a/applications/gui/modules/file_select.h +++ b/applications/gui/modules/file_select.h @@ -28,4 +28,4 @@ void file_select_set_selected_file(FileSelect* file_select, const char* filename #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/loading.c b/applications/gui/modules/loading.c index 7f623e24..60dc8338 100644 --- a/applications/gui/modules/loading.c +++ b/applications/gui/modules/loading.c @@ -34,6 +34,7 @@ static void loading_draw_callback(Canvas* canvas, void* _model) { } static bool loading_input_callback(InputEvent* event, void* context) { + UNUSED(event); furi_assert(context); return true; } diff --git a/applications/gui/modules/text_box.c b/applications/gui/modules/text_box.c index a7d0d763..52307ec2 100755 --- a/applications/gui/modules/text_box.c +++ b/applications/gui/modules/text_box.c @@ -87,7 +87,7 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) { model->scroll_num = line_num - 4; model->scroll_pos = line_num - 5; } else { - model->scroll_num = MAX(line_num - 4, 0); + model->scroll_num = MAX(line_num - 4, 0u); model->scroll_pos = 0; } } diff --git a/applications/gui/modules/text_input.c b/applications/gui/modules/text_input.c index 058762ad..04cd2d7f 100644 --- a/applications/gui/modules/text_input.c +++ b/applications/gui/modules/text_input.c @@ -122,15 +122,15 @@ static const TextInputKey* get_row(uint8_t row_index) { return row; } -static const char get_selected_char(TextInputModel* model) { +static char get_selected_char(TextInputModel* model) { return get_row(model->selected_row)[model->selected_column].text; } -static const bool char_is_lowercase(char letter) { +static bool char_is_lowercase(char letter) { return (letter >= 0x61 && letter <= 0x7A); } -static const char char_to_uppercase(const char letter) { +static char char_to_uppercase(const char letter) { if(isalpha(letter)) { return (letter - 0x20); } else { @@ -260,6 +260,7 @@ static void text_input_view_draw_callback(Canvas* canvas, void* _model) { } static void text_input_handle_up(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_row > 0) { model->selected_row--; if(model->selected_column > get_row_size(model->selected_row) - 6) { @@ -269,6 +270,7 @@ static void text_input_handle_up(TextInput* text_input, TextInputModel* model) { } static void text_input_handle_down(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_row < keyboard_row_count - 1) { model->selected_row++; if(model->selected_column > get_row_size(model->selected_row) - 4) { @@ -278,6 +280,7 @@ static void text_input_handle_down(TextInput* text_input, TextInputModel* model) } static void text_input_handle_left(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_column > 0) { model->selected_column--; } else { @@ -286,6 +289,7 @@ static void text_input_handle_left(TextInput* text_input, TextInputModel* model) } static void text_input_handle_right(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_column < get_row_size(model->selected_row) - 1) { model->selected_column++; } else { diff --git a/applications/gui/modules/validators.h b/applications/gui/modules/validators.h index 3a834a8a..15dbe901 100644 --- a/applications/gui/modules/validators.h +++ b/applications/gui/modules/validators.h @@ -19,4 +19,4 @@ bool validator_is_file_callback(const char* text, string_t error, void* context) #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/variable_item_list.c b/applications/gui/modules/variable_item_list.c index ebbdd434..4e5e4664 100644 --- a/applications/gui/modules/variable_item_list.c +++ b/applications/gui/modules/variable_item_list.c @@ -364,6 +364,7 @@ void variable_item_list_set_enter_callback( furi_assert(callback); with_view_model( variable_item_list->view, (VariableItemListModel * model) { + UNUSED(model); variable_item_list->callback = callback; variable_item_list->context = context; return false; diff --git a/applications/gui/view.c b/applications/gui/view.c index e9642d9b..ec73882d 100644 --- a/applications/gui/view.c +++ b/applications/gui/view.c @@ -126,6 +126,7 @@ void view_commit_model(View* view, bool update) { } void view_icon_animation_callback(IconAnimation* instance, void* context) { + UNUSED(instance); furi_assert(context); View* view = context; if(view->update_callback) { diff --git a/applications/ibutton/ibutton.cpp b/applications/ibutton/ibutton.cpp index 35dc2ce6..aae0d317 100644 --- a/applications/ibutton/ibutton.cpp +++ b/applications/ibutton/ibutton.cpp @@ -7,4 +7,4 @@ extern "C" int32_t ibutton_app(void* p) { delete app; return 255; -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_app.h b/applications/ibutton/ibutton_app.h index d3d8cac6..08af3857 100644 --- a/applications/ibutton/ibutton_app.h +++ b/applications/ibutton/ibutton_app.h @@ -141,4 +141,4 @@ private: bool load_key_data(string_t key_path); void make_app_folder(); -}; \ No newline at end of file +}; diff --git a/applications/ibutton/ibutton_cli.c b/applications/ibutton/ibutton_cli.c index c50ec210..4592cdad 100644 --- a/applications/ibutton/ibutton_cli.c +++ b/applications/ibutton/ibutton_cli.c @@ -240,6 +240,7 @@ void ibutton_cli_emulate(Cli* cli, string_t args) { }; static void ibutton_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); @@ -268,6 +269,7 @@ void onewire_cli_print_usage() { }; static void onewire_cli_search(Cli* cli) { + UNUSED(cli); OneWireHost* onewire = onewire_host_alloc(); uint8_t address[8]; bool done = false; @@ -297,6 +299,7 @@ static void onewire_cli_search(Cli* cli) { } void onewire_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); @@ -311,4 +314,4 @@ void onewire_cli(Cli* cli, string_t args, void* context) { } string_clear(cmd); -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_event.h b/applications/ibutton/ibutton_event.h index b4dac2f4..8b1775c1 100644 --- a/applications/ibutton/ibutton_event.h +++ b/applications/ibutton/ibutton_event.h @@ -24,6 +24,7 @@ public: // payload union { + uint32_t dummy; uint32_t menu_index; DialogExResult dialog_result; GuiButtonType widget_button_result; diff --git a/applications/ibutton/ibutton_view_manager.cpp b/applications/ibutton/ibutton_view_manager.cpp index efaa6f81..5a2c94f1 100755 --- a/applications/ibutton/ibutton_view_manager.cpp +++ b/applications/ibutton/ibutton_view_manager.cpp @@ -129,7 +129,7 @@ void iButtonAppViewManager::send_event(iButtonEvent* event) { furi_check(result == osOK); } -uint32_t iButtonAppViewManager::previous_view_callback(void* context) { +uint32_t iButtonAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { iButtonEvent event; event.type = iButtonEvent::Type::EventTypeBack; @@ -137,4 +137,4 @@ uint32_t iButtonAppViewManager::previous_view_callback(void* context) { } return VIEW_IGNORE; -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_view_manager.h b/applications/ibutton/ibutton_view_manager.h index 89d084ba..336ba6e2 100644 --- a/applications/ibutton/ibutton_view_manager.h +++ b/applications/ibutton/ibutton_view_manager.h @@ -48,4 +48,4 @@ private: Gui* gui; uint32_t previous_view_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_add_type.h b/applications/ibutton/scene/ibutton_scene_add_type.h index d49ac128..6a3d07e5 100644 --- a/applications/ibutton/scene/ibutton_scene_add_type.h +++ b/applications/ibutton/scene/ibutton_scene_add_type.h @@ -9,4 +9,4 @@ public: private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_add_value.cpp b/applications/ibutton/scene/ibutton_scene_add_value.cpp index cb1e287c..d0108ae5 100755 --- a/applications/ibutton/scene/ibutton_scene_add_value.cpp +++ b/applications/ibutton/scene/ibutton_scene_add_value.cpp @@ -50,4 +50,4 @@ void iButtonSceneAddValue::on_exit(iButtonApp* app) { byte_input_set_result_callback(byte_input, NULL, NULL, NULL, NULL, 0); byte_input_set_header_text(byte_input, {0}); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_add_value.h b/applications/ibutton/scene/ibutton_scene_add_value.h index ff6de577..7a734160 100644 --- a/applications/ibutton/scene/ibutton_scene_add_value.h +++ b/applications/ibutton/scene/ibutton_scene_add_value.h @@ -10,4 +10,4 @@ public: private: uint8_t new_key_data[IBUTTON_KEY_DATA_SIZE] = {}; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_delete_confirm.h b/applications/ibutton/scene/ibutton_scene_delete_confirm.h index d82c376d..cacbb7fe 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_delete_confirm.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_delete_success.cpp b/applications/ibutton/scene/ibutton_scene_delete_success.cpp index 8c645a5f..ba138161 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_delete_success.cpp @@ -44,4 +44,4 @@ void iButtonSceneDeleteSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_delete_success.h b/applications/ibutton/scene/ibutton_scene_delete_success.h index 0c17c7ed..1fbe5230 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_success.h +++ b/applications/ibutton/scene/ibutton_scene_delete_success.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_emulate.cpp b/applications/ibutton/scene/ibutton_scene_emulate.cpp index da6021fe..c00535f8 100644 --- a/applications/ibutton/scene/ibutton_scene_emulate.cpp +++ b/applications/ibutton/scene/ibutton_scene_emulate.cpp @@ -6,7 +6,10 @@ static void emulate_callback(void* context, bool emulated) { furi_assert(context); if(emulated) { iButtonApp* app = static_cast(context); - iButtonEvent event = {.type = iButtonEvent::Type::EventTypeWorkerEmulated}; + iButtonEvent event = { + .payload = {.worker_write_result = iButtonWorkerWriteOK}, + .type = iButtonEvent::Type::EventTypeWorkerEmulated, + }; app->get_view_manager()->send_event(&event); } } diff --git a/applications/ibutton/scene/ibutton_scene_emulate.h b/applications/ibutton/scene/ibutton_scene_emulate.h index c2bedcc5..61107b94 100644 --- a/applications/ibutton/scene/ibutton_scene_emulate.h +++ b/applications/ibutton/scene/ibutton_scene_emulate.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_exit_confirm.h b/applications/ibutton/scene/ibutton_scene_exit_confirm.h index dc5981e1..f621a59a 100644 --- a/applications/ibutton/scene/ibutton_scene_exit_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_exit_confirm.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_info.cpp b/applications/ibutton/scene/ibutton_scene_info.cpp index e51b2095..dd779789 100755 --- a/applications/ibutton/scene/ibutton_scene_info.cpp +++ b/applications/ibutton/scene/ibutton_scene_info.cpp @@ -44,9 +44,8 @@ void iButtonSceneInfo::on_enter(iButtonApp* app) { view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewWidget); } -bool iButtonSceneInfo::on_event(iButtonApp* app, iButtonEvent* event) { - bool consumed = false; - return consumed; +bool iButtonSceneInfo::on_event(iButtonApp*, iButtonEvent*) { + return false; } void iButtonSceneInfo::on_exit(iButtonApp* app) { diff --git a/applications/ibutton/scene/ibutton_scene_info.h b/applications/ibutton/scene/ibutton_scene_info.h index e2c6b2cf..bbfb0c60 100644 --- a/applications/ibutton/scene/ibutton_scene_info.h +++ b/applications/ibutton/scene/ibutton_scene_info.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read.cpp b/applications/ibutton/scene/ibutton_scene_read.cpp index 7162652d..1cfdbfe3 100644 --- a/applications/ibutton/scene/ibutton_scene_read.cpp +++ b/applications/ibutton/scene/ibutton_scene_read.cpp @@ -5,7 +5,10 @@ static void read_callback(void* context) { furi_assert(context); iButtonApp* app = static_cast(context); - iButtonEvent event = {.type = iButtonEvent::Type::EventTypeWorkerRead}; + iButtonEvent event = { + .payload = {.dummy = 0}, + .type = iButtonEvent::Type::EventTypeWorkerRead, + }; app->get_view_manager()->send_event(&event); } diff --git a/applications/ibutton/scene/ibutton_scene_read.h b/applications/ibutton/scene/ibutton_scene_read.h index b9fefb0c..56547778 100644 --- a/applications/ibutton/scene/ibutton_scene_read.h +++ b/applications/ibutton/scene/ibutton_scene_read.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp b/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp index 213266cb..d9d3ffd5 100644 --- a/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp +++ b/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp @@ -71,4 +71,4 @@ void iButtonSceneReadCRCError::on_exit(iButtonApp* app) { dialog_ex_set_context(dialog_ex, NULL); app->notify_red_off(); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_read_crc_error.h b/applications/ibutton/scene/ibutton_scene_read_crc_error.h index 43a4dfac..db72d068 100644 --- a/applications/ibutton/scene/ibutton_scene_read_crc_error.h +++ b/applications/ibutton/scene/ibutton_scene_read_crc_error.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_key_menu.h b/applications/ibutton/scene/ibutton_scene_read_key_menu.h index e85ad815..d68a4d1d 100644 --- a/applications/ibutton/scene/ibutton_scene_read_key_menu.h +++ b/applications/ibutton/scene/ibutton_scene_read_key_menu.h @@ -9,4 +9,4 @@ public: private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp b/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp index 7d0a235f..58ea853c 100644 --- a/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp +++ b/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp @@ -71,4 +71,4 @@ void iButtonSceneReadNotKeyError::on_exit(iButtonApp* app) { dialog_ex_set_context(dialog_ex, NULL); app->notify_red_off(); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_read_not_key_error.h b/applications/ibutton/scene/ibutton_scene_read_not_key_error.h index 6643a206..30d20033 100644 --- a/applications/ibutton/scene/ibutton_scene_read_not_key_error.h +++ b/applications/ibutton/scene/ibutton_scene_read_not_key_error.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_success.h b/applications/ibutton/scene/ibutton_scene_read_success.h index 9548d6b4..bf9003c2 100644 --- a/applications/ibutton/scene/ibutton_scene_read_success.h +++ b/applications/ibutton/scene/ibutton_scene_read_success.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_retry_confirm.h b/applications/ibutton/scene/ibutton_scene_retry_confirm.h index 2f96e13f..0fa71ad1 100644 --- a/applications/ibutton/scene/ibutton_scene_retry_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_retry_confirm.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_save_name.h b/applications/ibutton/scene/ibutton_scene_save_name.h index 8be593da..2d7f102e 100644 --- a/applications/ibutton/scene/ibutton_scene_save_name.h +++ b/applications/ibutton/scene/ibutton_scene_save_name.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_save_success.cpp b/applications/ibutton/scene/ibutton_scene_save_success.cpp index 13e173d2..92c0e695 100644 --- a/applications/ibutton/scene/ibutton_scene_save_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_save_success.cpp @@ -49,4 +49,4 @@ void iButtonSceneSaveSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_save_success.h b/applications/ibutton/scene/ibutton_scene_save_success.h index 95742bda..14c7412d 100644 --- a/applications/ibutton/scene/ibutton_scene_save_success.h +++ b/applications/ibutton/scene/ibutton_scene_save_success.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_saved_key_menu.h b/applications/ibutton/scene/ibutton_scene_saved_key_menu.h index 399ed1ce..08809779 100644 --- a/applications/ibutton/scene/ibutton_scene_saved_key_menu.h +++ b/applications/ibutton/scene/ibutton_scene_saved_key_menu.h @@ -9,4 +9,4 @@ public: private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_select_key.cpp b/applications/ibutton/scene/ibutton_scene_select_key.cpp index 1f1ece35..6a1246a4 100644 --- a/applications/ibutton/scene/ibutton_scene_select_key.cpp +++ b/applications/ibutton/scene/ibutton_scene_select_key.cpp @@ -10,9 +10,9 @@ void iButtonSceneSelectKey::on_enter(iButtonApp* app) { } } -bool iButtonSceneSelectKey::on_event(iButtonApp* app, iButtonEvent* event) { +bool iButtonSceneSelectKey::on_event(iButtonApp*, iButtonEvent*) { return false; } -void iButtonSceneSelectKey::on_exit(iButtonApp* app) { +void iButtonSceneSelectKey::on_exit(iButtonApp*) { } diff --git a/applications/ibutton/scene/ibutton_scene_select_key.h b/applications/ibutton/scene/ibutton_scene_select_key.h index 39e8d9a3..d6819909 100644 --- a/applications/ibutton/scene/ibutton_scene_select_key.h +++ b/applications/ibutton/scene/ibutton_scene_select_key.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_start.h b/applications/ibutton/scene/ibutton_scene_start.h index be1ce79f..28ef28d3 100644 --- a/applications/ibutton/scene/ibutton_scene_start.h +++ b/applications/ibutton/scene/ibutton_scene_start.h @@ -9,4 +9,4 @@ public: private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_write.cpp b/applications/ibutton/scene/ibutton_scene_write.cpp index 31da6dbe..d4f84e11 100644 --- a/applications/ibutton/scene/ibutton_scene_write.cpp +++ b/applications/ibutton/scene/ibutton_scene_write.cpp @@ -108,4 +108,4 @@ void iButtonSceneWrite::on_exit(iButtonApp* app) { popup_set_header(popup, NULL, 0, 0, AlignCenter, AlignBottom); popup_set_text(popup, NULL, 0, 0, AlignCenter, AlignTop); popup_set_icon(popup, 0, 0, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_write.h b/applications/ibutton/scene/ibutton_scene_write.h index bd99b377..8b52473a 100644 --- a/applications/ibutton/scene/ibutton_scene_write.h +++ b/applications/ibutton/scene/ibutton_scene_write.h @@ -9,4 +9,4 @@ public: private: bool blink_yellow; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_write_success.cpp b/applications/ibutton/scene/ibutton_scene_write_success.cpp index 39734704..3f27c672 100644 --- a/applications/ibutton/scene/ibutton_scene_write_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_write_success.cpp @@ -49,4 +49,4 @@ void iButtonSceneWriteSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_write_success.h b/applications/ibutton/scene/ibutton_scene_write_success.h index c6e76885..99680c7d 100644 --- a/applications/ibutton/scene/ibutton_scene_write_success.h +++ b/applications/ibutton/scene/ibutton_scene_write_success.h @@ -6,4 +6,4 @@ public: void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/infrared/cli/infrared_cli.cpp b/applications/infrared/cli/infrared_cli.cpp index 15de2d85..b60e4599 100644 --- a/applications/infrared/cli/infrared_cli.cpp +++ b/applications/infrared/cli/infrared_cli.cpp @@ -60,6 +60,8 @@ static void signal_received_callback(void* context, InfraredWorkerSignal* receiv } static void infrared_cli_start_ir_rx(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); InfraredWorker* worker = infrared_worker_alloc(); infrared_worker_rx_start(worker); infrared_worker_rx_set_received_signal_callback(worker, signal_received_callback, cli); @@ -140,6 +142,7 @@ static bool parse_signal_raw( } static void infrared_cli_start_ir_tx(Cli* cli, string_t args) { + UNUSED(cli); InfraredMessage message; const char* str = string_get_cstr(args); uint32_t frequency; @@ -160,6 +163,7 @@ static void infrared_cli_start_ir_tx(Cli* cli, string_t args) { } static void infrared_cli_start_ir(Cli* cli, string_t args, void* context) { + UNUSED(context); if(furi_hal_infrared_is_busy()) { printf("INFRARED is busy. Exit."); return; diff --git a/applications/infrared/infrared_app_event.h b/applications/infrared/infrared_app_event.h index fdea826a..168ba0b1 100644 --- a/applications/infrared/infrared_app_event.h +++ b/applications/infrared/infrared_app_event.h @@ -36,6 +36,7 @@ public: }; union { + int32_t dummy; /** Menu selected event type payload. Selected index. */ int32_t menu_index; /** DialogEx view module event type payload */ diff --git a/applications/infrared/infrared_app_view_manager.cpp b/applications/infrared/infrared_app_view_manager.cpp index 1e08471d..f1e48ed4 100644 --- a/applications/infrared/infrared_app_view_manager.cpp +++ b/applications/infrared/infrared_app_view_manager.cpp @@ -148,7 +148,7 @@ void InfraredAppViewManager::send_event(InfraredAppEvent* event) { osMessageQueuePut(event_queue, event, 0, timeout); } -uint32_t InfraredAppViewManager::previous_view_callback(void* context) { +uint32_t InfraredAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { InfraredAppEvent event; event.type = InfraredAppEvent::Type::Back; diff --git a/applications/infrared/scene/infrared_app_scene_ask_back.cpp b/applications/infrared/scene/infrared_app_scene_ask_back.cpp index 751816af..65d7ca57 100644 --- a/applications/infrared/scene/infrared_app_scene_ask_back.cpp +++ b/applications/infrared/scene/infrared_app_scene_ask_back.cpp @@ -69,5 +69,5 @@ bool InfraredAppSceneAskBack::on_event(InfraredApp* app, InfraredAppEvent* event return consumed; } -void InfraredAppSceneAskBack::on_exit(InfraredApp* app) { +void InfraredAppSceneAskBack::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_edit_delete.cpp b/applications/infrared/scene/infrared_app_scene_edit_delete.cpp index d49acec5..e17cfee0 100644 --- a/applications/infrared/scene/infrared_app_scene_edit_delete.cpp +++ b/applications/infrared/scene/infrared_app_scene_edit_delete.cpp @@ -96,5 +96,5 @@ bool InfraredAppSceneEditDelete::on_event(InfraredApp* app, InfraredAppEvent* ev return consumed; } -void InfraredAppSceneEditDelete::on_exit(InfraredApp* app) { +void InfraredAppSceneEditDelete::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp b/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp index 2b6afafd..803481f6 100644 --- a/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp +++ b/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp @@ -26,5 +26,5 @@ bool InfraredAppSceneEditRenameDone::on_event(InfraredApp* app, InfraredAppEvent return consumed; } -void InfraredAppSceneEditRenameDone::on_exit(InfraredApp* app) { +void InfraredAppSceneEditRenameDone::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp b/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp index 0f148e80..7d15a7c5 100644 --- a/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp +++ b/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp @@ -56,5 +56,5 @@ bool InfraredAppSceneLearnEnterName::on_event(InfraredApp* app, InfraredAppEvent return consumed; } -void InfraredAppSceneLearnEnterName::on_exit(InfraredApp* app) { +void InfraredAppSceneLearnEnterName::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_remote_list.cpp b/applications/infrared/scene/infrared_app_scene_remote_list.cpp index 95ef2e41..f59ff3e9 100644 --- a/applications/infrared/scene/infrared_app_scene_remote_list.cpp +++ b/applications/infrared/scene/infrared_app_scene_remote_list.cpp @@ -40,11 +40,9 @@ void InfraredAppSceneRemoteList::on_enter(InfraredApp* app) { } } -bool InfraredAppSceneRemoteList::on_event(InfraredApp* app, InfraredAppEvent* event) { - bool consumed = false; - - return consumed; +bool InfraredAppSceneRemoteList::on_event(InfraredApp*, InfraredAppEvent*) { + return false; } -void InfraredAppSceneRemoteList::on_exit(InfraredApp* app) { +void InfraredAppSceneRemoteList::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_universal_common.cpp b/applications/infrared/scene/infrared_app_scene_universal_common.cpp index a9220eaf..9e7a18f4 100644 --- a/applications/infrared/scene/infrared_app_scene_universal_common.cpp +++ b/applications/infrared/scene/infrared_app_scene_universal_common.cpp @@ -25,6 +25,7 @@ static void infrared_progress_back_callback(void* context) { auto app = static_cast(context); InfraredAppEvent infrared_event = { + .payload = {.dummy = 0}, .type = InfraredAppEvent::Type::Back, }; app->get_view_manager()->clear_events(); @@ -57,7 +58,10 @@ bool InfraredAppSceneUniversalCommon::on_event(InfraredApp* app, InfraredAppEven if(event->type == InfraredAppEvent::Type::Tick) { auto view_manager = app->get_view_manager(); app->notify_blink_send(); - InfraredAppEvent tick_event = {.type = InfraredAppEvent::Type::Tick}; + InfraredAppEvent tick_event = { + .payload = {.dummy = 0}, + .type = InfraredAppEvent::Type::Tick, + }; view_manager->send_event(&tick_event); bool result = brute_force.send_next_bruteforce(); if(result) { diff --git a/applications/input/input.c b/applications/input/input.c index a2dd62f7..dd824dcb 100644 --- a/applications/input/input.c +++ b/applications/input/input.c @@ -35,6 +35,7 @@ void input_press_timer_callback(void* arg) { } void input_isr(void* _ctx) { + UNUSED(_ctx); osThreadFlagsSet(input->thread, INPUT_THREAD_FLAG_ISR); } diff --git a/applications/input/input_cli.c b/applications/input/input_cli.c index 00591a75..afb05afd 100644 --- a/applications/input/input_cli.c +++ b/applications/input/input_cli.c @@ -20,6 +20,7 @@ static void input_cli_dump_events_callback(const void* value, void* ctx) { } static void input_cli_dump(Cli* cli, string_t args, Input* input) { + UNUSED(args); osMessageQueueId_t input_queue = osMessageQueueNew(8, sizeof(InputEvent), NULL); FuriPubSubSubscription* input_subscription = furi_pubsub_subscribe(input->event_pubsub, input_cli_dump_events_callback, input_queue); @@ -47,6 +48,7 @@ static void input_cli_send_print_usage() { } static void input_cli_send(Cli* cli, string_t args, Input* input) { + UNUSED(cli); InputEvent event; string_t key_str; string_init(key_str); diff --git a/applications/lfrfid/helpers/decoder_analyzer.cpp b/applications/lfrfid/helpers/decoder_analyzer.cpp index 8142f14c..8d344b88 100644 --- a/applications/lfrfid/helpers/decoder_analyzer.cpp +++ b/applications/lfrfid/helpers/decoder_analyzer.cpp @@ -2,7 +2,8 @@ #include #include -bool DecoderAnalyzer::read(uint8_t* _data, uint8_t _data_size) { +// FIXME: unused args? +bool DecoderAnalyzer::read(uint8_t* /* _data */, uint8_t /* _data_size */) { bool result = false; if(ready) { @@ -21,6 +22,7 @@ bool DecoderAnalyzer::read(uint8_t* _data, uint8_t _data_size) { } void DecoderAnalyzer::process_front(bool polarity, uint32_t time) { + UNUSED(polarity); if(ready) return; data[data_index] = time; diff --git a/applications/lfrfid/helpers/decoder_gpio_out.cpp b/applications/lfrfid/helpers/decoder_gpio_out.cpp index 03e03994..dfb43426 100644 --- a/applications/lfrfid/helpers/decoder_gpio_out.cpp +++ b/applications/lfrfid/helpers/decoder_gpio_out.cpp @@ -2,7 +2,7 @@ #include #include -void DecoderGpioOut::process_front(bool polarity, uint32_t time) { +void DecoderGpioOut::process_front(bool polarity, uint32_t /* time */) { furi_hal_gpio_write(&gpio_ext_pa7, polarity); } diff --git a/applications/lfrfid/helpers/decoder_hid26.h b/applications/lfrfid/helpers/decoder_hid26.h index b409ca43..c73ff88c 100644 --- a/applications/lfrfid/helpers/decoder_hid26.h +++ b/applications/lfrfid/helpers/decoder_hid26.h @@ -21,4 +21,4 @@ private: void reset_state(); ProtocolHID10301 hid; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/decoder_indala.cpp b/applications/lfrfid/helpers/decoder_indala.cpp index eb711fa2..100dde73 100644 --- a/applications/lfrfid/helpers/decoder_indala.cpp +++ b/applications/lfrfid/helpers/decoder_indala.cpp @@ -73,4 +73,4 @@ void DecoderIndala::reset_state() { cursed_raw_data = 0; ready = false; cursed_data_valid = false; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/decoder_indala.h b/applications/lfrfid/helpers/decoder_indala.h index 94ad8b16..5fbde7b6 100644 --- a/applications/lfrfid/helpers/decoder_indala.h +++ b/applications/lfrfid/helpers/decoder_indala.h @@ -22,4 +22,4 @@ private: std::atomic ready; std::atomic cursed_data_valid; ProtocolIndala40134 indala; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/emmarin.h b/applications/lfrfid/helpers/emmarin.h index 5d2e2439..ff8273bf 100644 --- a/applications/lfrfid/helpers/emmarin.h +++ b/applications/lfrfid/helpers/emmarin.h @@ -12,4 +12,4 @@ #define EM_STOP_MASK (0x1LLU << EM_STOP_POS) #define EM_HEADER_AND_STOP_MASK (EM_HEADER_MASK | EM_STOP_MASK) -#define EM_HEADER_AND_STOP_DATA (EM_HEADER_MASK) \ No newline at end of file +#define EM_HEADER_AND_STOP_DATA (EM_HEADER_MASK) diff --git a/applications/lfrfid/helpers/encoder_emmarin.h b/applications/lfrfid/helpers/encoder_emmarin.h index fa78122f..560daec1 100644 --- a/applications/lfrfid/helpers/encoder_emmarin.h +++ b/applications/lfrfid/helpers/encoder_emmarin.h @@ -19,4 +19,4 @@ private: uint64_t card_data; uint8_t card_data_index; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/encoder_hid_h10301.h b/applications/lfrfid/helpers/encoder_hid_h10301.h index e5edd0a0..8cc5aa5c 100644 --- a/applications/lfrfid/helpers/encoder_hid_h10301.h +++ b/applications/lfrfid/helpers/encoder_hid_h10301.h @@ -23,4 +23,4 @@ private: void write_raw_bit(bool bit, uint8_t position); OscFSK* fsk; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/encoder_indala_40134.h b/applications/lfrfid/helpers/encoder_indala_40134.h index 8bdb3acd..eda29457 100644 --- a/applications/lfrfid/helpers/encoder_indala_40134.h +++ b/applications/lfrfid/helpers/encoder_indala_40134.h @@ -20,4 +20,4 @@ private: bool last_bit; bool current_polarity; static const uint8_t clock_per_bit = 16; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/key_info.cpp b/applications/lfrfid/helpers/key_info.cpp index 74b4fa5c..ed2b20a9 100644 --- a/applications/lfrfid/helpers/key_info.cpp +++ b/applications/lfrfid/helpers/key_info.cpp @@ -63,4 +63,4 @@ uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type) { } return 0; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/key_info.h b/applications/lfrfid/helpers/key_info.h index 277ede08..e465011d 100644 --- a/applications/lfrfid/helpers/key_info.h +++ b/applications/lfrfid/helpers/key_info.h @@ -13,4 +13,4 @@ enum class LfrfidKeyType : uint8_t { const char* lfrfid_key_get_type_string(LfrfidKeyType type); const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type); bool lfrfid_key_get_string_type(const char* string, LfrfidKeyType* type); -uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type); \ No newline at end of file +uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type); diff --git a/applications/lfrfid/helpers/osc_fsk.h b/applications/lfrfid/helpers/osc_fsk.h index e9bd322b..eaaaa10a 100644 --- a/applications/lfrfid/helpers/osc_fsk.h +++ b/applications/lfrfid/helpers/osc_fsk.h @@ -27,4 +27,4 @@ private: const uint16_t freq[2]; const uint16_t osc_phase_max; int32_t osc_phase_current; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_generic.h b/applications/lfrfid/helpers/protocols/protocol_generic.h index 8d8edfb2..d593f708 100644 --- a/applications/lfrfid/helpers/protocols/protocol_generic.h +++ b/applications/lfrfid/helpers/protocols/protocol_generic.h @@ -57,4 +57,4 @@ public: virtual bool can_be_decoded(const uint8_t* encoded_data, const uint8_t encoded_data_size) = 0; virtual ~ProtocolGeneric(){}; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h b/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h index d769e874..fbd6e0b2 100644 --- a/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h +++ b/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h @@ -19,4 +19,4 @@ public: const uint8_t decoded_data_size) final; bool can_be_decoded(const uint8_t* encoded_data, const uint8_t encoded_data_size) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp b/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp index e77c808f..482339de 100644 --- a/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp +++ b/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp @@ -234,4 +234,4 @@ bool ProtocolIndala40134::can_be_decoded( } while(false); return can_be_decoded; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/pulse_joiner.h b/applications/lfrfid/helpers/pulse_joiner.h index 96d4482e..1639d837 100644 --- a/applications/lfrfid/helpers/pulse_joiner.h +++ b/applications/lfrfid/helpers/pulse_joiner.h @@ -33,4 +33,4 @@ private: uint8_t pulse_index = 0; static const uint8_t pulse_max = 6; Pulse pulses[pulse_max]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/rfid_key.cpp b/applications/lfrfid/helpers/rfid_key.cpp index 4a54e470..02e45e68 100644 --- a/applications/lfrfid/helpers/rfid_key.cpp +++ b/applications/lfrfid/helpers/rfid_key.cpp @@ -36,7 +36,7 @@ const char* RfidKey::get_type_text() { return lfrfid_key_get_type_string(type); } -const uint8_t RfidKey::get_type_data_count() { +uint8_t RfidKey::get_type_data_count() const { return lfrfid_key_get_type_data_count(type); } diff --git a/applications/lfrfid/helpers/rfid_key.h b/applications/lfrfid/helpers/rfid_key.h index 83251625..29b87cf9 100644 --- a/applications/lfrfid/helpers/rfid_key.h +++ b/applications/lfrfid/helpers/rfid_key.h @@ -14,7 +14,7 @@ public: LfrfidKeyType get_type(); const uint8_t* get_data(); const char* get_type_text(); - const uint8_t get_type_data_count(); + uint8_t get_type_data_count() const; char* get_name(); uint8_t get_name_length(); void clear(); diff --git a/applications/lfrfid/helpers/rfid_worker.h b/applications/lfrfid/helpers/rfid_worker.h index 27ec145c..2c49ad14 100644 --- a/applications/lfrfid/helpers/rfid_worker.h +++ b/applications/lfrfid/helpers/rfid_worker.h @@ -45,4 +45,4 @@ private: void sq_write_validate(); uint16_t validate_counts; void sq_write_stop_validate(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/rfid_writer.h b/applications/lfrfid/helpers/rfid_writer.h index 3ec3c1dd..38329877 100644 --- a/applications/lfrfid/helpers/rfid_writer.h +++ b/applications/lfrfid/helpers/rfid_writer.h @@ -17,4 +17,4 @@ private: void write_byte(uint8_t value); void write_block(uint8_t page, uint8_t block, bool lock_bit, uint32_t data); void write_reset(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/state_sequencer.h b/applications/lfrfid/helpers/state_sequencer.h index e0ad135f..12512ab5 100644 --- a/applications/lfrfid/helpers/state_sequencer.h +++ b/applications/lfrfid/helpers/state_sequencer.h @@ -22,4 +22,4 @@ private: uint32_t tick_count; void do_nothing(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/lfrfid_cli.cpp b/applications/lfrfid/lfrfid_cli.cpp index 235dd68f..dbd37ddc 100644 --- a/applications/lfrfid/lfrfid_cli.cpp +++ b/applications/lfrfid/lfrfid_cli.cpp @@ -100,6 +100,8 @@ static void lfrfid_cli_read(Cli* cli, string_t args) { } static void lfrfid_cli_write(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); // TODO implement rfid write printf("Not implemented :(\r\n"); } @@ -147,6 +149,7 @@ static void lfrfid_cli_emulate(Cli* cli, string_t args) { } static void lfrfid_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp index 5b7ac0f9..40bd9e36 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneDeleteConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneDeleteConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string_data); string_init(string_decrypted); string_init(string_header); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h index 36d436a4..e30764f0 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h @@ -14,4 +14,4 @@ private: string_t string_header; string_t string_data; string_t string_decrypted; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp index a4f2bf38..9820338d 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_delete_success.h" -void LfRfidAppSceneDeleteSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneDeleteSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); popup->set_icon(0, 2, &I_DolphinMafia_115x62); @@ -35,4 +35,4 @@ void LfRfidAppSceneDeleteSuccess::timeout_callback(void* context) { LfRfidApp::Event event; event.type = LfRfidApp::EventType::Back; app->view_controller.send_event(&event); -} \ No newline at end of file +} diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h index 01f929e7..009b9f25 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h @@ -9,4 +9,4 @@ public: private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp b/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp index 17472e16..f1118a48 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_emulate.h" #include -void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(data_string); DOLPHIN_DEED(DolphinDeedRfidEmulate); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_emulate.h b/applications/lfrfid/scene/lfrfid_app_scene_emulate.h index ad5c8418..937e49af 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_emulate.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_emulate.h @@ -9,4 +9,4 @@ public: private: string_t data_string; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp index 262dfca1..d423cec9 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneExitConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneExitConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { auto container = app->view_controller.get(); auto button = container->add(); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h index 4f960d22..a0a10232 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h @@ -10,4 +10,4 @@ public: private: static void exit_callback(void* context); static void stay_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read.cpp b/applications/lfrfid/scene/lfrfid_app_scene_read.cpp index 48175590..f87aa200 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_read.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_read.h" #include -void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); DOLPHIN_DEED(DolphinDeedRfidRead); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read.h b/applications/lfrfid/scene/lfrfid_app_scene_read.h index b978270c..b5035b72 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read.h @@ -6,4 +6,4 @@ public: void on_enter(LfRfidApp* app, bool need_restore) final; bool on_event(LfRfidApp* app, LfRfidApp::Event* event) final; void on_exit(LfRfidApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h b/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h index 43d68a81..2b50b96f 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h @@ -10,4 +10,4 @@ public: private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp index 8f6a0b57..2b81a58a 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneReadSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneReadSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string[0]); string_init(string[1]); string_init(string[2]); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_success.h b/applications/lfrfid/scene/lfrfid_app_scene_read_success.h index e2c182ea..ac0e3c1b 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_success.h @@ -12,4 +12,4 @@ private: static void more_callback(void* context); string_t string[3]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp index 092a5f02..e62b91bd 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneRetryConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneRetryConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { auto container = app->view_controller.get(); auto button = container->add(); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h index af2373f0..01b7329c 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h @@ -10,4 +10,4 @@ public: private: static void exit_callback(void* context); static void stay_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_data.h b/applications/lfrfid/scene/lfrfid_app_scene_save_data.h index d735fba1..6458ae64 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_data.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_data.h @@ -30,4 +30,4 @@ private: 0xBB, 0xBB, }; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp b/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp index f755f0e3..d460724e 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_save_name.h" #include -void LfRfidAppSceneSaveName::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSaveName::on_enter(LfRfidApp* app, bool /* need_restore */) { const char* key_name = app->worker.key.get_name(); bool key_name_empty = !strcmp(key_name, ""); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_name.h b/applications/lfrfid/scene/lfrfid_app_scene_save_name.h index 39201c34..ced42cc0 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_name.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_name.h @@ -9,4 +9,4 @@ public: private: static void save_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp index 184a445a..64efafa7 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp @@ -3,7 +3,7 @@ #include #include -void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); DOLPHIN_DEED(DolphinDeedRfidSave); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_success.h b/applications/lfrfid/scene/lfrfid_app_scene_save_success.h index 36aebf3e..62273a76 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_success.h @@ -9,4 +9,4 @@ public: private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_type.h b/applications/lfrfid/scene/lfrfid_app_scene_save_type.h index 7e57a93d..1f6f6d74 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_type.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_type.h @@ -12,4 +12,4 @@ private: uint32_t submenu_item_selected = 0; static const uint8_t keys_count = static_cast(LfrfidKeyType::KeyI40134); string_t submenu_name[keys_count + 1]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp index b054e141..73c9a403 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string_data); string_init(string_decrypted); @@ -59,10 +59,8 @@ void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool need_restore) { app->view_controller.switch_to(); } -bool LfRfidAppSceneSavedInfo::on_event(LfRfidApp* app, LfRfidApp::Event* event) { - bool consumed = false; - - return consumed; +bool LfRfidAppSceneSavedInfo::on_event(LfRfidApp* /* app */, LfRfidApp::Event* /* event */) { + return false; } void LfRfidAppSceneSavedInfo::on_exit(LfRfidApp* app) { diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h index ec15c6dc..5aa33e8a 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h @@ -12,4 +12,4 @@ private: string_t string_data; string_t string_decrypted; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h b/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h index b3ad10ec..69a6e5e5 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h @@ -10,4 +10,4 @@ public: private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp b/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp index d376056b..6d5df73c 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp @@ -8,11 +8,9 @@ void LfRfidAppSceneSelectKey::on_enter(LfRfidApp* app, bool need_restore) { } } -bool LfRfidAppSceneSelectKey::on_event(LfRfidApp* app, LfRfidApp::Event* event) { - bool consumed = false; - - return consumed; +bool LfRfidAppSceneSelectKey::on_event(LfRfidApp* /* app */, LfRfidApp::Event* /* event */) { + return false; } -void LfRfidAppSceneSelectKey::on_exit(LfRfidApp* app) { -} \ No newline at end of file +void LfRfidAppSceneSelectKey::on_exit(LfRfidApp* /* app */) { +} diff --git a/applications/lfrfid/scene/lfrfid_app_scene_select_key.h b/applications/lfrfid/scene/lfrfid_app_scene_select_key.h index 10f11c61..be565a91 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_select_key.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_select_key.h @@ -6,4 +6,4 @@ public: void on_enter(LfRfidApp* app, bool need_restore) final; bool on_event(LfRfidApp* app, LfRfidApp::Event* event) final; void on_exit(LfRfidApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_start.h b/applications/lfrfid/scene/lfrfid_app_scene_start.h index 3f48db70..255590d6 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_start.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_start.h @@ -10,4 +10,4 @@ public: private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write.cpp b/applications/lfrfid/scene/lfrfid_app_scene_write.cpp index 24f9fd0c..d6c9e9f4 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_write.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_write.h" -void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool /* need_restore */) { card_not_supported = false; string_init(data_string); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write.h b/applications/lfrfid/scene/lfrfid_app_scene_write.h index 603f59d8..3abadeba 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_write.h @@ -10,4 +10,4 @@ public: private: string_t data_string; bool card_not_supported; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp index 0539e623..3cf00183 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_write_success.h" -void LfRfidAppSceneWriteSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneWriteSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); popup->set_header("Successfully\nwritten!", 94, 3, AlignCenter, AlignTop); popup->set_icon(0, 6, &I_RFIDDolphinSuccess_108x57); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write_success.h b/applications/lfrfid/scene/lfrfid_app_scene_write_success.h index 94b8efc1..4ac9f089 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_write_success.h @@ -9,4 +9,4 @@ public: private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/view/container_vm.cpp b/applications/lfrfid/view/container_vm.cpp index 8c0e72e2..3c01ba30 100644 --- a/applications/lfrfid/view/container_vm.cpp +++ b/applications/lfrfid/view/container_vm.cpp @@ -112,4 +112,4 @@ bool ContainerVM::view_input_callback(InputEvent* event, void* context) { template StringElement* ContainerVM::add(); template IconElement* ContainerVM::add(); -template ButtonElement* ContainerVM::add(); \ No newline at end of file +template ButtonElement* ContainerVM::add(); diff --git a/applications/lfrfid/view/elements/generic_element.h b/applications/lfrfid/view/elements/generic_element.h index 269373f1..f5a58b2d 100644 --- a/applications/lfrfid/view/elements/generic_element.h +++ b/applications/lfrfid/view/elements/generic_element.h @@ -18,4 +18,4 @@ public: private: View* view = nullptr; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/view/elements/icon_element.cpp b/applications/lfrfid/view/elements/icon_element.cpp index e4cb19ad..0b6fba7d 100644 --- a/applications/lfrfid/view/elements/icon_element.cpp +++ b/applications/lfrfid/view/elements/icon_element.cpp @@ -12,7 +12,7 @@ void IconElement::draw(Canvas* canvas) { } } -bool IconElement::input(InputEvent* event) { +bool IconElement::input(InputEvent* /* event */) { return false; } diff --git a/applications/lfrfid/view/elements/string_element.cpp b/applications/lfrfid/view/elements/string_element.cpp index 028bd7fd..44c11e01 100644 --- a/applications/lfrfid/view/elements/string_element.cpp +++ b/applications/lfrfid/view/elements/string_element.cpp @@ -23,7 +23,7 @@ void StringElement::draw(Canvas* canvas) { } } -bool StringElement::input(InputEvent* event) { +bool StringElement::input(InputEvent* /* event */) { return false; } @@ -44,4 +44,4 @@ void StringElement::set_text( vertical = _vertical; font = _font; unlock_model(true); -} \ No newline at end of file +} diff --git a/applications/lfrfid_debug/lfrfid_debug_app.cpp b/applications/lfrfid_debug/lfrfid_debug_app.cpp index 5de1de71..9cd9dcad 100644 --- a/applications/lfrfid_debug/lfrfid_debug_app.cpp +++ b/applications/lfrfid_debug/lfrfid_debug_app.cpp @@ -13,4 +13,4 @@ void LfRfidDebugApp::run() { scene_controller.add_scene(SceneType::Start, new LfRfidDebugAppSceneStart()); scene_controller.add_scene(SceneType::TuneScene, new LfRfidDebugAppSceneTune()); scene_controller.process(100); -} \ No newline at end of file +} diff --git a/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp b/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp index 0ee458f4..4551a17c 100644 --- a/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp +++ b/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp @@ -2,6 +2,7 @@ // app enter function extern "C" int32_t lfrfid_debug_app(void* p) { + UNUSED(p); LfRfidDebugApp* app = new LfRfidDebugApp(); app->run(); delete app; diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h index b8f811d0..7fc0b07d 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h @@ -10,4 +10,4 @@ public: private: void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp index 53679402..4b627649 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp @@ -2,10 +2,11 @@ #include static void comparator_trigger_callback(bool level, void* comp_ctx) { + UNUSED(comp_ctx); furi_hal_gpio_write(&gpio_ext_pa7, !level); } -void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool need_restore) { +void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool /* need_restore */) { app->view_controller.switch_to(); furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull); @@ -17,7 +18,7 @@ void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool need_restore) { furi_hal_rfid_tim_read_start(); } -bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* event) { +bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* /* event */) { bool consumed = false; LfRfidViewTuneVM* tune = app->view_controller; @@ -30,7 +31,7 @@ bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Even return consumed; } -void LfRfidDebugAppSceneTune::on_exit(LfRfidDebugApp* app) { +void LfRfidDebugAppSceneTune::on_exit(LfRfidDebugApp* /* app */) { furi_hal_rfid_comp_stop(); furi_hal_rfid_comp_set_callback(NULL, NULL); diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h index 94dfea97..53399efc 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h @@ -6,4 +6,4 @@ public: void on_enter(LfRfidDebugApp* app, bool need_restore) final; bool on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* event) final; void on_exit(LfRfidDebugApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/loader/loader.c b/applications/loader/loader.c index 43e275ab..e5d59702 100644 --- a/applications/loader/loader.c +++ b/applications/loader/loader.c @@ -39,6 +39,7 @@ static bool } static void loader_menu_callback(void* _ctx, uint32_t index) { + UNUSED(index); const FlipperApplication* application = _ctx; furi_assert(application->app); @@ -53,6 +54,7 @@ static void loader_menu_callback(void* _ctx, uint32_t index) { } static void loader_submenu_callback(void* context, uint32_t index) { + UNUSED(index); uint32_t view_id = (uint32_t)context; view_dispatcher_switch_to_view(loader_instance->view_dispatcher, view_id); } @@ -101,6 +103,7 @@ const FlipperApplication* loader_find_application_by_name(const char* name) { } void loader_cli_open(Cli* cli, string_t args, Loader* instance) { + UNUSED(cli); if(loader_is_locked(instance)) { printf("Can't start, furi application is running"); return; @@ -139,6 +142,9 @@ void loader_cli_open(Cli* cli, string_t args, Loader* instance) { } void loader_cli_list(Cli* cli, string_t args, Loader* instance) { + UNUSED(cli); + UNUSED(args); + UNUSED(instance); printf("Applications:\r\n"); for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) { printf("\t%s\r\n", FLIPPER_APPS[i].name); @@ -187,6 +193,7 @@ static void loader_cli(Cli* cli, string_t args, void* _ctx) { } LoaderStatus loader_start(Loader* instance, const char* name, const char* args) { + UNUSED(instance); furi_assert(name); const FlipperApplication* application = loader_find_application_by_name(name); @@ -265,6 +272,7 @@ static void loader_thread_state_callback(FuriThreadState thread_state, void* con } static uint32_t loader_hide_menu(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -445,6 +453,7 @@ void loader_update_menu() { } int32_t loader_srv(void* p) { + UNUSED(p); FURI_LOG_I(TAG, "Executing system start hooks"); for(size_t i = 0; i < FLIPPER_ON_SYSTEM_START_COUNT; i++) { FLIPPER_ON_SYSTEM_START[i](); diff --git a/applications/music_player/music_player_cli.c b/applications/music_player/music_player_cli.c index 3c76cb84..0d98101e 100644 --- a/applications/music_player/music_player_cli.c +++ b/applications/music_player/music_player_cli.c @@ -4,6 +4,7 @@ #include "music_player_worker.h" static void music_player_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); MusicPlayerWorker* music_player_worker = music_player_worker_alloc(); Storage* storage = furi_record_open("storage"); diff --git a/applications/music_player/music_player_worker.c b/applications/music_player/music_player_worker.c index 2c80e6f5..9a0087aa 100644 --- a/applications/music_player/music_player_worker.c +++ b/applications/music_player/music_player_worker.c @@ -250,8 +250,8 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c is_valid &= (duration >= 1 && duration <= 128); is_valid &= ((note_char >= 'A' && note_char <= 'G') || note_char == 'P'); is_valid &= (sharp_char == '#' || sharp_char == '\0'); - is_valid &= (octave >= 0 && octave <= 16); - is_valid &= (dots >= 0 && dots <= 16); + is_valid &= (octave <= 16); + is_valid &= (dots <= 16); if(!is_valid) { FURI_LOG_E( TAG, diff --git a/applications/nfc/helpers/nfc_custom_event.h b/applications/nfc/helpers/nfc_custom_event.h index bab7c0aa..5de44001 100644 --- a/applications/nfc/helpers/nfc_custom_event.h +++ b/applications/nfc/helpers/nfc_custom_event.h @@ -9,4 +9,4 @@ enum NfcCustomEvent { NfcCustomEventByteInputDone, NfcCustomEventTextInputDone, NfcCustomEventDictAttackDone, -}; \ No newline at end of file +}; diff --git a/applications/nfc/nfc_cli.c b/applications/nfc/nfc_cli.c index 52c971ef..9b77a29f 100755 --- a/applications/nfc/nfc_cli.c +++ b/applications/nfc/nfc_cli.c @@ -17,6 +17,7 @@ static void nfc_cli_print_usage() { } static void nfc_cli_detect(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -45,6 +46,7 @@ static void nfc_cli_detect(Cli* cli, string_t args) { } static void nfc_cli_emulate(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -74,6 +76,7 @@ static void nfc_cli_emulate(Cli* cli, string_t args) { } static void nfc_cli_field(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -95,6 +98,7 @@ static void nfc_cli_field(Cli* cli, string_t args) { } static void nfc_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/nfc/nfc_device.c b/applications/nfc/nfc_device.c index 6b769803..14fdb67b 100644 --- a/applications/nfc/nfc_device.c +++ b/applications/nfc/nfc_device.c @@ -373,7 +373,7 @@ bool nfc_device_load_mifare_df_app(FlipperFormat* file, MifareDesfireApplication if(!flipper_format_read_hex(file, string_get_cstr(key), tmp, n_files)) break; MifareDesfireFile** file_head = &app->file_head; bool parsed_files = true; - for(int i = 0; i < n_files; i++) { + for(uint32_t i = 0; i < n_files; i++) { parsed_files = false; f = malloc(sizeof(MifareDesfireFile)); memset(f, 0, sizeof(MifareDesfireFile)); @@ -528,7 +528,7 @@ bool nfc_device_load_mifare_df_data(FlipperFormat* file, NfcDevice* dev) { if(!flipper_format_read_hex(file, "Application IDs", tmp, n_apps * 3)) break; bool parsed_apps = true; MifareDesfireApplication** app_head = &data->app_head; - for(int i = 0; i < n_apps; i++) { + for(uint32_t i = 0; i < n_apps; i++) { MifareDesfireApplication* app = malloc(sizeof(MifareDesfireApplication)); memset(app, 0, sizeof(MifareDesfireApplication)); memcpy(app->id, &tmp[i * 3], 3); diff --git a/applications/nfc/scenes/nfc_scene_delete_success.c b/applications/nfc/scenes/nfc_scene_delete_success.c index a52c40d8..547aeab7 100755 --- a/applications/nfc/scenes/nfc_scene_delete_success.c +++ b/applications/nfc/scenes/nfc_scene_delete_success.c @@ -37,4 +37,4 @@ void nfc_scene_delete_success_on_exit(void* context) { // Clear view popup_reset(nfc->popup); -} \ No newline at end of file +} diff --git a/applications/nfc/scenes/nfc_scene_device_info.c b/applications/nfc/scenes/nfc_scene_device_info.c index 10851e86..03464c66 100644 --- a/applications/nfc/scenes/nfc_scene_device_info.c +++ b/applications/nfc/scenes/nfc_scene_device_info.c @@ -21,6 +21,7 @@ void nfc_scene_device_info_dialog_callback(DialogExResult result, void* context) } void nfc_scene_device_info_bank_card_callback(GuiButtonType result, InputType type, void* context) { + UNUSED(result); Nfc* nfc = context; if(type == InputTypeShort) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventViewExit); diff --git a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c index 871ca636..eda7637c 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c @@ -5,6 +5,7 @@ #define NFC_MF_UL_DATA_CHANGED (1UL) void nfc_emulate_mifare_ul_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; scene_manager_set_scene_state( diff --git a/applications/nfc/scenes/nfc_scene_emulate_uid.c b/applications/nfc/scenes/nfc_scene_emulate_uid.c index 58ac138e..e67b7274 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_uid.c +++ b/applications/nfc/scenes/nfc_scene_emulate_uid.c @@ -9,6 +9,7 @@ enum { }; void nfc_emulate_uid_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); furi_assert(context); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); diff --git a/applications/nfc/scenes/nfc_scene_field.c b/applications/nfc/scenes/nfc_scene_field.c index 31cf74b8..e3eb6a70 100644 --- a/applications/nfc/scenes/nfc_scene_field.c +++ b/applications/nfc/scenes/nfc_scene_field.c @@ -19,6 +19,8 @@ void nfc_scene_field_on_enter(void* context) { } bool nfc_scene_field_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } diff --git a/applications/nfc/scenes/nfc_scene_file_select.c b/applications/nfc/scenes/nfc_scene_file_select.c index a8126456..36614bb8 100755 --- a/applications/nfc/scenes/nfc_scene_file_select.c +++ b/applications/nfc/scenes/nfc_scene_file_select.c @@ -11,8 +11,11 @@ void nfc_scene_file_select_on_enter(void* context) { } bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } void nfc_scene_file_select_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c b/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c index 0974c062..fdfbd2ec 100644 --- a/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c +++ b/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c @@ -11,7 +11,7 @@ MifareDesfireApplication* nfc_scene_mifare_desfire_app_get_app(Nfc* nfc) { uint32_t app_idx = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneMifareDesfireApp) >> 1; MifareDesfireApplication* app = nfc->dev->dev_data.mf_df_data.app_head; - for(int i = 0; i < app_idx && app; i++) { + for(uint32_t i = 0; i < app_idx && app; i++) { app = app->next; } return app; diff --git a/applications/nfc/scenes/nfc_scene_read_card.c b/applications/nfc/scenes/nfc_scene_read_card.c index 4d151c08..645b8deb 100755 --- a/applications/nfc/scenes/nfc_scene_read_card.c +++ b/applications/nfc/scenes/nfc_scene_read_card.c @@ -2,6 +2,7 @@ #include void nfc_read_card_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_emv_app.c b/applications/nfc/scenes/nfc_scene_read_emv_app.c index f0192cb9..4a64622d 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_app.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_app.c @@ -2,6 +2,7 @@ #include void nfc_read_emv_app_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_emv_data.c b/applications/nfc/scenes/nfc_scene_read_emv_data.c index b72c873e..85df4121 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_data.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_data.c @@ -2,6 +2,7 @@ #include void nfc_read_emv_data_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c b/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c index ebd7289b..f14f81ba 100644 --- a/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c @@ -2,6 +2,7 @@ #include void nfc_read_mifare_desfire_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c index 8903e2c4..659e08fb 100755 --- a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c @@ -2,6 +2,7 @@ #include void nfc_read_mifare_ul_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/notification/notification_app.c b/applications/notification/notification_app.c index 4db12bbf..7db4986d 100644 --- a/applications/notification/notification_app.c +++ b/applications/notification/notification_app.c @@ -298,7 +298,6 @@ void notification_process_notification_message( need_minimal_delay = true; } - led_active = false; notification_apply_notification_leds(app, led_values); reset_mask |= reset_red_mask; reset_mask |= reset_green_mask; @@ -489,6 +488,7 @@ static NotificationApp* notification_app_alloc() { // App int32_t notification_srv(void* p) { + UNUSED(p); NotificationApp* app = notification_app_alloc(); if(!notification_load_settings(app)) { diff --git a/applications/notification/notification_app_api.c b/applications/notification/notification_app_api.c index ed39b7d6..d11a289b 100644 --- a/applications/notification/notification_app_api.c +++ b/applications/notification/notification_app_api.c @@ -34,4 +34,4 @@ void notification_internal_message_block( furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK); osEventFlagsWait(m.back_event, NOTIFICATION_EVENT_COMPLETE, osFlagsWaitAny, osWaitForever); osEventFlagsDelete(m.back_event); -}; \ No newline at end of file +}; diff --git a/applications/notification/notification_settings_app.c b/applications/notification/notification_settings_app.c index eef14ebf..bcb1b6a2 100644 --- a/applications/notification/notification_settings_app.c +++ b/applications/notification/notification_settings_app.c @@ -120,6 +120,7 @@ static void vibro_changed(VariableItem* item) { } static uint32_t notification_app_settings_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -189,6 +190,7 @@ static void free_settings(NotificationAppSettings* app) { } int32_t notification_settings_app(void* p) { + UNUSED(p); NotificationAppSettings* app = alloc_settings(); view_dispatcher_run(app->view_dispatcher); notification_message_save_settings(app->notification); diff --git a/applications/power/battery_test_app/battery_test_app.c b/applications/power/battery_test_app/battery_test_app.c index 1588a525..f24de32b 100755 --- a/applications/power/battery_test_app/battery_test_app.c +++ b/applications/power/battery_test_app/battery_test_app.c @@ -89,6 +89,7 @@ void battery_test_free(BatteryTestApp* app) { } int32_t battery_test_app(void* p) { + UNUSED(p); BatteryTestApp* app = battery_test_alloc(); // Disable battery low level notification power_enable_low_battery_level_notification(app->power, false); diff --git a/applications/power/power_cli.c b/applications/power/power_cli.c index 09e75fa9..d474a729 100644 --- a/applications/power/power_cli.c +++ b/applications/power/power_cli.c @@ -6,6 +6,8 @@ #include void power_cli_off(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); Power* power = furi_record_open("power"); printf("It's now safe to disconnect USB from your flipper\r\n"); osDelay(666); @@ -13,26 +15,37 @@ void power_cli_off(Cli* cli, string_t args) { } void power_cli_reboot(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); power_reboot(PowerBootModeNormal); } void power_cli_reboot2dfu(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); power_reboot(PowerBootModeDfu); } static void power_cli_info_callback(const char* key, const char* value, bool last, void* context) { + UNUSED(last); + UNUSED(context); printf("%-24s: %s\r\n", key, value); } void power_cli_info(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); furi_hal_power_info_get(power_cli_info_callback, NULL); } void power_cli_debug(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); furi_hal_power_dump_state(); } void power_cli_5v(Cli* cli, string_t args) { + UNUSED(cli); if(!string_cmp(args, "0")) { furi_hal_power_disable_otg(); } else if(!string_cmp(args, "1")) { @@ -43,6 +56,7 @@ void power_cli_5v(Cli* cli, string_t args) { } void power_cli_3v3(Cli* cli, string_t args) { + UNUSED(cli); if(!string_cmp(args, "0")) { furi_hal_power_disable_external_3_3v(); } else if(!string_cmp(args, "1")) { @@ -69,6 +83,7 @@ static void power_cli_command_print_usage() { } void power_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/power/power_settings_app/power_settings_app.c b/applications/power/power_settings_app/power_settings_app.c index 1e87e7d6..822c51bc 100755 --- a/applications/power/power_settings_app/power_settings_app.c +++ b/applications/power/power_settings_app/power_settings_app.c @@ -75,6 +75,7 @@ void power_settings_app_free(PowerSettingsApp* app) { } int32_t power_settings_app(void* p) { + UNUSED(p); PowerSettingsApp* app = power_settings_app_alloc(); view_dispatcher_run(app->view_dispatcher); power_settings_app_free(app); diff --git a/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c b/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c index 4dd04f8c..0085c31d 100755 --- a/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c +++ b/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c @@ -31,4 +31,5 @@ bool power_settings_scene_battery_info_on_event(void* context, SceneManagerEvent } void power_settings_scene_battery_info_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c b/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c index 8edc8138..2d879612 100755 --- a/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c +++ b/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c @@ -33,6 +33,7 @@ void power_settings_scene_reboot_on_enter(void* context) { } bool power_settings_scene_reboot_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); bool consumed = false; if(event.type == SceneManagerEventTypeCustom) { diff --git a/applications/rpc/rpc.c b/applications/rpc/rpc.c index efd5ed87..7d51defd 100644 --- a/applications/rpc/rpc.c +++ b/applications/rpc/rpc.c @@ -102,7 +102,7 @@ static size_t rpc_sprintf_msg_file( size_t msg_files_size) { size_t cnt = 0; - for(int i = 0; i < msg_files_size; ++i, ++msg_file) { + for(size_t i = 0; i < msg_files_size; ++i, ++msg_file) { string_cat_printf( str, "%s[%c] size: %5ld", @@ -136,7 +136,7 @@ void rpc_print_data(const char* prefix, uint8_t* buffer, size_t size) { string_reserve(str, 100 + size * 5); string_cat_printf(str, "\r\n%s DEC(%d): {", prefix, size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { string_cat_printf(str, "%d, ", buffer[i]); } string_cat_printf(str, "}\r\n"); @@ -146,7 +146,7 @@ void rpc_print_data(const char* prefix, uint8_t* buffer, size_t size) { string_reserve(str, 100 + size * 3); string_cat_printf(str, "%s HEX(%d): {", prefix, size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { string_cat_printf(str, "%02X", buffer[i]); } string_cat_printf(str, "}\r\n\r\n"); @@ -573,7 +573,7 @@ static void rpc_session_free_callback(FuriThreadState thread_state, void* contex RpcSession* session = (RpcSession*)context; if(thread_state == FuriThreadStateStopped) { - for(int i = 0; i < COUNT_OF(rpc_systems); ++i) { + for(size_t i = 0; i < COUNT_OF(rpc_systems); ++i) { if(rpc_systems[i].free) { rpc_systems[i].free(session->system_contexts[i]); } @@ -611,7 +611,7 @@ RpcSession* rpc_session_open(Rpc* rpc) { session->decoded_message->cb_content.arg = session; session->system_contexts = malloc(COUNT_OF(rpc_systems) * sizeof(void*)); - for(int i = 0; i < COUNT_OF(rpc_systems); ++i) { + for(size_t i = 0; i < COUNT_OF(rpc_systems); ++i) { session->system_contexts[i] = rpc_systems[i].alloc(session); } @@ -647,6 +647,7 @@ void rpc_session_close(RpcSession* session) { } int32_t rpc_srv(void* p) { + UNUSED(p); Rpc* rpc = malloc(sizeof(Rpc)); rpc->busy_mutex = osMutexNew(NULL); diff --git a/applications/rpc/rpc_cli.c b/applications/rpc/rpc_cli.c index b9304367..1c8991bc 100644 --- a/applications/rpc/rpc_cli.c +++ b/applications/rpc/rpc_cli.c @@ -38,6 +38,7 @@ static void rpc_session_terminated_callback(void* context) { } void rpc_cli_command_start_session(Cli* cli, string_t args, void* context) { + UNUSED(args); Rpc* rpc = context; uint32_t mem_before = memmgr_get_free_heap(); diff --git a/applications/rpc/rpc_storage.c b/applications/rpc/rpc_storage.c index a21fec8e..e6a59ea8 100644 --- a/applications/rpc/rpc_storage.c +++ b/applications/rpc/rpc_storage.c @@ -31,8 +31,6 @@ typedef struct { uint32_t current_command_id; } RpcStorageSystem; -void rpc_print_message(const PB_Main* message); - static void rpc_system_storage_reset_state( RpcStorageSystem* rpc_storage, RpcSession* session, diff --git a/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp b/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp index 6d618748..200252ad 100644 --- a/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp +++ b/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp @@ -1,6 +1,6 @@ #include "scened_app_scene_byte_input.h" -void ScenedAppSceneByteInput::on_enter(ScenedApp* app, bool need_restore) { +void ScenedAppSceneByteInput::on_enter(ScenedApp* app, bool /* need_restore */) { ByteInputVM* byte_input = app->view_controller; auto callback = cbc::obtain_connector(this, &ScenedAppSceneByteInput::result_callback); diff --git a/applications/scened_app_example/scene/scened_app_scene_byte_input.h b/applications/scened_app_example/scene/scened_app_scene_byte_input.h index 12daf310..0f0b02ac 100644 --- a/applications/scened_app_example/scene/scened_app_scene_byte_input.h +++ b/applications/scened_app_example/scene/scened_app_scene_byte_input.h @@ -16,4 +16,4 @@ private: 0xF4, 0xD3, }; -}; \ No newline at end of file +}; diff --git a/applications/scened_app_example/scene/scened_app_scene_start.h b/applications/scened_app_example/scene/scened_app_scene_start.h index 19e1b78d..8324a20f 100644 --- a/applications/scened_app_example/scene/scened_app_scene_start.h +++ b/applications/scened_app_example/scene/scened_app_scene_start.h @@ -10,4 +10,4 @@ public: private: void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/scened_app_example/scened_app.cpp b/applications/scened_app_example/scened_app.cpp index e658d6d0..64040b22 100644 --- a/applications/scened_app_example/scened_app.cpp +++ b/applications/scened_app_example/scened_app.cpp @@ -17,4 +17,4 @@ void ScenedApp::run() { notification_message(notification, &sequence_blink_green_10); scene_controller.process(100); -} \ No newline at end of file +} diff --git a/applications/scened_app_example/scened_app_launcher.cpp b/applications/scened_app_example/scened_app_launcher.cpp index 1664b87d..3d0bdfca 100644 --- a/applications/scened_app_example/scened_app_launcher.cpp +++ b/applications/scened_app_example/scened_app_launcher.cpp @@ -2,6 +2,7 @@ // app enter function extern "C" int32_t scened_app(void* p) { + UNUSED(p); ScenedApp* app = new ScenedApp(); app->run(); delete app; diff --git a/applications/snake_game/snake_game.c b/applications/snake_game/snake_game.c index 2bc0a6a3..bb9e207d 100644 --- a/applications/snake_game/snake_game.c +++ b/applications/snake_game/snake_game.c @@ -313,6 +313,7 @@ static void snake_game_process_game_step(SnakeState* const snake_state) { } int32_t snake_game_app(void* p) { + UNUSED(p); srand(DWT->CYCCNT); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(SnakeEvent), NULL); diff --git a/applications/storage/filesystem_api.c b/applications/storage/filesystem_api.c index 42a10c6b..b979967a 100644 --- a/applications/storage/filesystem_api.c +++ b/applications/storage/filesystem_api.c @@ -35,4 +35,4 @@ const char* filesystem_api_error_get_desc(FS_Error error_id) { break; } return result; -} \ No newline at end of file +} diff --git a/applications/storage/filesystem_api_defines.h b/applications/storage/filesystem_api_defines.h index cc33de26..b6f1d8f1 100644 --- a/applications/storage/filesystem_api_defines.h +++ b/applications/storage/filesystem_api_defines.h @@ -57,4 +57,4 @@ const char* filesystem_api_error_get_desc(FS_Error error_id); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage.c b/applications/storage/storage.c index 078a136c..b280547b 100644 --- a/applications/storage/storage.c +++ b/applications/storage/storage.c @@ -100,6 +100,7 @@ void storage_tick(Storage* app) { } int32_t storage_srv(void* p) { + UNUSED(p); Storage* app = storage_app_alloc(); furi_record_create("storage", app); diff --git a/applications/storage/storage.h b/applications/storage/storage.h index eb51adef..eecd1beb 100644 --- a/applications/storage/storage.h +++ b/applications/storage/storage.h @@ -325,4 +325,4 @@ void storage_get_next_filename( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_cli.c b/applications/storage/storage_cli.c index 3cb345bd..70da21d2 100644 --- a/applications/storage/storage_cli.c +++ b/applications/storage/storage_cli.c @@ -37,6 +37,7 @@ static void storage_cli_print_error(FS_Error error) { } static void storage_cli_info(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); if(string_cmp_str(path, "/int") == 0) { @@ -101,6 +102,7 @@ static void storage_cli_format(Cli* cli, string_t path) { }; static void storage_cli_list(Cli* cli, string_t path) { + UNUSED(cli); if(string_cmp_str(path, "/") == 0) { printf("\t[D] int\r\n"); printf("\t[D] ext\r\n"); @@ -137,6 +139,7 @@ static void storage_cli_list(Cli* cli, string_t path) { } static void storage_cli_read(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); File* file = storage_file_alloc(api); @@ -295,6 +298,7 @@ static void storage_cli_write_chunk(Cli* cli, string_t path, string_t args) { } static void storage_cli_stat(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); if(string_cmp_str(path, "/") == 0) { @@ -334,6 +338,7 @@ static void storage_cli_stat(Cli* cli, string_t path) { } static void storage_cli_copy(Cli* cli, string_t old_path, string_t args) { + UNUSED(cli); Storage* api = furi_record_open("storage"); string_t new_path; string_init(new_path); @@ -354,6 +359,7 @@ static void storage_cli_copy(Cli* cli, string_t old_path, string_t args) { } static void storage_cli_remove(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); FS_Error error = storage_common_remove(api, string_get_cstr(path)); @@ -365,6 +371,7 @@ static void storage_cli_remove(Cli* cli, string_t path) { } static void storage_cli_rename(Cli* cli, string_t old_path, string_t args) { + UNUSED(cli); Storage* api = furi_record_open("storage"); string_t new_path; string_init(new_path); @@ -385,6 +392,7 @@ static void storage_cli_rename(Cli* cli, string_t old_path, string_t args) { } static void storage_cli_mkdir(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); FS_Error error = storage_common_mkdir(api, string_get_cstr(path)); @@ -396,6 +404,7 @@ static void storage_cli_mkdir(Cli* cli, string_t path) { } static void storage_cli_md5(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); File* file = storage_file_alloc(api); @@ -433,6 +442,7 @@ static void storage_cli_md5(Cli* cli, string_t path) { } void storage_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_t path; string_init(cmd); @@ -522,6 +532,8 @@ void storage_cli(Cli* cli, string_t args, void* context) { } static void storage_cli_factory_reset(Cli* cli, string_t args, void* context) { + UNUSED(args); + UNUSED(context); printf("All data will be lost. Are you sure (y/n)?\r\n"); char c = cli_getc(cli); if(c == 'y' || c == 'Y') { diff --git a/applications/storage/storage_glue.h b/applications/storage/storage_glue.h index 21147dce..0d50e39b 100644 --- a/applications/storage/storage_glue.h +++ b/applications/storage/storage_glue.h @@ -72,4 +72,4 @@ bool storage_pop_storage_file(File* file, StorageData* storage); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_internal_api.c b/applications/storage/storage_internal_api.c index 754ae0dd..ee49d672 100644 --- a/applications/storage/storage_internal_api.c +++ b/applications/storage/storage_internal_api.c @@ -19,4 +19,4 @@ FS_Error storage_int_restore(Storage* api, const char* srcname) { tar_archive_unpack_to(archive, INT_PATH); tar_archive_free(archive); return success ? FSE_OK : FSE_INTERNAL; -} \ No newline at end of file +} diff --git a/applications/storage/storage_message.h b/applications/storage/storage_message.h index 0e58fff2..f3aeaf32 100644 --- a/applications/storage/storage_message.h +++ b/applications/storage/storage_message.h @@ -131,4 +131,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_processing.c b/applications/storage/storage_processing.c index 6120a345..30e6b5e7 100644 --- a/applications/storage/storage_processing.c +++ b/applications/storage/storage_processing.c @@ -40,7 +40,7 @@ static StorageData* get_storage_by_file(File* file, StorageData* storages) { } static const char* remove_vfs(const char* path) { - return path + MIN(4, strlen(path)); + return path + MIN(4u, strlen(path)); } static const char* ext_path = "/ext"; diff --git a/applications/storage/storage_processing.h b/applications/storage/storage_processing.h index fe2cd1a6..bb779c7a 100644 --- a/applications/storage/storage_processing.h +++ b/applications/storage/storage_processing.h @@ -13,4 +13,4 @@ void storage_process_message(Storage* app, StorageMessage* message); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_sd_api.c b/applications/storage/storage_sd_api.c index 78064624..9e9ca45c 100644 --- a/applications/storage/storage_sd_api.c +++ b/applications/storage/storage_sd_api.c @@ -18,4 +18,4 @@ const char* sd_api_get_fs_type_text(SDFsType fs_type) { return "UNKNOWN"; break; } -} \ No newline at end of file +} diff --git a/applications/storage/storage_sd_api.h b/applications/storage/storage_sd_api.h index 2db35866..f8336095 100644 --- a/applications/storage/storage_sd_api.h +++ b/applications/storage/storage_sd_api.h @@ -30,4 +30,4 @@ const char* sd_api_get_fs_type_text(SDFsType fs_type); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_test_app.c b/applications/storage/storage_test_app.c index 096276ad..f11d2d72 100644 --- a/applications/storage/storage_test_app.c +++ b/applications/storage/storage_test_app.c @@ -316,6 +316,7 @@ static void do_test_end(Storage* api, const char* path) { } int32_t storage_test_app(void* p) { + UNUSED(p); Storage* api = furi_record_open("storage"); do_test_start(api, "/int"); do_test_start(api, "/any"); diff --git a/applications/storage/storages/sd_notify.c b/applications/storage/storages/sd_notify.c index 8c38ac8e..25ec67c1 100644 --- a/applications/storage/storages/sd_notify.c +++ b/applications/storage/storages/sd_notify.c @@ -79,4 +79,4 @@ void sd_notify_eject(NotificationApp* notifications) { void sd_notify_error(NotificationApp* notifications) { notification_message(notifications, &sd_sequence_error); -} \ No newline at end of file +} diff --git a/applications/storage/storages/sd_notify.h b/applications/storage/storages/sd_notify.h index 49e82edf..f5aefc74 100644 --- a/applications/storage/storages/sd_notify.h +++ b/applications/storage/storages/sd_notify.h @@ -14,4 +14,4 @@ void sd_notify_error(NotificationApp* notifications); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storages/storage_ext.c b/applications/storage/storages/storage_ext.c index bf201d56..49c52f77 100644 --- a/applications/storage/storages/storage_ext.c +++ b/applications/storage/storages/storage_ext.c @@ -113,6 +113,7 @@ FS_Error sd_unmount_card(StorageData* storage) { FS_Error sd_format_card(StorageData* storage) { #ifdef FURI_RAM_EXEC + UNUSED(storage); return FSE_NOT_READY; #else uint8_t* work_area; @@ -349,6 +350,10 @@ static uint16_t static uint16_t storage_ext_file_write(void* ctx, File* file, const void* buff, uint16_t const bytes_to_write) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); + UNUSED(buff); + UNUSED(bytes_to_write); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -389,6 +394,8 @@ static uint64_t storage_ext_file_tell(void* ctx, File* file) { static bool storage_ext_file_truncate(void* ctx, File* file) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -402,6 +409,8 @@ static bool storage_ext_file_truncate(void* ctx, File* file) { static bool storage_ext_file_sync(void* ctx, File* file) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -497,6 +506,7 @@ static bool storage_ext_dir_rewind(void* ctx, File* file) { /******************* Common FS Functions *******************/ static FS_Error storage_ext_common_stat(void* ctx, const char* path, FileInfo* fileinfo) { + UNUSED(ctx); SDFileInfo _fileinfo; SDError result = f_stat(path, &_fileinfo); @@ -511,7 +521,9 @@ static FS_Error storage_ext_common_stat(void* ctx, const char* path, FileInfo* f } static FS_Error storage_ext_common_remove(void* ctx, const char* path) { + UNUSED(ctx); #ifdef FURI_RAM_EXEC + UNUSED(path); return FSE_NOT_READY; #else SDError result = f_unlink(path); @@ -520,7 +532,9 @@ static FS_Error storage_ext_common_remove(void* ctx, const char* path) { } static FS_Error storage_ext_common_mkdir(void* ctx, const char* path) { + UNUSED(ctx); #ifdef FURI_RAM_EXEC + UNUSED(path); return FSE_NOT_READY; #else SDError result = f_mkdir(path); @@ -533,7 +547,11 @@ static FS_Error storage_ext_common_fs_info( const char* fs_path, uint64_t* total_space, uint64_t* free_space) { + UNUSED(fs_path); #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(total_space); + UNUSED(free_space); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -610,4 +628,4 @@ void storage_ext_init(StorageData* storage) { // do not notify on first launch, notifications app is waiting for our thread to read settings storage_ext_tick_internal(storage, false); -} \ No newline at end of file +} diff --git a/applications/storage/storages/storage_ext.h b/applications/storage/storages/storage_ext.h index fa5a5ab1..07ddbcf2 100644 --- a/applications/storage/storages/storage_ext.h +++ b/applications/storage/storages/storage_ext.h @@ -13,4 +13,4 @@ FS_Error sd_format_card(StorageData* storage); FS_Error sd_card_info(StorageData* storage, SDInfo* sd_info); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storages/storage_int.c b/applications/storage/storages/storage_int.c index 7f7dd770..291fb426 100644 --- a/applications/storage/storages/storage_int.c +++ b/applications/storage/storages/storage_int.c @@ -129,6 +129,7 @@ static int storage_int_device_erase(const struct lfs_config* c, lfs_block_t bloc } static int storage_int_device_sync(const struct lfs_config* c) { + UNUSED(c); FURI_LOG_D(TAG, "Device sync: skipping, cause "); return 0; } @@ -648,6 +649,7 @@ static FS_Error storage_int_common_fs_info( const char* fs_path, uint64_t* total_space, uint64_t* free_space) { + UNUSED(fs_path); StorageData* storage = ctx; lfs_t* lfs = lfs_get_from_storage(storage); diff --git a/applications/storage/storages/storage_int.h b/applications/storage/storages/storage_int.h index 40588f68..456d7240 100644 --- a/applications/storage/storages/storage_int.h +++ b/applications/storage/storages/storage_int.h @@ -10,4 +10,4 @@ void storage_int_init(StorageData* storage); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage_settings/scenes/storage_settings_scene_config.h b/applications/storage_settings/scenes/storage_settings_scene_config.h index 7628d143..18e7ba5a 100644 --- a/applications/storage_settings/scenes/storage_settings_scene_config.h +++ b/applications/storage_settings/scenes/storage_settings_scene_config.h @@ -6,4 +6,4 @@ ADD_SCENE(storage_settings, formatting, Formatting) ADD_SCENE(storage_settings, sd_info, SDInfo) ADD_SCENE(storage_settings, internal_info, InternalInfo) ADD_SCENE(storage_settings, benchmark, Benchmark) -ADD_SCENE(storage_settings, factory_reset, FactoryReset) \ No newline at end of file +ADD_SCENE(storage_settings, factory_reset, FactoryReset) diff --git a/applications/storage_settings/storage_settings.c b/applications/storage_settings/storage_settings.c index bc982b16..b89fdf06 100644 --- a/applications/storage_settings/storage_settings.c +++ b/applications/storage_settings/storage_settings.c @@ -66,6 +66,7 @@ static void storage_settings_free(StorageSettings* app) { } int32_t storage_settings_app(void* p) { + UNUSED(p); StorageSettings* app = storage_settings_alloc(); view_dispatcher_run(app->view_dispatcher); diff --git a/applications/storage_settings/storage_settings.h b/applications/storage_settings/storage_settings.h index be77a52d..f2d071c4 100644 --- a/applications/storage_settings/storage_settings.h +++ b/applications/storage_settings/storage_settings.h @@ -44,4 +44,4 @@ typedef enum { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c index 8d8ad0b6..c0e1fdba 100644 --- a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c +++ b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c @@ -44,7 +44,7 @@ static uint32_t subghz_frequency_analyzer_worker_expRunningAverageAdaptive( float k; float newValFloat = newVal; // the sharpness of the filter depends on the absolute value of the difference - if(abs(newValFloat - instance->filVal) > 500000) + if(fabs(newValFloat - instance->filVal) > 500000) k = 0.9; else k = 0.03; diff --git a/applications/subghz/helpers/subghz_testing.h b/applications/subghz/helpers/subghz_testing.h index 3a154966..29ce578a 100644 --- a/applications/subghz/helpers/subghz_testing.h +++ b/applications/subghz/helpers/subghz_testing.h @@ -3,4 +3,4 @@ extern const uint32_t subghz_frequencies_testing[]; extern const uint32_t subghz_frequencies_count_testing; -extern const uint32_t subghz_frequencies_433_92_testing; \ No newline at end of file +extern const uint32_t subghz_frequencies_433_92_testing; diff --git a/applications/subghz/scenes/subghz_scene_config.h b/applications/subghz/scenes/subghz_scene_config.h index 71cd2668..1cb217ad 100644 --- a/applications/subghz/scenes/subghz_scene_config.h +++ b/applications/subghz/scenes/subghz_scene_config.h @@ -21,4 +21,4 @@ ADD_SCENE(subghz, frequency_analyzer, FrequencyAnalyzer) ADD_SCENE(subghz, read_raw, ReadRAW) ADD_SCENE(subghz, more_raw, MoreRAW) ADD_SCENE(subghz, delete_raw, DeleteRAW) -ADD_SCENE(subghz, need_saving, NeedSaving) \ No newline at end of file +ADD_SCENE(subghz, need_saving, NeedSaving) diff --git a/applications/subghz/scenes/subghz_scene_receiver.c b/applications/subghz/scenes/subghz_scene_receiver.c index 19242def..bfc39e91 100644 --- a/applications/subghz/scenes/subghz_scene_receiver.c +++ b/applications/subghz/scenes/subghz_scene_receiver.c @@ -191,5 +191,5 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_receiver_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_receiver_config.c b/applications/subghz/scenes/subghz_scene_receiver_config.c index d98f45af..7c2d031f 100644 --- a/applications/subghz/scenes/subghz_scene_receiver_config.c +++ b/applications/subghz/scenes/subghz_scene_receiver_config.c @@ -61,6 +61,7 @@ uint8_t subghz_scene_receiver_config_hopper_value_index( uint8_t values_count, void* context) { furi_assert(context); + UNUSED(values_count); SubGhz* subghz = context; if(value == values[0]) { @@ -188,7 +189,8 @@ void subghz_scene_receiver_config_on_enter(void* context) { } bool subghz_scene_receiver_config_on_event(void* context, SceneManagerEvent event) { - //SubGhz* subghz = context; + UNUSED(context); + UNUSED(event); return false; } diff --git a/applications/subghz/scenes/subghz_scene_saved.c b/applications/subghz/scenes/subghz_scene_saved.c index ae64b797..62ade350 100644 --- a/applications/subghz/scenes/subghz_scene_saved.c +++ b/applications/subghz/scenes/subghz_scene_saved.c @@ -16,10 +16,11 @@ void subghz_scene_saved_on_enter(void* context) { } bool subghz_scene_saved_on_event(void* context, SceneManagerEvent event) { - // SubGhz* subghz = context; + UNUSED(context); + UNUSED(event); return false; } void subghz_scene_saved_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_show_only_rx.c b/applications/subghz/scenes/subghz_scene_show_only_rx.c index d5069940..48fa751e 100644 --- a/applications/subghz/scenes/subghz_scene_show_only_rx.c +++ b/applications/subghz/scenes/subghz_scene_show_only_rx.c @@ -26,7 +26,7 @@ void subghz_scene_show_only_rx_on_enter(void* context) { view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdPopup); } -const bool subghz_scene_show_only_rx_on_event(void* context, SceneManagerEvent event) { +bool subghz_scene_show_only_rx_on_event(void* context, SceneManagerEvent event) { SubGhz* subghz = context; if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventSceneShowOnlyRX) { diff --git a/applications/subghz/scenes/subghz_scene_test_carrier.c b/applications/subghz/scenes/subghz_scene_test_carrier.c index c6d336ea..9677792b 100644 --- a/applications/subghz/scenes/subghz_scene_test_carrier.c +++ b/applications/subghz/scenes/subghz_scene_test_carrier.c @@ -26,5 +26,5 @@ bool subghz_scene_test_carrier_on_event(void* context, SceneManagerEvent event) } void subghz_scene_test_carrier_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_test_packet.c b/applications/subghz/scenes/subghz_scene_test_packet.c index 243dfd55..99f0ab17 100644 --- a/applications/subghz/scenes/subghz_scene_test_packet.c +++ b/applications/subghz/scenes/subghz_scene_test_packet.c @@ -26,5 +26,5 @@ bool subghz_scene_test_packet_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_test_packet_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_test_static.c b/applications/subghz/scenes/subghz_scene_test_static.c index 2ca47a08..10e6d02a 100644 --- a/applications/subghz/scenes/subghz_scene_test_static.c +++ b/applications/subghz/scenes/subghz_scene_test_static.c @@ -26,5 +26,5 @@ bool subghz_scene_test_static_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_test_static_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/subghz.h b/applications/subghz/subghz.h index 16e1e857..54d3017e 100644 --- a/applications/subghz/subghz.h +++ b/applications/subghz/subghz.h @@ -1,3 +1,3 @@ #pragma once -typedef struct SubGhz SubGhz; \ No newline at end of file +typedef struct SubGhz SubGhz; diff --git a/applications/subghz/subghz_cli.c b/applications/subghz/subghz_cli.c index 65ea0cf2..d22b86f2 100644 --- a/applications/subghz/subghz_cli.c +++ b/applications/subghz/subghz_cli.c @@ -20,6 +20,7 @@ "299999755...348000000 or 386999938...464000000 or 778999847...928000000" void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -63,6 +64,7 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) { } void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -103,6 +105,7 @@ void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) { } void subghz_cli_command_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; uint32_t key = 0x0074BADE; uint32_t repeat = 10; @@ -218,6 +221,7 @@ static void subghz_cli_command_rx_callback( } void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -296,6 +300,7 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { } void subghz_cli_command_decode_raw(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t file_name; string_init(file_name); string_set(file_name, "/any/subghz/test.sub"); @@ -423,6 +428,7 @@ static void subghz_cli_command_print_usage() { } static void subghz_cli_command_encrypt_keeloq(Cli* cli, string_t args) { + UNUSED(cli); uint8_t iv[16]; string_t source; @@ -465,6 +471,7 @@ static void subghz_cli_command_encrypt_keeloq(Cli* cli, string_t args) { } static void subghz_cli_command_encrypt_raw(Cli* cli, string_t args) { + UNUSED(cli); uint8_t iv[16]; string_t source; diff --git a/applications/subghz/views/receiver.c b/applications/subghz/views/receiver.c index 03ba5bd2..fc66e4fd 100644 --- a/applications/subghz/views/receiver.c +++ b/applications/subghz/views/receiver.c @@ -10,7 +10,7 @@ #define FRAME_HEIGHT 12 #define MAX_LEN_PX 100 -#define MENU_ITEMS 4 +#define MENU_ITEMS 4u typedef struct { string_t item_str; @@ -71,9 +71,11 @@ static void subghz_view_receiver_update_offset(SubGhzViewReceiver* subghz_receiv if(history_item > 3 && model->idx >= history_item - 1) { model->list_offset = model->idx - 3; } else if(model->list_offset < model->idx - bounds) { - model->list_offset = CLAMP(model->list_offset + 1, history_item - bounds, 0); + model->list_offset = CLAMP( + (uint16_t)(model->list_offset + 1), (uint16_t)(history_item - bounds), 0); } else if(model->list_offset > model->idx - bounds) { - model->list_offset = CLAMP(model->idx - 1, history_item - bounds, 0); + model->list_offset = + CLAMP((uint16_t)(model->idx - 1), (uint16_t)(history_item - bounds), 0); } return true; }); @@ -157,7 +159,7 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) { SubGhzReceiverMenuItem* item_menu; for(size_t i = 0; i < MIN(model->history_item, MENU_ITEMS); ++i) { - size_t idx = CLAMP(i + model->list_offset, model->history_item, 0); + size_t idx = CLAMP((uint16_t)(i + model->list_offset), model->history_item, 0); item_menu = SubGhzReceiverMenuItemArray_get(model->history->data, idx); string_set(str_buff, item_menu->item_str); elements_string_fit_width(canvas, str_buff, scrollbar ? MAX_LEN_PX - 6 : MAX_LEN_PX); @@ -218,7 +220,6 @@ bool subghz_view_receiver_input(InputEvent* event, void* context) { void subghz_view_receiver_enter(void* context) { furi_assert(context); - //SubGhzViewReceiver* subghz_receiver = context; } void subghz_view_receiver_exit(void* context) { diff --git a/applications/subghz/views/subghz_test_packet.c b/applications/subghz/views/subghz_test_packet.c index fea3bd89..57f85085 100644 --- a/applications/subghz/views/subghz_test_packet.c +++ b/applications/subghz/views/subghz_test_packet.c @@ -57,6 +57,7 @@ static void subghz_test_packet_rx_callback(bool level, uint32_t duration, void* //todo static void subghz_test_packet_rx_pt_callback(SubGhzDecoderPrinceton* parser, void* context) { + UNUSED(parser); furi_assert(context); SubGhzTestPacket* instance = context; instance->packet_rx++; diff --git a/applications/system/system_settings.c b/applications/system/system_settings.c index f06292ec..97017c8d 100644 --- a/applications/system/system_settings.c +++ b/applications/system/system_settings.c @@ -46,6 +46,7 @@ static void debug_changed(VariableItem* item) { } static uint32_t system_settings_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -103,6 +104,7 @@ void system_settings_free(SystemSettings* app) { } int32_t system_settings_app(void* p) { + UNUSED(p); SystemSettings* app = system_settings_alloc(); view_dispatcher_run(app->view_dispatcher); system_settings_free(app); diff --git a/applications/u2f/scenes/u2f_scene_main.c b/applications/u2f/scenes/u2f_scene_main.c index d0957b59..f6264338 100644 --- a/applications/u2f/scenes/u2f_scene_main.c +++ b/applications/u2f/scenes/u2f_scene_main.c @@ -8,6 +8,7 @@ #define U2F_SUCCESS_TIMEOUT 3000 static void u2f_scene_main_ok_callback(InputType type, void* context) { + UNUSED(type); furi_assert(context); U2fApp* app = context; view_dispatcher_send_custom_event(app->view_dispatcher, U2fCustomEventConfirm); diff --git a/applications/u2f/u2f_app.c b/applications/u2f/u2f_app.c index 8a673dbc..2c3ff562 100644 --- a/applications/u2f/u2f_app.c +++ b/applications/u2f/u2f_app.c @@ -86,6 +86,7 @@ void u2f_app_free(U2fApp* app) { } int32_t u2f_app(void* p) { + UNUSED(p); U2fApp* u2f_app = u2f_app_alloc(); view_dispatcher_run(u2f_app->view_dispatcher); diff --git a/applications/u2f/views/u2f_view.c b/applications/u2f/views/u2f_view.c index d04c656d..11e2c9b0 100644 --- a/applications/u2f/views/u2f_view.c +++ b/applications/u2f/views/u2f_view.c @@ -86,6 +86,7 @@ void u2f_view_set_ok_callback(U2fView* u2f, U2fOkCallback callback, void* contex furi_assert(callback); with_view_model( u2f->view, (U2fModel * model) { + UNUSED(model); u2f->callback = callback; u2f->context = context; return false; diff --git a/applications/unit_tests/flipper_format/flipper_format_string_test.c b/applications/unit_tests/flipper_format/flipper_format_string_test.c index ebc3008f..7158ffd8 100644 --- a/applications/unit_tests/flipper_format/flipper_format_string_test.c +++ b/applications/unit_tests/flipper_format/flipper_format_string_test.c @@ -334,4 +334,4 @@ MU_TEST_SUITE(flipper_format_string_suite) { int run_minunit_test_flipper_format_string() { MU_RUN_SUITE(flipper_format_string_suite); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/furi_pubsub_test.c b/applications/unit_tests/furi_pubsub_test.c index 010a00ab..57c970b8 100644 --- a/applications/unit_tests/furi_pubsub_test.c +++ b/applications/unit_tests/furi_pubsub_test.c @@ -42,4 +42,4 @@ void test_furi_pubsub() { // delete pubsub case furi_pubsub_free(test_pubsub); -} \ No newline at end of file +} diff --git a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c b/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c index ca9120ed..0c3e685d 100644 --- a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c +++ b/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c @@ -55,7 +55,7 @@ static void run_encoder_fill_array( bool level = false; bool level_read; InfraredStatus status = InfraredStatusError; - int i = 0; + size_t i = 0; bool first = true; while(1) { @@ -100,7 +100,7 @@ static void run_encoder( run_encoder_fill_array(encoder_handler, timings, &timings_len, NULL); furi_check(timings_len <= 200); - for(int i = 0; i < timings_len; ++i, ++j) { + for(size_t i = 0; i < timings_len; ++i, ++j) { mu_check(MATCH_TIMING(timings[i], expected_timings[j], 120)); mu_assert(j < expected_timings_len, "encoded more timings than expected"); } @@ -127,7 +127,7 @@ static void furi_check(timings_len <= 200); const InfraredMessage* message_decoded = 0; - for(int i = 0; i < timings_len; ++i) { + for(size_t i = 0; i < timings_len; ++i) { message_decoded = infrared_decode(decoder_handler, level, timings[i]); if((i == timings_len - 2) && level && message_decoded) { /* In case we end with space timing - message can be decoded at last mark */ diff --git a/applications/unit_tests/minunit_vars.h b/applications/unit_tests/minunit_vars.h index 7ef5f825..8289fbe2 100644 --- a/applications/unit_tests/minunit_vars.h +++ b/applications/unit_tests/minunit_vars.h @@ -12,4 +12,4 @@ double minunit_real_timer = 0; double minunit_proc_timer = 0; /* Last message */ -char minunit_last_message[MINUNIT_MESSAGE_LEN]; \ No newline at end of file +char minunit_last_message[MINUNIT_MESSAGE_LEN]; diff --git a/applications/unit_tests/minunit_vars_ex.h b/applications/unit_tests/minunit_vars_ex.h index e2743d1c..7d6a486c 100644 --- a/applications/unit_tests/minunit_vars_ex.h +++ b/applications/unit_tests/minunit_vars_ex.h @@ -12,4 +12,4 @@ extern double minunit_real_timer; extern double minunit_proc_timer; /* Last message */ -extern char minunit_last_message[MINUNIT_MESSAGE_LEN]; \ No newline at end of file +extern char minunit_last_message[MINUNIT_MESSAGE_LEN]; diff --git a/applications/unit_tests/rpc/rpc_test.c b/applications/unit_tests/rpc/rpc_test.c index 2a52ebb0..2f97343e 100644 --- a/applications/unit_tests/rpc/rpc_test.c +++ b/applications/unit_tests/rpc/rpc_test.c @@ -45,7 +45,7 @@ static RpcSessionContext rpc_session[TEST_RPC_SESSIONS]; #define TAG "UnitTestsRpc" #define MAX_RECEIVE_OUTPUT_TIMEOUT 3000 #define MAX_NAME_LENGTH 255 -#define MAX_DATA_SIZE 512 // have to be exact as in rpc_storage.c +#define MAX_DATA_SIZE 512u // have to be exact as in rpc_storage.c #define TEST_DIR TEST_DIR_NAME "/" #define TEST_DIR_NAME "/ext/unit_tests_tmp" #define MD5SUM_SIZE 16 @@ -217,6 +217,8 @@ static void test_rpc_print_message_list(MsgList_t msg_list) { rpc_print_message(msg); } MsgList_reverse(msg_list); +#else + UNUSED(msg_list); #endif } @@ -494,7 +496,7 @@ static void test_rpc_compare_messages(PB_Main* result, PB_Main* expected) { size_t expected_msg_files = expected->content.storage_list_response.file_count; size_t result_msg_files = result->content.storage_list_response.file_count; mu_check(result_msg_files == expected_msg_files); - for(int i = 0; i < expected_msg_files; ++i) { + for(size_t i = 0; i < expected_msg_files; ++i) { PB_Storage_File* result_msg_file = &result->content.storage_list_response.file[i]; PB_Storage_File* expected_msg_file = &expected->content.storage_list_response.file[i]; test_rpc_compare_file(result_msg_file, expected_msg_file); @@ -794,7 +796,7 @@ static void test_create_file(const char* path, size_t size) { if(storage_file_open(file, path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) { uint8_t buf[128] = {0}; - for(int i = 0; i < sizeof(buf); ++i) { + for(size_t i = 0; i < sizeof(buf); ++i) { buf[i] = '0' + (i % 10); } while(size) { @@ -928,7 +930,7 @@ static void test_storage_write_run( MsgList_init(expected_msg_list); uint8_t* buf = malloc(write_size); - for(int i = 0; i < write_size; ++i) { + for(size_t i = 0; i < write_size; ++i) { buf[i] = '0' + (i % 10); } @@ -1551,8 +1553,9 @@ MU_TEST_SUITE(test_rpc_app) { static void test_send_rubbish(RpcSession* session, const char* pattern, size_t pattern_size, size_t size) { + UNUSED(session); uint8_t* buf = malloc(size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { buf[i] = pattern[i % pattern_size]; } diff --git a/applications/unit_tests/storage/storage_test.c b/applications/unit_tests/storage/storage_test.c index 3fccc68f..adc5f330 100644 --- a/applications/unit_tests/storage/storage_test.c +++ b/applications/unit_tests/storage/storage_test.c @@ -168,4 +168,4 @@ int run_minunit_test_storage() { MU_RUN_SUITE(storage_file); MU_RUN_SUITE(storage_dir); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/stream/stream_test.c b/applications/unit_tests/stream/stream_test.c index eed8a7bc..b5e8a18b 100644 --- a/applications/unit_tests/stream/stream_test.c +++ b/applications/unit_tests/stream/stream_test.c @@ -378,4 +378,4 @@ MU_TEST_SUITE(stream_suite) { int run_minunit_test_stream() { MU_RUN_SUITE(stream_suite); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/subghz/subghz_test.c b/applications/unit_tests/subghz/subghz_test.c index 6dc0f964..e0fb8b6b 100644 --- a/applications/unit_tests/subghz/subghz_test.c +++ b/applications/unit_tests/subghz/subghz_test.c @@ -26,6 +26,8 @@ static void subghz_test_rx_callback( SubGhzReceiver* receiver, SubGhzProtocolDecoderBase* decoder_base, void* context) { + UNUSED(receiver); + UNUSED(context); string_t text; string_init(text); subghz_protocol_decoder_base_get_string(decoder_base, text); diff --git a/applications/unit_tests/test_index.c b/applications/unit_tests/test_index.c index ef12224c..eda0fe4a 100644 --- a/applications/unit_tests/test_index.c +++ b/applications/unit_tests/test_index.c @@ -35,6 +35,9 @@ void minunit_print_fail(const char* str) { } void unit_tests_cli(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); uint32_t test_result = 0; minunit_run = 0; minunit_assert = 0; diff --git a/applications/updater/cli/updater_cli.c b/applications/updater/cli/updater_cli.c index aa08bc61..000ff56c 100644 --- a/applications/updater/cli/updater_cli.c +++ b/applications/updater/cli/updater_cli.c @@ -65,6 +65,8 @@ static const CliSubcommand update_cli_subcommands[] = { }; static void updater_cli_ep(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); string_t subcommand; string_init(subcommand); if(!args_read_string_and_trim(args, subcommand) || string_empty_p(args)) { @@ -85,6 +87,7 @@ static void updater_cli_ep(Cli* cli, string_t args, void* context) { } static int32_t updater_spawner_thread_worker(void* arg) { + UNUSED(arg); Loader* loader = furi_record_open("loader"); loader_start(loader, "UpdaterApp", NULL); furi_record_close("loader"); diff --git a/applications/updater/scenes/updater_scene_config.h b/applications/updater/scenes/updater_scene_config.h index d2441c59..59601965 100644 --- a/applications/updater/scenes/updater_scene_config.h +++ b/applications/updater/scenes/updater_scene_config.h @@ -2,4 +2,4 @@ ADD_SCENE(updater, main, Main) #ifndef FURI_RAM_EXEC ADD_SCENE(updater, loadcfg, LoadCfg) ADD_SCENE(updater, error, Error) -#endif \ No newline at end of file +#endif diff --git a/applications/updater/scenes/updater_scene_loadcfg.c b/applications/updater/scenes/updater_scene_loadcfg.c index 78423b07..8e477b14 100644 --- a/applications/updater/scenes/updater_scene_loadcfg.c +++ b/applications/updater/scenes/updater_scene_loadcfg.c @@ -102,4 +102,4 @@ void updater_scene_loadcfg_on_exit(void* context) { widget_reset(updater->widget); free(updater->pending_update); -} \ No newline at end of file +} diff --git a/applications/updater/updater.c b/applications/updater/updater.c index c1115ce1..b58c8daa 100644 --- a/applications/updater/updater.c +++ b/applications/updater/updater.c @@ -133,4 +133,4 @@ int32_t updater_srv(void* p) { updater_free(updater); return 0; -} \ No newline at end of file +} diff --git a/applications/updater/updater_i.h b/applications/updater/updater_i.h index 89201e1e..8a021a08 100644 --- a/applications/updater/updater_i.h +++ b/applications/updater/updater_i.h @@ -64,4 +64,4 @@ void updater_free(Updater* updater); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/updater/util/update_task.c b/applications/updater/util/update_task.c index 9fde086a..6ff61700 100644 --- a/applications/updater/util/update_task.c +++ b/applications/updater/util/update_task.c @@ -227,4 +227,4 @@ UpdateTaskState const* update_task_get_state(UpdateTask* update_task) { UpdateManifest const* update_task_get_manifest(UpdateTask* update_task) { furi_assert(update_task); return update_task->manifest; -} \ No newline at end of file +} diff --git a/applications/updater/util/update_task.h b/applications/updater/util/update_task.h index 8afc3121..3197c8c1 100644 --- a/applications/updater/util/update_task.h +++ b/applications/updater/util/update_task.h @@ -67,4 +67,4 @@ UpdateManifest const* update_task_get_manifest(UpdateTask* update_task); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/updater/util/update_task_worker_flasher.c b/applications/updater/util/update_task_worker_flasher.c index 22e94fd0..6b03439d 100644 --- a/applications/updater/util/update_task_worker_flasher.c +++ b/applications/updater/util/update_task_worker_flasher.c @@ -360,4 +360,4 @@ int32_t update_task_worker_flash_writer(void* context) { } while(false); return success ? UPDATE_TASK_NOERR : UPDATE_TASK_FAILED; -} \ No newline at end of file +} diff --git a/applications/updater/views/updater_main.h b/applications/updater/views/updater_main.h index 3c55a8c2..d7872956 100644 --- a/applications/updater/views/updater_main.h +++ b/applications/updater/views/updater_main.h @@ -25,4 +25,4 @@ void updater_main_set_storage_pubsub(UpdaterMainView* main_view, FuriPubSubSubsc FuriPubSubSubscription* updater_main_get_storage_pubsub(UpdaterMainView* main_view); -void updater_main_set_view_dispatcher(UpdaterMainView* main_view, ViewDispatcher* view_dispatcher); \ No newline at end of file +void updater_main_set_view_dispatcher(UpdaterMainView* main_view, ViewDispatcher* view_dispatcher); diff --git a/core/furi/check.c b/core/furi/check.c index 5ea76614..b59e490c 100644 --- a/core/furi/check.c +++ b/core/furi/check.c @@ -71,4 +71,4 @@ FURI_NORETURN void furi_halt(const char* message) { furi_hal_console_puts("\r\nSystem halted. Bye-bye!\r\n"); furi_hal_console_puts("\033[0m\r\n"); __furi_halt(); -} \ No newline at end of file +} diff --git a/core/furi/check.h b/core/furi/check.h index adea4039..4165c3c2 100644 --- a/core/furi/check.h +++ b/core/furi/check.h @@ -14,7 +14,10 @@ extern "C" { #ifdef FURI_DEBUG #define furi_assert(__e) ((__e) ? (void)0 : furi_crash("furi_assert failed\r\n")) #else -#define furi_assert(__e) ((void)0) +#define furi_assert(__e) \ + do { \ + ((void)(__e)); \ + } while(0) #endif /** Crash system */ diff --git a/core/furi/common_defines.h b/core/furi/common_defines.h index 9c4f7b18..5b0e6971 100644 --- a/core/furi/common_defines.h +++ b/core/furi/common_defines.h @@ -40,11 +40,6 @@ extern "C" { #define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower))) #endif -// need some common semantics for those two -#ifndef SIZEOF_ARRAY -#define SIZEOF_ARRAY(arr) (sizeof(arr) / sizeof(arr[0])) -#endif - #ifndef COUNT_OF #define COUNT_OF(x) (sizeof(x) / sizeof(x[0])) #endif diff --git a/core/furi/memmgr.c b/core/furi/memmgr.c index 457520d9..01cf573e 100644 --- a/core/furi/memmgr.c +++ b/core/furi/memmgr.c @@ -1,4 +1,5 @@ #include "memmgr.h" +#include "common_defines.h" #include extern void* pvPortMalloc(size_t xSize); @@ -60,17 +61,21 @@ size_t memmgr_get_minimum_free_heap(void) { } void* __wrap__malloc_r(struct _reent* r, size_t size) { + UNUSED(r); return pvPortMalloc(size); } void __wrap__free_r(struct _reent* r, void* ptr) { + UNUSED(r); vPortFree(ptr); } void* __wrap__calloc_r(struct _reent* r, size_t count, size_t size) { + UNUSED(r); return calloc(count, size); } void* __wrap__realloc_r(struct _reent* r, void* ptr, size_t size) { + UNUSED(r); return realloc(ptr, size); } diff --git a/core/furi/memmgr_heap.c b/core/furi/memmgr_heap.c index 8544092e..665fe2e1 100644 --- a/core/furi/memmgr_heap.c +++ b/core/furi/memmgr_heap.c @@ -205,6 +205,7 @@ static inline void traceMALLOC(void* pointer, size_t size) { #undef traceFREE static inline void traceFREE(void* pointer, size_t size) { + UNUSED(size); osThreadId_t thread_id = osThreadGetId(); if(thread_id && memmgr_heap_thread_trace_depth == 0) { memmgr_heap_thread_trace_depth++; diff --git a/core/furi/stdglue.c b/core/furi/stdglue.c index 4e727202..1eccafc9 100644 --- a/core/furi/stdglue.c +++ b/core/furi/stdglue.c @@ -93,9 +93,11 @@ bool furi_stdglue_set_thread_stdout_callback(FuriStdglueWriteCallback callback) } void __malloc_lock(struct _reent* REENT) { + UNUSED(REENT); vTaskSuspendAll(); } void __malloc_unlock(struct _reent* REENT) { + UNUSED(REENT); xTaskResumeAll(); } diff --git a/core/furi/thread.h b/core/furi/thread.h index ea1da27a..83e6bb93 100644 --- a/core/furi/thread.h +++ b/core/furi/thread.h @@ -160,4 +160,4 @@ int32_t furi_thread_get_return_code(FuriThread* thread); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/core/furi/valuemutex.c b/core/furi/valuemutex.c index 77a99937..6010c963 100644 --- a/core/furi/valuemutex.c +++ b/core/furi/valuemutex.c @@ -55,4 +55,4 @@ bool write_mutex(ValueMutex* valuemutex, void* data, size_t len, uint32_t timeou if(!release_mutex(valuemutex, value)) return false; return true; -} \ No newline at end of file +} diff --git a/core/furi/valuemutex.h b/core/furi/valuemutex.h index 84a08093..63dfac61 100644 --- a/core/furi/valuemutex.h +++ b/core/furi/valuemutex.h @@ -146,4 +146,4 @@ void consumer_app(void* _p) { } } ``` -*/ \ No newline at end of file +*/ diff --git a/docker-compose.yml b/docker-compose.yml index 68aa14c1..39aca411 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,4 @@ services: volumes: - .:/project - /dev/bus/usb:/dev/bus/usb - working_dir: '/project' \ No newline at end of file + working_dir: '/project' diff --git a/firmware/targets/f7/Inc/FreeRTOSConfig.h b/firmware/targets/f7/Inc/FreeRTOSConfig.h index c3b2117c..0204826a 100644 --- a/firmware/targets/f7/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f7/Inc/FreeRTOSConfig.h @@ -2,6 +2,7 @@ #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) #include +#pragma GCC diagnostic ignored "-Wredundant-decls" extern uint32_t SystemCoreClock; #endif diff --git a/firmware/targets/f7/Inc/stm32_assert.h b/firmware/targets/f7/Inc/stm32_assert.h new file mode 100644 index 00000000..3b0a543d --- /dev/null +++ b/firmware/targets/f7/Inc/stm32_assert.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file stm32_assert.h + * @author MCD Application Team + * @brief STM32 assert template file. + * This file should be copied to the application folder and renamed + * to stm32_assert.h. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32_ASSERT_H +#define STM32_ASSERT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Includes ------------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ + +/* We're confident in the parameters we pass to LL functions, so we can skip asserts + * since they introduce significant bloat to debug builds */ + +#ifdef FURI_LL_DEBUG +#define assert_param furi_assert +#else +#define assert_param(__e) \ + do { \ + ((void)(__e)); \ + } while(0) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* STM32_ASSERT_H */ \ No newline at end of file diff --git a/firmware/targets/f7/Src/main.c b/firmware/targets/f7/Src/main.c index 1865f8d1..629c154e 100644 --- a/firmware/targets/f7/Src/main.c +++ b/firmware/targets/f7/Src/main.c @@ -68,16 +68,3 @@ void Error_Handler(void) { void abort() { furi_crash("AbortHandler"); } - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t* file, uint32_t line) { - furi_crash("HAL assert failed"); -} -#endif /* USE_FULL_ASSERT */ diff --git a/firmware/targets/f7/ble_glue/app_debug.h b/firmware/targets/f7/ble_glue/app_debug.h index e1bd65fc..92a54d75 100644 --- a/firmware/targets/f7/ble_glue/app_debug.h +++ b/firmware/targets/f7/ble_glue/app_debug.h @@ -35,4 +35,4 @@ void APPD_EnableCPU2(void); #endif /*__APP_DEBUG_H */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/ble_glue/ble_app.c b/firmware/targets/f7/ble_glue/ble_app.c index d76b4e7b..618e2b94 100644 --- a/firmware/targets/f7/ble_glue/ble_app.c +++ b/firmware/targets/f7/ble_glue/ble_app.c @@ -121,6 +121,7 @@ void ble_app_thread_stop() { } static int32_t ble_app_hci_thread(void* arg) { + UNUSED(arg); uint32_t flags = 0; while(1) { @@ -138,6 +139,7 @@ static int32_t ble_app_hci_thread(void* arg) { // Called by WPAN lib void hci_notify_asynch_evt(void* pdata) { + UNUSED(pdata); if(ble_app) { osThreadId_t thread_id = furi_thread_get_thread_id(ble_app->thread); furi_assert(thread_id); @@ -146,12 +148,14 @@ void hci_notify_asynch_evt(void* pdata) { } void hci_cmd_resp_release(uint32_t flag) { + UNUSED(flag); if(ble_app) { osSemaphoreRelease(ble_app->hci_sem); } } void hci_cmd_resp_wait(uint32_t timeout) { + UNUSED(timeout); if(ble_app) { osSemaphoreAcquire(ble_app->hci_sem, osWaitForever); } diff --git a/firmware/targets/f7/ble_glue/ble_glue.c b/firmware/targets/f7/ble_glue/ble_glue.c index ec4a617b..6a100bea 100644 --- a/firmware/targets/f7/ble_glue/ble_glue.c +++ b/firmware/targets/f7/ble_glue/ble_glue.c @@ -349,6 +349,7 @@ void ble_glue_thread_stop() { // Wrap functions static int32_t ble_glue_shci_thread(void* context) { + UNUSED(context); uint32_t flags = 0; while(true) { diff --git a/firmware/targets/f7/ble_glue/ble_glue.h b/firmware/targets/f7/ble_glue/ble_glue.h index e5c2738d..fe43ae09 100644 --- a/firmware/targets/f7/ble_glue/ble_glue.h +++ b/firmware/targets/f7/ble_glue/ble_glue.h @@ -121,4 +121,4 @@ BleGlueCommandResult ble_glue_fus_wait_operation(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/ble_glue/gap.c b/firmware/targets/f7/ble_glue/gap.c index 45191a5a..f2a1a96f 100644 --- a/firmware/targets/f7/ble_glue/gap.c +++ b/firmware/targets/f7/ble_glue/gap.c @@ -489,6 +489,7 @@ void gap_stop_advertising() { } static void gap_advetise_timer_callback(void* context) { + UNUSED(context); GapCommand command = GapCommandAdvLowPower; furi_check(osMessageQueuePut(gap->command_queue, &command, 0, 0) == osOK); } @@ -587,6 +588,7 @@ void gap_thread_stop() { } static int32_t gap_app(void* context) { + UNUSED(context); GapCommand command; while(1) { osStatus_t status = osMessageQueueGet(gap->command_queue, &command, NULL, osWaitForever); diff --git a/firmware/targets/f7/fatfs/stm32_adafruit_sd.c b/firmware/targets/f7/fatfs/stm32_adafruit_sd.c index 246eabf0..fc2924d4 100644 --- a/firmware/targets/f7/fatfs/stm32_adafruit_sd.c +++ b/firmware/targets/f7/fatfs/stm32_adafruit_sd.c @@ -419,6 +419,7 @@ uint8_t BSP_SD_GetCardInfo(SD_CardInfo* pCardInfo) { */ uint8_t BSP_SD_ReadBlocks(uint32_t* pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) { + UNUSED(Timeout); // FIXME! uint32_t offset = 0; uint32_t addr; uint8_t retr = BSP_SD_ERROR; @@ -500,6 +501,7 @@ uint8_t BSP_SD_WriteBlocks( uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) { + UNUSED(Timeout); // FIXME! uint32_t offset = 0; uint32_t addr; uint8_t retr = BSP_SD_ERROR; diff --git a/firmware/targets/f7/fatfs/user_diskio.c b/firmware/targets/f7/fatfs/user_diskio.c index 94a7d4d3..b504fcd5 100644 --- a/firmware/targets/f7/fatfs/user_diskio.c +++ b/firmware/targets/f7/fatfs/user_diskio.c @@ -44,6 +44,7 @@ static volatile DSTATUS Stat = STA_NOINIT; static DSTATUS User_CheckStatus(BYTE lun) { + UNUSED(lun); Stat = STA_NOINIT; if(BSP_SD_GetCardState() == MSD_OK) { Stat &= ~STA_NOINIT; @@ -106,6 +107,7 @@ DSTATUS USER_initialize(BYTE pdrv) { */ DSTATUS USER_status(BYTE pdrv) { /* USER CODE BEGIN STATUS */ + UNUSED(pdrv); return Stat; /* USER CODE END STATUS */ } @@ -120,6 +122,7 @@ DSTATUS USER_status(BYTE pdrv) { */ DRESULT USER_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { /* USER CODE BEGIN READ */ + UNUSED(pdrv); DRESULT res = RES_ERROR; furi_hal_spi_acquire(&furi_hal_spi_bus_handle_sd_fast); @@ -151,6 +154,7 @@ DRESULT USER_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { DRESULT USER_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { /* USER CODE BEGIN WRITE */ /* USER CODE HERE */ + UNUSED(pdrv); DRESULT res = RES_ERROR; furi_hal_spi_acquire(&furi_hal_spi_bus_handle_sd_fast); @@ -181,6 +185,7 @@ DRESULT USER_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { #if _USE_IOCTL == 1 DRESULT USER_ioctl(BYTE pdrv, BYTE cmd, void* buff) { /* USER CODE BEGIN IOCTL */ + UNUSED(pdrv); DRESULT res = RES_ERROR; BSP_SD_CardInfo CardInfo; @@ -228,4 +233,4 @@ DRESULT USER_ioctl(BYTE pdrv, BYTE cmd, void* buff) { } #endif /* _USE_IOCTL == 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/furi_hal/furi_hal_crc.h b/firmware/targets/f7/furi_hal/furi_hal_crc.h index 110e6c05..8abaaad1 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_crc.h +++ b/firmware/targets/f7/furi_hal/furi_hal_crc.h @@ -32,4 +32,4 @@ uint32_t furi_hal_crc_feed(void* data, uint16_t length); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h b/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h index 03c0f1ca..a8fb9183 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h +++ b/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h @@ -28,4 +28,4 @@ extern FuriHalI2cBusHandle furi_hal_i2c_handle_external; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h b/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h index 0f2b735e..13f36105 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h +++ b/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h @@ -48,4 +48,4 @@ struct FuriHalI2cBusHandle { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_info.c b/firmware/targets/f7/furi_hal/furi_hal_info.c index bbb3907d..cf7140eb 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_info.c +++ b/firmware/targets/f7/furi_hal/furi_hal_info.c @@ -132,4 +132,4 @@ void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) { out("protobuf_version_minor", string_get_cstr(value), true, context); string_clear(value); -} \ No newline at end of file +} diff --git a/firmware/targets/f7/furi_hal/furi_hal_nfc.c b/firmware/targets/f7/furi_hal/furi_hal_nfc.c index bf9ea18c..768a4bac 100755 --- a/firmware/targets/f7/furi_hal/furi_hal_nfc.c +++ b/firmware/targets/f7/furi_hal/furi_hal_nfc.c @@ -240,6 +240,7 @@ void rfal_interrupt_callback_handler() { } void rfal_state_changed_callback(void* context) { + UNUSED(context); osEventFlagsSet(event, EVENT_FLAG_STATE_CHANGED); } @@ -289,7 +290,7 @@ bool furi_hal_nfc_emulate_nfca( buff_rx_len = 0; buff_tx_len = 0; uint32_t flag = osEventFlagsWait(event, EVENT_FLAG_ALL, osFlagsWaitAny, timeout); - if(flag == osErrorTimeout || flag == EVENT_FLAG_STOP) { + if(flag == osFlagsErrorTimeout || flag == EVENT_FLAG_STOP) { break; } bool data_received = false; diff --git a/firmware/targets/f7/furi_hal/furi_hal_os.c b/firmware/targets/f7/furi_hal/furi_hal_os.c index 8beb0d08..9dd7191f 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_os.c +++ b/firmware/targets/f7/furi_hal/furi_hal_os.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -178,5 +179,9 @@ void vPortSuppressTicksAndSleep(TickType_t expected_idle_ticks) { } void vApplicationStackOverflowHook(TaskHandle_t xTask, char* pcTaskName) { + UNUSED(xTask); + furi_hal_console_puts("\r\n\r\n stack overflow in "); + furi_hal_console_puts(pcTaskName); + furi_hal_console_puts("\r\n\r\n"); furi_crash("StackOverflow"); } diff --git a/firmware/targets/f7/furi_hal/furi_hal_random.c b/firmware/targets/f7/furi_hal/furi_hal_random.c index 5dfda2b2..0f282fac 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_random.c +++ b/firmware/targets/f7/furi_hal/furi_hal_random.c @@ -51,6 +51,7 @@ void furi_hal_random_fill_buf(uint8_t* buf, uint32_t len) { } void srand(unsigned seed) { + UNUSED(seed); // FIXME! } int rand() { diff --git a/firmware/targets/f7/furi_hal/furi_hal_rfid.c b/firmware/targets/f7/furi_hal/furi_hal_rfid.c index 964bd12b..86fecc99 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_rfid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_rfid.c @@ -152,6 +152,7 @@ void furi_hal_rfid_tim_read_stop() { } void furi_hal_rfid_tim_emulate(float freq) { + UNUSED(freq); // FIXME // basic PWM setup with needed freq and internal clock FURI_CRITICAL_ENTER(); LL_TIM_DeInit(FURI_HAL_RFID_EMULATE_TIMER); diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi.c b/firmware/targets/f7/furi_hal/furi_hal_spi.c index 01cb3ae6..f8c5a2c7 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi.c +++ b/firmware/targets/f7/furi_hal/furi_hal_spi.c @@ -83,6 +83,7 @@ void furi_hal_spi_release(FuriHalSpiBusHandle* handle) { } static void furi_hal_spi_bus_end_txrx(FuriHalSpiBusHandle* handle, uint32_t timeout) { + UNUSED(timeout); // FIXME while(LL_SPI_GetTxFIFOLevel(handle->bus->spi) != LL_SPI_TX_FIFO_EMPTY) ; while(LL_SPI_IsActiveFlag_BSY(handle->bus->spi)) diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi_config.h b/firmware/targets/f7/furi_hal/furi_hal_spi_config.h index 3e4296a0..eab633a1 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi_config.h +++ b/firmware/targets/f7/furi_hal/furi_hal_spi_config.h @@ -58,4 +58,4 @@ extern FuriHalSpiBusHandle furi_hal_spi_bus_handle_sd_slow; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi_types.h b/firmware/targets/f7/furi_hal/furi_hal_spi_types.h index 1fb1c02b..d2273f38 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi_types.h +++ b/firmware/targets/f7/furi_hal/furi_hal_spi_types.h @@ -61,4 +61,4 @@ struct FuriHalSpiBusHandle { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb.c b/firmware/targets/f7/furi_hal/furi_hal_usb.c index d41414f8..6a5e534e 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb.c @@ -189,6 +189,9 @@ void furi_hal_usb_set_state_callback(FuriHalUsbStateCallback cb, void* ctx) { } static void reset_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); osThreadFlagsSet(furi_thread_get_thread_id(usb.thread), EventReset); if(usb.callback != NULL) { usb.callback(FuriHalUsbStateEventReset, usb.cb_ctx); @@ -196,6 +199,9 @@ static void reset_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static void susp_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); if((usb.if_cur != NULL) && (usb.connected == true)) { usb.connected = false; usb.if_cur->suspend(&udev); @@ -208,6 +214,9 @@ static void susp_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static void wkup_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); if((usb.if_cur != NULL) && (usb.connected == false)) { usb.connected = true; usb.if_cur->wakeup(&udev); @@ -220,6 +229,7 @@ static void wkup_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static int32_t furi_hal_usb_thread(void* context) { + UNUSED(context); bool usb_request_pending = false; uint8_t usb_wait_time = 0; FuriHalUsbInterface* if_new = NULL; diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c b/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c index 807f1634..69a7fb3c 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c @@ -429,6 +429,7 @@ FuriHalUsbInterface usb_cdc_dual = { }; static void cdc_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { + UNUSED(ctx); usb_dev = dev; cdc_if_cur = intf; @@ -515,6 +516,7 @@ int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len) { } static void cdc_on_wakeup(usbd_device* dev) { + UNUSED(dev); connected = true; for(uint8_t i = 0; i < IF_NUM_MAX; i++) { if(callbacks[i] != NULL) { @@ -524,6 +526,7 @@ static void cdc_on_wakeup(usbd_device* dev) { } static void cdc_on_suspend(usbd_device* dev) { + UNUSED(dev); connected = false; for(uint8_t i = 0; i < IF_NUM_MAX; i++) { cdc_ctrl_line_state[i] = 0; @@ -534,6 +537,8 @@ static void cdc_on_suspend(usbd_device* dev) { } static void cdc_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); uint8_t if_num = 0; if(ep == CDC0_RXD_EP) if_num = 0; @@ -547,6 +552,8 @@ static void cdc_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { } static void cdc_tx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); uint8_t if_num = 0; if(ep == CDC0_TXD_EP) if_num = 0; @@ -629,6 +636,7 @@ static usbd_respond cdc_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond cdc_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* CDC control requests */ uint8_t if_num = 0; if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c index 55825dd9..aae4dd4f 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c @@ -375,6 +375,7 @@ static void* hid_set_string_descr(char* str) { } static void hid_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { + UNUSED(intf); FuriHalUsbHidConfig* cfg = (FuriHalUsbHidConfig*)ctx; if(hid_semaphore == NULL) hid_semaphore = osSemaphoreNew(1, 1, NULL); usb_dev = dev; @@ -419,17 +420,23 @@ static void hid_deinit(usbd_device* dev) { } static void hid_on_wakeup(usbd_device* dev) { - if(hid_connected == false) { + UNUSED(dev); + if(!hid_connected) { hid_connected = true; - if(callback != NULL) callback(true, cb_ctx); + if(callback != NULL) { + callback(true, cb_ctx); + } } } static void hid_on_suspend(usbd_device* dev) { - if(hid_connected == true) { + UNUSED(dev); + if(hid_connected) { hid_connected = false; osSemaphoreRelease(hid_semaphore); - if(callback != NULL) callback(false, cb_ctx); + if(callback != NULL) { + callback(false, cb_ctx); + } } } @@ -450,6 +457,7 @@ static bool hid_send_report(uint8_t report_id) { } static void hid_txrx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); if(event == usbd_evt_eptx) { osSemaphoreRelease(hid_semaphore); } else { @@ -484,6 +492,7 @@ static usbd_respond hid_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond hid_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* HID control requests */ if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) && diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c b/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c index 37d879ed..a8041086 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c @@ -159,14 +159,18 @@ bool furi_hal_hid_u2f_is_connected() { void furi_hal_hid_u2f_set_callback(HidU2fCallback cb, void* ctx) { if(callback != NULL) { - if(hid_u2f_connected == true) callback(HidU2fDisconnected, cb_ctx); + if(hid_u2f_connected == true) { + callback(HidU2fDisconnected, cb_ctx); + } } callback = cb; cb_ctx = ctx; if(callback != NULL) { - if(hid_u2f_connected == true) callback(HidU2fConnected, cb_ctx); + if(hid_u2f_connected == true) { + callback(HidU2fConnected, cb_ctx); + } } } @@ -186,7 +190,11 @@ FuriHalUsbInterface usb_hid_u2f = { }; static void hid_u2f_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { - if(hid_u2f_semaphore == NULL) hid_u2f_semaphore = osSemaphoreNew(1, 1, NULL); + UNUSED(intf); + UNUSED(ctx); + if(hid_u2f_semaphore == NULL) { + hid_u2f_semaphore = osSemaphoreNew(1, 1, NULL); + } usb_dev = dev; usbd_reg_config(dev, hid_u2f_ep_config); @@ -201,15 +209,21 @@ static void hid_u2f_deinit(usbd_device* dev) { } static void hid_u2f_on_wakeup(usbd_device* dev) { + UNUSED(dev); hid_u2f_connected = true; - if(callback != NULL) callback(HidU2fConnected, cb_ctx); + if(callback != NULL) { + callback(HidU2fConnected, cb_ctx); + } } static void hid_u2f_on_suspend(usbd_device* dev) { - if(hid_u2f_connected == true) { + UNUSED(dev); + if(hid_u2f_connected) { hid_u2f_connected = false; osSemaphoreRelease(hid_u2f_semaphore); - if(callback != NULL) callback(HidU2fDisconnected, cb_ctx); + if(callback != NULL) { + callback(HidU2fDisconnected, cb_ctx); + } } } @@ -227,10 +241,18 @@ uint32_t furi_hal_hid_u2f_get_request(uint8_t* data) { } static void hid_u2f_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { - if(callback != NULL) callback(HidU2fRequest, cb_ctx); + UNUSED(dev); + UNUSED(event); + UNUSED(ep); + if(callback != NULL) { + callback(HidU2fRequest, cb_ctx); + } } static void hid_u2f_tx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); osSemaphoreRelease(hid_u2f_semaphore); } @@ -268,6 +290,7 @@ static usbd_respond hid_u2f_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond hid_u2f_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* HID control requests */ if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) && diff --git a/firmware/targets/f7/furi_hal/furi_hal_version.c b/firmware/targets/f7/furi_hal/furi_hal_version.c index e580c978..7abee281 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_version.c +++ b/firmware/targets/f7/furi_hal/furi_hal_version.c @@ -205,7 +205,7 @@ const char* furi_hal_version_get_model_name() { return "Flipper Zero"; } -const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { +FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { if(*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { return FuriHalVersionOtpVersionEmpty; } else { @@ -228,27 +228,27 @@ const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { } } -const uint8_t furi_hal_version_get_hw_version() { +uint8_t furi_hal_version_get_hw_version() { return furi_hal_version.board_version; } -const uint8_t furi_hal_version_get_hw_target() { +uint8_t furi_hal_version_get_hw_target() { return furi_hal_version.board_target; } -const uint8_t furi_hal_version_get_hw_body() { +uint8_t furi_hal_version_get_hw_body() { return furi_hal_version.board_body; } -const FuriHalVersionColor furi_hal_version_get_hw_color() { +FuriHalVersionColor furi_hal_version_get_hw_color() { return furi_hal_version.board_color; } -const uint8_t furi_hal_version_get_hw_connect() { +uint8_t furi_hal_version_get_hw_connect() { return furi_hal_version.board_connect; } -const FuriHalVersionRegion furi_hal_version_get_hw_region() { +FuriHalVersionRegion furi_hal_version_get_hw_region() { return furi_hal_version.board_region; } @@ -266,11 +266,11 @@ const char* furi_hal_version_get_hw_region_name() { return "R??"; } -const FuriHalVersionDisplay furi_hal_version_get_hw_display() { +FuriHalVersionDisplay furi_hal_version_get_hw_display() { return furi_hal_version.board_display; } -const uint32_t furi_hal_version_get_hw_timestamp() { +uint32_t furi_hal_version_get_hw_timestamp() { return furi_hal_version.timestamp; } diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index 6410ba13..d96dd5e6 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -18,7 +18,10 @@ endif MCU_FLAGS = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -CFLAGS += $(MCU_FLAGS) -DSTM32WB55xx -Wall -fdata-sections -ffunction-sections +# Warnings configuration +CFLAGS += -Wall -Wextra -Wredundant-decls + +CFLAGS += $(MCU_FLAGS) -DSTM32WB55xx -fdata-sections -ffunction-sections LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs CPPFLAGS += -fno-rtti -fno-use-cxa-atexit -fno-exceptions @@ -35,6 +38,7 @@ ASM_SOURCES += $(MXPROJECT_DIR)/startup_stm32wb55xx_cm4.s CUBE_DIR = ../lib/STM32CubeWB CFLAGS += \ -DUSE_FULL_LL_DRIVER \ + -DUSE_FULL_ASSERT \ -DHAVE_FREERTOS CFLAGS += \ -I$(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Inc \ diff --git a/firmware/targets/furi_hal_include/furi_hal_random.h b/firmware/targets/furi_hal_include/furi_hal_random.h index fa549d23..ee69326f 100644 --- a/firmware/targets/furi_hal_include/furi_hal_random.h +++ b/firmware/targets/furi_hal_include/furi_hal_random.h @@ -21,4 +21,4 @@ void furi_hal_random_fill_buf(uint8_t* buf, uint32_t len); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/furi_hal_include/furi_hal_sd.h b/firmware/targets/furi_hal_include/furi_hal_sd.h index 307a8721..e1c08a35 100644 --- a/firmware/targets/furi_hal_include/furi_hal_sd.h +++ b/firmware/targets/furi_hal_include/furi_hal_sd.h @@ -1,3 +1,4 @@ +#pragma once /** * @file furi_hal_sd.h * SD Card HAL API diff --git a/firmware/targets/furi_hal_include/furi_hal_usb_hid.h b/firmware/targets/furi_hal_include/furi_hal_usb_hid.h index 4819e82e..20c76223 100644 --- a/firmware/targets/furi_hal_include/furi_hal_usb_hid.h +++ b/firmware/targets/furi_hal_include/furi_hal_usb_hid.h @@ -347,4 +347,4 @@ bool furi_hal_hid_consumer_key_press(uint16_t button); * * @param button key code */ -bool furi_hal_hid_consumer_key_release(uint16_t button); \ No newline at end of file +bool furi_hal_hid_consumer_key_release(uint16_t button); diff --git a/lib/ST25RFAL002/platform.c b/lib/ST25RFAL002/platform.c index 2c624f6e..52ac843e 100644 --- a/lib/ST25RFAL002/platform.c +++ b/lib/ST25RFAL002/platform.c @@ -14,6 +14,7 @@ static volatile PlatformIrqCallback platform_irq_callback = NULL; static const GpioPin pin = {ST25R_INT_PORT, ST25R_INT_PIN}; void nfc_isr(void* _ctx) { + UNUSED(_ctx); if(platform_irq_callback && platformGpioIsHigh(ST25R_INT_PORT, ST25R_INT_PIN)) { osThreadFlagsSet(platform_irq_thread_id, 0x1); } diff --git a/lib/ST25RFAL002/source/rfal_t4t.c b/lib/ST25RFAL002/source/rfal_t4t.c index bcc5b8de..8592daf8 100644 --- a/lib/ST25RFAL002/source/rfal_t4t.c +++ b/lib/ST25RFAL002/source/rfal_t4t.c @@ -118,6 +118,7 @@ ReturnCode rfalT4TPollerComposeCAPDU(const rfalT4tCApduParam* apduParam) { } /* Check whether requested Lc fits */ +#pragma GCC diagnostic ignored "-Wtype-limits" if((uint16_t)apduParam->Lc > (uint16_t)(RFAL_FEATURE_ISO_DEP_APDU_MAX_LEN - RFAL_T4T_LE_LEN)) { return ERR_PARAM; /* PRQA S 2880 # MISRA 2.1 - Unreachable code due to configuration option being set/unset */ diff --git a/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c b/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c index 71ded38f..40d65807 100644 --- a/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c +++ b/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c @@ -609,7 +609,8 @@ bool st25r3916CheckReg(uint8_t reg, uint8_t mask, uint8_t val) { /*******************************************************************************/ bool st25r3916IsRegValid(uint8_t reg) { - if(!(((int16_t)reg >= (int16_t)ST25R3916_REG_IO_CONF1) && +#pragma GCC diagnostic ignored "-Wtype-limits" + if(!(((int16_t)reg >= (int32_t)ST25R3916_REG_IO_CONF1) && (reg <= (ST25R3916_SPACE_B | ST25R3916_REG_IC_IDENTITY)))) { return false; } diff --git a/lib/ST25RFAL002/timer.h b/lib/ST25RFAL002/timer.h index c6719410..b5f5eb32 100644 --- a/lib/ST25RFAL002/timer.h +++ b/lib/ST25RFAL002/timer.h @@ -1,3 +1,4 @@ +#pragma once /****************************************************************************** * @attention * @@ -38,7 +39,8 @@ * INCLUDES ****************************************************************************** */ -#include "platform.h" +#include +#include /* ****************************************************************************** diff --git a/lib/app-scened-template/file_worker.c b/lib/app-scened-template/file_worker.c index f32d10d7..3a742ff9 100644 --- a/lib/app-scened-template/file_worker.c +++ b/lib/app-scened-template/file_worker.c @@ -232,6 +232,7 @@ bool file_worker_write_hex(FileWorker* file_worker, const uint8_t* buffer, uint1 } void file_worker_show_error(FileWorker* file_worker, const char* error_text) { + UNUSED(file_worker); DialogsApp* dialogs = furi_record_open("dialogs"); DialogMessage* message = dialog_message_alloc(); @@ -251,6 +252,7 @@ bool file_worker_file_select( char* result, uint8_t result_size, const char* selected_filename) { + UNUSED(file_worker); DialogsApp* dialogs = furi_record_open("dialogs"); bool ret = dialog_file_select_show(dialogs, path, extension, result, result_size, selected_filename); @@ -259,6 +261,7 @@ bool file_worker_file_select( } bool file_worker_check_common_errors(FileWorker* file_worker) { + UNUSED(file_worker); //TODO remove /* TODO: [FL-1431] Add return value to file_parser.get_sd_api().check_error() and replace get_fs_info(). */ return true; diff --git a/lib/app-scened-template/generic_scene.hpp b/lib/app-scened-template/generic_scene.hpp index c9e823b2..979e9747 100644 --- a/lib/app-scened-template/generic_scene.hpp +++ b/lib/app-scened-template/generic_scene.hpp @@ -6,4 +6,4 @@ public: virtual ~GenericScene(){}; private: -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/record_controller.hpp b/lib/app-scened-template/record_controller.hpp index af8db58c..9dfa9657 100644 --- a/lib/app-scened-template/record_controller.hpp +++ b/lib/app-scened-template/record_controller.hpp @@ -43,4 +43,4 @@ public: private: const char* name; TRecordClass* value; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/scene_controller.hpp b/lib/app-scened-template/scene_controller.hpp index 7e4c5ec0..678f6c0d 100644 --- a/lib/app-scened-template/scene_controller.hpp +++ b/lib/app-scened-template/scene_controller.hpp @@ -141,7 +141,7 @@ public: * @param tick_length_ms tick event length in milliseconds */ void process( - uint32_t tick_length_ms = 100, + uint32_t /* tick_length_ms */ = 100, typename TApp::SceneType start_scene_index = TApp::SceneType::Start) { typename TApp::Event event; bool consumed; @@ -240,4 +240,4 @@ private: return scene_index; } -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/text_store.h b/lib/app-scened-template/text_store.h index 95329f6d..a01784fd 100644 --- a/lib/app-scened-template/text_store.h +++ b/lib/app-scened-template/text_store.h @@ -9,4 +9,4 @@ public: void set(const char* text...); const uint8_t text_size; char* text; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/typeindex_no_rtti.hpp b/lib/app-scened-template/typeindex_no_rtti.hpp index be350cc9..4ac52725 100644 --- a/lib/app-scened-template/typeindex_no_rtti.hpp +++ b/lib/app-scened-template/typeindex_no_rtti.hpp @@ -118,4 +118,4 @@ template <> struct std::hash { result_type operator()(argument_type const& t) const noexcept { return t.hash_code(); } -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/byte_input_vm.h b/lib/app-scened-template/view_modules/byte_input_vm.h index 8217b213..9a161012 100644 --- a/lib/app-scened-template/view_modules/byte_input_vm.h +++ b/lib/app-scened-template/view_modules/byte_input_vm.h @@ -34,4 +34,4 @@ public: private: ByteInput* byte_input; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/dialog_ex_vm.h b/lib/app-scened-template/view_modules/dialog_ex_vm.h index 5c3cf124..66c2b760 100644 --- a/lib/app-scened-template/view_modules/dialog_ex_vm.h +++ b/lib/app-scened-template/view_modules/dialog_ex_vm.h @@ -70,4 +70,4 @@ public: private: DialogEx* dialog_ex; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/generic_view_module.h b/lib/app-scened-template/view_modules/generic_view_module.h index 10f04dc3..8b74ea3a 100644 --- a/lib/app-scened-template/view_modules/generic_view_module.h +++ b/lib/app-scened-template/view_modules/generic_view_module.h @@ -7,4 +7,4 @@ public: virtual ~GenericViewModule(){}; virtual View* get_view() = 0; virtual void clean() = 0; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/popup_vm.h b/lib/app-scened-template/view_modules/popup_vm.h index 483f33a2..26650563 100644 --- a/lib/app-scened-template/view_modules/popup_vm.h +++ b/lib/app-scened-template/view_modules/popup_vm.h @@ -65,4 +65,4 @@ public: private: Popup* popup; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/submenu_vm.h b/lib/app-scened-template/view_modules/submenu_vm.h index 6dba936f..06541527 100644 --- a/lib/app-scened-template/view_modules/submenu_vm.h +++ b/lib/app-scened-template/view_modules/submenu_vm.h @@ -39,4 +39,4 @@ public: private: Submenu* submenu; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/text_input_vm.h b/lib/app-scened-template/view_modules/text_input_vm.h index 8fafe861..81799e48 100644 --- a/lib/app-scened-template/view_modules/text_input_vm.h +++ b/lib/app-scened-template/view_modules/text_input_vm.h @@ -38,4 +38,4 @@ public: private: TextInput* text_input; -}; \ No newline at end of file +}; diff --git a/lib/app-template/app_template.h b/lib/app-template/app_template.h index 3af491ef..7adcf2bf 100644 --- a/lib/app-template/app_template.h +++ b/lib/app-template/app_template.h @@ -110,4 +110,4 @@ template uint8_t AppTemplate::exit( template void AppTemplate::update_gui(void) { view_port_update(view_port); -} \ No newline at end of file +} diff --git a/lib/callback-connector/callback-connector.h b/lib/callback-connector/callback-connector.h index e98ee914..10fec3e2 100644 --- a/lib/callback-connector/callback-connector.h +++ b/lib/callback-connector/callback-connector.h @@ -96,4 +96,4 @@ template auto obtain_connector(Functor functor) { } } //end of cbc scope -#endif // CALLBACKCONNECTOR_H \ No newline at end of file +#endif // CALLBACKCONNECTOR_H diff --git a/lib/drivers/bq27220.c b/lib/drivers/bq27220.c index bf654b5d..18f3f028 100644 --- a/lib/drivers/bq27220.c +++ b/lib/drivers/bq27220.c @@ -47,7 +47,7 @@ bool bq27220_set_parameter_u16(FuriHalI2cBusHandle* handle, uint16_t address, ui uint8_t checksum = bq27220_get_checksum(buffer, 4); buffer[0] = checksum; buffer[1] = 6; - ret = furi_hal_i2c_write_mem( + ret &= furi_hal_i2c_write_mem( handle, BQ27220_ADDRESS, CommandMACDataSum, buffer, 2, BQ27220_I2C_TIMEOUT); furi_hal_delay_us(10000); @@ -62,13 +62,13 @@ bool bq27220_init(FuriHalI2cBusHandle* handle, const ParamCEDV* cedv) { return true; } FURI_LOG_I(TAG, "Start updating battery profile"); - OperationStatus status = {}; + OperationStatus status = {0}; if(!bq27220_control(handle, Control_ENTER_CFG_UPDATE)) { FURI_LOG_E(TAG, "Can't configure update"); return false; }; - while((status.CFGUPDATE != 1) && (timeout-- > 0)) { + while((status.CFGUPDATE != true) && (timeout-- > 0)) { bq27220_get_operation_status(handle, &status); } bq27220_set_parameter_u16(handle, AddressGaugingConfig, cedv->cedv_conf.gauge_conf_raw); diff --git a/lib/drivers/cc1101.h b/lib/drivers/cc1101.h index c35c823c..af1f1556 100644 --- a/lib/drivers/cc1101.h +++ b/lib/drivers/cc1101.h @@ -148,13 +148,6 @@ uint32_t cc1101_set_intermediate_frequency(FuriHalSpiBusHandle* handle, uint32_t */ void cc1101_set_pa_table(FuriHalSpiBusHandle* handle, const uint8_t value[8]); -/** Set Power Amplifier level table, ramp - * - * @param handle - pointer to FuriHalSpiHandle - * @param value - array of power level values - */ -void cc1101_set_pa_table(FuriHalSpiBusHandle* handle, const uint8_t value[8]); - /** Write FIFO * * @param handle - pointer to FuriHalSpiHandle @@ -177,4 +170,4 @@ uint8_t cc1101_read_fifo(FuriHalSpiBusHandle* handle, uint8_t* data, uint8_t* si #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/drivers/cc1101_regs.h b/lib/drivers/cc1101_regs.h index 30a680be..a326dc92 100644 --- a/lib/drivers/cc1101_regs.h +++ b/lib/drivers/cc1101_regs.h @@ -209,4 +209,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/fatfs/ff.c b/lib/fatfs/ff.c index b0bd4366..85ab9736 100644 --- a/lib/fatfs/ff.c +++ b/lib/fatfs/ff.c @@ -1059,7 +1059,7 @@ DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluste break; } } - /* go to default */ + __attribute__ ((fallthrough)); #endif default: val = 1; /* Internal error */ @@ -5430,7 +5430,7 @@ FRESULT f_mkfs ( ch = 0xFFFF; st = 2; break; /* Compress the no-case block if run is >= 128 */ } st = 1; /* Do not compress short run */ - /* go to next case */ + __attribute__ ((fallthrough)); case 1: ch = si++; /* Fill the short run */ if (--j == 0) st = 0; diff --git a/lib/fatfs/ff_gen_drv.c b/lib/fatfs/ff_gen_drv.c index ccd595bb..9fb51efa 100644 --- a/lib/fatfs/ff_gen_drv.c +++ b/lib/fatfs/ff_gen_drv.c @@ -79,6 +79,7 @@ uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path) */ uint8_t FATFS_UnLinkDriverEx(char *path, uint8_t lun) { + (void)lun; uint8_t DiskNum = 0; uint8_t ret = 1; diff --git a/lib/flipper_format/flipper_format.c b/lib/flipper_format/flipper_format.c index 01f54632..cee76701 100644 --- a/lib/flipper_format/flipper_format.c +++ b/lib/flipper_format/flipper_format.c @@ -584,4 +584,4 @@ bool flipper_format_insert_or_update_hex( } return result; -} \ No newline at end of file +} diff --git a/lib/flipper_format/flipper_format.h b/lib/flipper_format/flipper_format.h index 0f3c299d..49e3f936 100644 --- a/lib/flipper_format/flipper_format.h +++ b/lib/flipper_format/flipper_format.h @@ -622,4 +622,4 @@ bool flipper_format_insert_or_update_hex( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_i.h b/lib/flipper_format/flipper_format_i.h index a47d4131..55b06f9f 100644 --- a/lib/flipper_format/flipper_format_i.h +++ b/lib/flipper_format/flipper_format_i.h @@ -16,4 +16,4 @@ Stream* flipper_format_get_raw_stream(FlipperFormat* flipper_format); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_stream.c b/lib/flipper_format/flipper_format_stream.c index b3a08590..93b788a3 100644 --- a/lib/flipper_format/flipper_format_stream.c +++ b/lib/flipper_format/flipper_format_stream.c @@ -295,7 +295,7 @@ bool flipper_format_stream_write_value_line(Stream* stream, FlipperStreamWriteDa furi_crash("Unknown FF type"); } - if((i + 1) < write_data->data_size) { + if((size_t)(i + 1) < write_data->data_size) { string_cat(value, " "); } @@ -340,7 +340,7 @@ bool flipper_format_stream_read_value_line( string_t value; string_init(value); - for(uint16_t i = 0; i < data_size; i++) { + for(size_t i = 0; i < data_size; i++) { bool last = false; result = flipper_format_stream_read_value(stream, value, &last); if(result) { @@ -507,4 +507,4 @@ bool flipper_format_stream_write_comment_cstr(Stream* stream, const char* data) } while(false); return result; -} \ No newline at end of file +} diff --git a/lib/flipper_format/flipper_format_stream.h b/lib/flipper_format/flipper_format_stream.h index dc9fb5b3..6ac17322 100644 --- a/lib/flipper_format/flipper_format_stream.h +++ b/lib/flipper_format/flipper_format_stream.h @@ -92,4 +92,4 @@ bool flipper_format_stream_write_comment_cstr(Stream* stream, const char* data); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_stream_i.h b/lib/flipper_format/flipper_format_stream_i.h index 74cf8f1a..f3614900 100644 --- a/lib/flipper_format/flipper_format_stream_i.h +++ b/lib/flipper_format/flipper_format_stream_i.h @@ -31,4 +31,4 @@ bool flipper_format_stream_seek_to_key(Stream* stream, const char* key, bool str #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/fnv1a-hash/fnv1a-hash.c b/lib/fnv1a-hash/fnv1a-hash.c index a5bfa206..69c675f3 100644 --- a/lib/fnv1a-hash/fnv1a-hash.c +++ b/lib/fnv1a-hash/fnv1a-hash.c @@ -7,4 +7,4 @@ uint32_t fnv1a_buffer_hash(const uint8_t* buffer, uint32_t length, uint32_t hash hash = (hash ^ buffer[i]) * 16777619ULL; } return hash; -} \ No newline at end of file +} diff --git a/lib/fnv1a-hash/fnv1a-hash.h b/lib/fnv1a-hash/fnv1a-hash.h index fbbdb5b8..3218cc27 100644 --- a/lib/fnv1a-hash/fnv1a-hash.h +++ b/lib/fnv1a-hash/fnv1a-hash.h @@ -36,4 +36,4 @@ inline uint32_t fnv1a_string_hash(const char* str) { } return hash; } -#endif \ No newline at end of file +#endif diff --git a/lib/heatshrink/heatshrink_encoder.c b/lib/heatshrink/heatshrink_encoder.c index 9cd2594c..98f27dff 100644 --- a/lib/heatshrink/heatshrink_encoder.c +++ b/lib/heatshrink/heatshrink_encoder.c @@ -232,6 +232,7 @@ HSE_poll_res heatshrink_encoder_poll(heatshrink_encoder *hse, break; case HSES_FLUSH_BITS: hse->state = st_flush_bit_buffer(hse, &oi); + /* fall through */ case HSES_DONE: return HSER_POLL_EMPTY; default: diff --git a/lib/infrared/encoder_decoder/common/infrared_common_decoder.c b/lib/infrared/encoder_decoder/common/infrared_common_decoder.c index c39de09e..1d944285 100644 --- a/lib/infrared/encoder_decoder/common/infrared_common_decoder.c +++ b/lib/infrared/encoder_decoder/common/infrared_common_decoder.c @@ -12,7 +12,9 @@ static void infrared_common_decoder_reset_state(InfraredCommonDecoder* decoder); static inline size_t consume_samples(uint32_t* array, size_t len, size_t shift) { furi_assert(len >= shift); len -= shift; - for(int i = 0; i < len; ++i) array[i] = array[i + shift]; + for(size_t i = 0; i < len; ++i) { + array[i] = array[i + shift]; + } return len; } @@ -83,8 +85,8 @@ static InfraredStatus infrared_common_decode_bits(InfraredCommonDecoder* decoder if(timings->min_split_time && !level) { if(timing > timings->min_split_time) { /* long low timing - check if we're ready for any of protocol modification */ - for(int i = 0; decoder->protocol->databit_len[i] && - (i < COUNT_OF(decoder->protocol->databit_len)); + for(size_t i = 0; decoder->protocol->databit_len[i] && + (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { if(decoder->protocol->databit_len[i] == decoder->databit_cnt) { return InfraredStatusReady; @@ -153,8 +155,8 @@ InfraredStatus InfraredStatus infrared_common_decode_manchester(InfraredCommonDecoder* decoder, bool level, uint32_t timing) { furi_assert(decoder); - uint16_t bit = decoder->protocol->timings.bit1_mark; - uint16_t tolerance = decoder->protocol->timings.bit_tolerance; + uint32_t bit = decoder->protocol->timings.bit1_mark; + uint32_t tolerance = decoder->protocol->timings.bit_tolerance; bool* switch_detect = &decoder->switch_detect; furi_assert((*switch_detect == true) || (*switch_detect == false)); @@ -196,7 +198,7 @@ InfraredMessage* infrared_common_decoder_check_ready(InfraredCommonDecoder* deco InfraredMessage* message = NULL; bool found_length = false; - for(int i = 0; + for(size_t i = 0; decoder->protocol->databit_len[i] && (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { if(decoder->protocol->databit_len[i] == decoder->databit_cnt) { @@ -280,7 +282,7 @@ void* infrared_common_decoder_alloc(const InfraredCommonProtocolSpec* protocol) furi_assert(protocol); /* protocol->databit_len[0] has to contain biggest value of bits that can be decoded */ - for(int i = 1; i < COUNT_OF(protocol->databit_len); ++i) { + for(size_t i = 1; i < COUNT_OF(protocol->databit_len); ++i) { furi_assert(protocol->databit_len[i] <= protocol->databit_len[0]); } diff --git a/lib/infrared/encoder_decoder/common/infrared_common_encoder.c b/lib/infrared/encoder_decoder/common/infrared_common_encoder.c index 563c1e64..f755222d 100644 --- a/lib/infrared/encoder_decoder/common/infrared_common_encoder.c +++ b/lib/infrared/encoder_decoder/common/infrared_common_encoder.c @@ -146,7 +146,7 @@ void* infrared_common_encoder_alloc(const InfraredCommonProtocolSpec* protocol) } /* protocol->databit_len[0] has to contain biggest value of bits that can be decoded */ - for(int i = 1; i < COUNT_OF(protocol->databit_len); ++i) { + for(size_t i = 1; i < COUNT_OF(protocol->databit_len); ++i) { furi_assert(protocol->databit_len[i] <= protocol->databit_len[0]); } @@ -174,7 +174,7 @@ void infrared_common_encoder_reset(InfraredCommonEncoder* encoder) { uint8_t max_databit_len = 0; - for(int i = 0; i < COUNT_OF(encoder->protocol->databit_len); ++i) { + for(size_t i = 0; i < COUNT_OF(encoder->protocol->databit_len); ++i) { max_databit_len = MAX(max_databit_len, encoder->protocol->databit_len[i]); } diff --git a/lib/infrared/encoder_decoder/infrared.c b/lib/infrared/encoder_decoder/infrared.c index 5dfa9281..59b11d5c 100644 --- a/lib/infrared/encoder_decoder/infrared.c +++ b/lib/infrared/encoder_decoder/infrared.c @@ -123,7 +123,7 @@ const InfraredMessage* InfraredMessage* message = NULL; InfraredMessage* result = NULL; - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.decode) { message = infrared_encoder_decoder[i].decoder.decode(handler->ctx[i], level, duration); if(!result && message) { @@ -139,7 +139,7 @@ InfraredDecoderHandler* infrared_alloc_decoder(void) { InfraredDecoderHandler* handler = malloc(sizeof(InfraredDecoderHandler)); handler->ctx = malloc(sizeof(void*) * COUNT_OF(infrared_encoder_decoder)); - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { handler->ctx[i] = 0; if(infrared_encoder_decoder[i].decoder.alloc) handler->ctx[i] = infrared_encoder_decoder[i].decoder.alloc(); @@ -153,7 +153,7 @@ void infrared_free_decoder(InfraredDecoderHandler* handler) { furi_assert(handler); furi_assert(handler->ctx); - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.free) infrared_encoder_decoder[i].decoder.free(handler->ctx[i]); } @@ -163,7 +163,7 @@ void infrared_free_decoder(InfraredDecoderHandler* handler) { } void infrared_reset_decoder(InfraredDecoderHandler* handler) { - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.reset) infrared_encoder_decoder[i].decoder.reset(handler->ctx[i]); } @@ -175,7 +175,7 @@ const InfraredMessage* infrared_check_decoder_ready(InfraredDecoderHandler* hand InfraredMessage* message = NULL; InfraredMessage* result = NULL; - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.check_ready) { message = infrared_encoder_decoder[i].decoder.check_ready(handler->ctx[i]); if(!result && message) { @@ -209,7 +209,7 @@ void infrared_free_encoder(InfraredEncoderHandler* handler) { } static int infrared_find_index_by_protocol(InfraredProtocol protocol) { - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].get_protocol_spec(protocol)) { return i; } diff --git a/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c b/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c index 10ff56da..3ad14a7a 100644 --- a/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c +++ b/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c @@ -20,7 +20,9 @@ bool infrared_decoder_nec_interpret(InfraredCommonDecoder* decoder) { uint8_t address_inverse = decoder->data[1]; uint8_t command = decoder->data[2]; uint8_t command_inverse = decoder->data[3]; - if((command == (uint8_t)~command_inverse) && (address == (uint8_t)~address_inverse)) { + uint8_t inverse_command_inverse = (uint8_t)~command_inverse; + uint8_t inverse_address_inverse = (uint8_t)~address_inverse; + if((command == inverse_command_inverse) && (address == inverse_address_inverse)) { decoder->message.protocol = InfraredProtocolNEC; decoder->message.address = address; decoder->message.command = command; diff --git a/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c b/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c index 9101cac1..13d3e536 100644 --- a/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c +++ b/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c @@ -60,8 +60,8 @@ InfraredStatus infrared_decoder_rc6_decode_manchester( uint32_t timing) { // 4th bit lasts 2x times more InfraredStatus status = InfraredStatusError; - uint16_t bit = decoder->protocol->timings.bit1_mark; - uint16_t tolerance = decoder->protocol->timings.bit_tolerance; + uint32_t bit = decoder->protocol->timings.bit1_mark; + uint32_t tolerance = decoder->protocol->timings.bit_tolerance; bool single_timing = MATCH_TIMING(timing, bit, tolerance); bool double_timing = MATCH_TIMING(timing, 2 * bit, tolerance); diff --git a/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c b/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c index 4450ffd1..e8cd3b05 100644 --- a/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c +++ b/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c @@ -17,8 +17,9 @@ bool infrared_decoder_samsung32_interpret(InfraredCommonDecoder* decoder) { uint8_t address2 = decoder->data[1]; uint8_t command = decoder->data[2]; uint8_t command_inverse = decoder->data[3]; + uint8_t inverse_command_inverse = (uint8_t)~command_inverse; - if((address1 == address2) && (command == (uint8_t)~command_inverse)) { + if((address1 == address2) && (command == inverse_command_inverse)) { decoder->message.command = command; decoder->message.address = address1; decoder->message.protocol = InfraredProtocolSamsung32; diff --git a/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c b/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c index a6918cee..8ae9e371 100644 --- a/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c +++ b/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c @@ -38,7 +38,7 @@ InfraredStatus infrared_encoder_sirc_encode_repeat( bool* level) { furi_assert(encoder); - furi_assert(encoder->timings_encoded == (1 + 2 + encoder->bits_to_encode * 2 - 1)); + furi_assert(encoder->timings_encoded == (1u + 2 + encoder->bits_to_encode * 2 - 1)); furi_assert(encoder->timings_sum < INFRARED_SIRC_REPEAT_PERIOD); *duration = INFRARED_SIRC_REPEAT_PERIOD - encoder->timings_sum; diff --git a/lib/infrared/worker/infrared_worker.c b/lib/infrared/worker/infrared_worker.c index 5711d2c0..71126c86 100644 --- a/lib/infrared/worker/infrared_worker.c +++ b/lib/infrared/worker/infrared_worker.c @@ -597,6 +597,7 @@ void infrared_worker_set_raw_signal( InfraredWorkerGetSignalResponse infrared_worker_tx_get_signal_steady_callback(void* context, InfraredWorker* instance) { + UNUSED(context); InfraredWorkerGetSignalResponse response = instance->tx.steady_signal_sent ? InfraredWorkerGetSignalResponseSame : InfraredWorkerGetSignalResponseNew; diff --git a/lib/lfs_config.h b/lib/lfs_config.h index a545551c..59b3c486 100644 --- a/lib/lfs_config.h +++ b/lib/lfs_config.h @@ -4,6 +4,9 @@ #ifdef FURI_NDEBUG #define LFS_NO_ASSERT +#define LFS_ASSERT(x) +#else +#define LFS_ASSERT furi_assert #endif #define LFS_TAG "Lfs" @@ -16,7 +19,6 @@ #define LFS_ERROR(...) FURI_LOG_E(LFS_TAG, __VA_ARGS__); -#define LFS_ASSERT furi_assert // Because crc #undef LFS_CONFIG diff --git a/lib/libusb_stm32 b/lib/libusb_stm32 index fd58c2b0..6e64179d 160000 --- a/lib/libusb_stm32 +++ b/lib/libusb_stm32 @@ -1 +1 @@ -Subproject commit fd58c2b04710554626ac69d9fb5fa1211d1bcaf0 +Subproject commit 6e64179d64e5582014a637a108d0870191f7818d diff --git a/lib/micro-ecc/asm_arm.inc b/lib/micro-ecc/asm_arm.inc index 688fdc75..43844da6 100644 --- a/lib/micro-ecc/asm_arm.inc +++ b/lib/micro-ecc/asm_arm.inc @@ -97,6 +97,7 @@ uECC_VLI_API uECC_word_t uECC_vli_add(uECC_word_t *result, } #define asm_add 1 +#pragma GCC diagnostic ignored "-Wredundant-decls" uECC_VLI_API uECC_word_t uECC_vli_sub(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right, diff --git a/lib/micro-ecc/curve-specific.inc b/lib/micro-ecc/curve-specific.inc index 0453b212..f5d3da84 100644 --- a/lib/micro-ecc/curve-specific.inc +++ b/lib/micro-ecc/curve-specific.inc @@ -542,6 +542,7 @@ static void mod_sqrt_secp224r1_rp(uECC_word_t *d1, /* Compute a = sqrt(a) (mod curve_p). */ /* Routine 3.2.8 mp_mod_sqrt_224; from http://www.nsa.gov/ia/_files/nist-routines.pdf */ static void mod_sqrt_secp224r1(uECC_word_t *a, uECC_Curve curve) { + (void)curve; bitcount_t i; uECC_word_t e1[num_words_secp224r1]; uECC_word_t f1[num_words_secp224r1]; diff --git a/lib/nfc_protocols/mifare_classic.c b/lib/nfc_protocols/mifare_classic.c index c738accc..ace37bff 100644 --- a/lib/nfc_protocols/mifare_classic.c +++ b/lib/nfc_protocols/mifare_classic.c @@ -36,6 +36,7 @@ uint8_t mf_classic_get_total_sectors_num(MfClassicReader* reader) { } bool mf_classic_check_card_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) { + UNUSED(ATQA1); if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08)) { return true; } else if((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18)) { @@ -52,6 +53,7 @@ bool mf_classic_get_type( uint8_t ATQA1, uint8_t SAK, MfClassicReader* reader) { + UNUSED(ATQA1); furi_assert(uid); furi_assert(reader); memset(reader, 0, sizeof(MfClassicReader)); @@ -204,7 +206,6 @@ bool mf_classic_read_block( MfClassicBlock* block) { furi_assert(tx_rx); furi_assert(crypto); - furi_assert(block_num < MF_CLASSIC_TOTAL_BLOCKS_MAX); furi_assert(block); bool read_block_success = false; diff --git a/lib/nfc_protocols/mifare_desfire.c b/lib/nfc_protocols/mifare_desfire.c index 6a9c13b6..4f02e839 100644 --- a/lib/nfc_protocols/mifare_desfire.c +++ b/lib/nfc_protocols/mifare_desfire.c @@ -444,4 +444,4 @@ bool mf_df_parse_read_data_response(uint8_t* buf, uint16_t len, MifareDesfireFil out->contents = malloc(len); memcpy(out->contents, buf, len); return true; -} \ No newline at end of file +} diff --git a/lib/nfc_protocols/mifare_ultralight.h b/lib/nfc_protocols/mifare_ultralight.h index 1947f10a..858fc3ec 100644 --- a/lib/nfc_protocols/mifare_ultralight.h +++ b/lib/nfc_protocols/mifare_ultralight.h @@ -123,4 +123,4 @@ bool mf_ul_prepare_emulation_response( uint8_t* buff_tx, uint16_t* buff_tx_len, uint32_t* data_type, - void* context); \ No newline at end of file + void* context); diff --git a/lib/nfc_protocols/nfc_util.c b/lib/nfc_protocols/nfc_util.c index 69c13ed4..9de6f982 100644 --- a/lib/nfc_protocols/nfc_util.c +++ b/lib/nfc_protocols/nfc_util.c @@ -45,19 +45,3 @@ uint8_t nfc_util_even_parity32(uint32_t data) { uint8_t nfc_util_odd_parity8(uint8_t data) { return nfc_util_odd_byte_parity[data]; } - -void nfc_util_merge_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); - -void nfc_util_split_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); \ No newline at end of file diff --git a/lib/nfc_protocols/nfc_util.h b/lib/nfc_protocols/nfc_util.h index caeb20c9..d530badc 100644 --- a/lib/nfc_protocols/nfc_util.h +++ b/lib/nfc_protocols/nfc_util.h @@ -9,19 +9,3 @@ uint64_t nfc_util_bytes2num(uint8_t* src, uint8_t len); uint8_t nfc_util_even_parity32(uint32_t data); uint8_t nfc_util_odd_parity8(uint8_t data); - -void nfc_util_merge_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); - -void nfc_util_split_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); diff --git a/lib/nfc_protocols/nfca.c b/lib/nfc_protocols/nfca.c index fe001f88..81a6ddfc 100755 --- a/lib/nfc_protocols/nfca.c +++ b/lib/nfc_protocols/nfca.c @@ -52,4 +52,4 @@ bool nfca_emulation_handler( } return sleep; -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/encoder/encoder_cyfral.h b/lib/one_wire/ibutton/encoder/encoder_cyfral.h index 1b0c3e12..4fc7be5e 100644 --- a/lib/one_wire/ibutton/encoder/encoder_cyfral.h +++ b/lib/one_wire/ibutton/encoder/encoder_cyfral.h @@ -51,4 +51,4 @@ void encoder_cyfral_get_pulse(EncoderCyfral* cyfral, bool* polarity, uint32_t* l #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/encoder/encoder_metakom.h b/lib/one_wire/ibutton/encoder/encoder_metakom.h index 2812dc12..50ff11a2 100644 --- a/lib/one_wire/ibutton/encoder/encoder_metakom.h +++ b/lib/one_wire/ibutton/encoder/encoder_metakom.h @@ -51,4 +51,4 @@ void encoder_metakom_get_pulse(EncoderMetakom* metakom, bool* polarity, uint32_t #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_key.c b/lib/one_wire/ibutton/ibutton_key.c index c90d5f4a..c6d4466f 100644 --- a/lib/one_wire/ibutton/ibutton_key.c +++ b/lib/one_wire/ibutton/ibutton_key.c @@ -118,4 +118,4 @@ bool ibutton_key_dallas_crc_is_valid(iButtonKey* key) { bool ibutton_key_dallas_is_1990_key(iButtonKey* key) { return (key->data[0] == 0x01); -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/ibutton_key.h b/lib/one_wire/ibutton/ibutton_key.h index f8286103..8d6732bc 100644 --- a/lib/one_wire/ibutton/ibutton_key.h +++ b/lib/one_wire/ibutton/ibutton_key.h @@ -142,4 +142,4 @@ bool ibutton_key_dallas_is_1990_key(iButtonKey* key); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_key_command.h b/lib/one_wire/ibutton/ibutton_key_command.h index 3978ea51..88049d06 100644 --- a/lib/one_wire/ibutton/ibutton_key_command.h +++ b/lib/one_wire/ibutton/ibutton_key_command.h @@ -25,4 +25,4 @@ #define TM01_CMD_SWITCH_TO_CYFRAL 0xCA #define TM01_CMD_SWITCH_TO_METAKOM 0xCB -#define DS1990_CMD_READ_ROM 0x33 \ No newline at end of file +#define DS1990_CMD_READ_ROM 0x33 diff --git a/lib/one_wire/ibutton/ibutton_worker.h b/lib/one_wire/ibutton/ibutton_worker.h index 3350e05f..5c8b1fc3 100644 --- a/lib/one_wire/ibutton/ibutton_worker.h +++ b/lib/one_wire/ibutton/ibutton_worker.h @@ -110,4 +110,4 @@ void ibutton_worker_stop(iButtonWorker* worker); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_worker_i.h b/lib/one_wire/ibutton/ibutton_worker_i.h index 14e5d39d..ae2d4dc3 100644 --- a/lib/one_wire/ibutton/ibutton_worker_i.h +++ b/lib/one_wire/ibutton/ibutton_worker_i.h @@ -27,9 +27,9 @@ typedef enum { typedef struct { const uint32_t quant; - const void (*start)(iButtonWorker* worker); - const void (*tick)(iButtonWorker* worker); - const void (*stop)(iButtonWorker* worker); + void (*const start) (iButtonWorker* worker); + void (*const tick) (iButtonWorker* worker); + void (*const stop) (iButtonWorker* worker); } iButtonWorkerModeType; typedef enum { @@ -76,4 +76,4 @@ void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_worker_modes.c b/lib/one_wire/ibutton/ibutton_worker_modes.c index 7ee3a005..ff5ba351 100644 --- a/lib/one_wire/ibutton/ibutton_worker_modes.c +++ b/lib/one_wire/ibutton/ibutton_worker_modes.c @@ -49,12 +49,15 @@ const iButtonWorkerModeType ibutton_worker_modes[] = { /*********************** IDLE ***********************/ void ibutton_worker_mode_idle_start(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_idle_tick(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_idle_stop(iButtonWorker* worker) { + UNUSED(worker); } /*********************** READ ***********************/ @@ -151,6 +154,7 @@ bool ibutton_worker_read_dallas(iButtonWorker* worker) { } void ibutton_worker_mode_read_start(iButtonWorker* worker) { + UNUSED(worker); furi_hal_power_enable_otg(); } @@ -172,6 +176,7 @@ void ibutton_worker_mode_read_tick(iButtonWorker* worker) { } void ibutton_worker_mode_read_stop(iButtonWorker* worker) { + UNUSED(worker); furi_hal_power_disable_otg(); } @@ -251,6 +256,7 @@ void ibutton_worker_emulate_timer_start(iButtonWorker* worker) { } void ibutton_worker_emulate_timer_stop(iButtonWorker* worker) { + UNUSED(worker); furi_hal_ibutton_emulate_stop(); } @@ -272,6 +278,7 @@ void ibutton_worker_mode_emulate_start(iButtonWorker* worker) { } void ibutton_worker_mode_emulate_tick(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_emulate_stop(iButtonWorker* worker) { @@ -327,4 +334,4 @@ void ibutton_worker_mode_write_tick(iButtonWorker* worker) { void ibutton_worker_mode_write_stop(iButtonWorker* worker) { furi_hal_power_disable_otg(); onewire_host_stop(worker->host); -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/ibutton_writer.h b/lib/one_wire/ibutton/ibutton_writer.h index 8e81cfd1..6dbdbb27 100644 --- a/lib/one_wire/ibutton/ibutton_writer.h +++ b/lib/one_wire/ibutton/ibutton_writer.h @@ -57,4 +57,4 @@ void ibutton_writer_stop(iButtonWriter* writer); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h b/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h index 4a7c00e4..10305da1 100644 --- a/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h +++ b/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h @@ -35,4 +35,4 @@ PulseProtocol* protocol_cyfral_get_protocol(ProtocolCyfral* cyfral); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h b/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h index fbafc235..fdc45769 100644 --- a/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h +++ b/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h @@ -35,4 +35,4 @@ PulseProtocol* protocol_metakom_get_protocol(ProtocolMetakom* metakom); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/maxim_crc.c b/lib/one_wire/maxim_crc.c index bd89d3ad..a5d099b1 100644 --- a/lib/one_wire/maxim_crc.c +++ b/lib/one_wire/maxim_crc.c @@ -13,4 +13,4 @@ uint8_t maxim_crc8(const uint8_t* data, const uint8_t data_size, const uint8_t c } } return crc; -} \ No newline at end of file +} diff --git a/lib/one_wire/maxim_crc.h b/lib/one_wire/maxim_crc.h index 1b7e8498..4bab5714 100644 --- a/lib/one_wire/maxim_crc.h +++ b/lib/one_wire/maxim_crc.h @@ -11,4 +11,4 @@ uint8_t maxim_crc8(const uint8_t* data, const uint8_t data_size, const uint8_t c #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_device.h b/lib/one_wire/one_wire_device.h index 4ff16790..fc687c7b 100644 --- a/lib/one_wire/one_wire_device.h +++ b/lib/one_wire/one_wire_device.h @@ -71,4 +71,4 @@ uint8_t* onewire_device_get_id_p(OneWireDevice* device); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_host.c b/lib/one_wire/one_wire_host.c index fd8deaf8..1bb0a1cc 100644 --- a/lib/one_wire/one_wire_host.c +++ b/lib/one_wire/one_wire_host.c @@ -23,6 +23,7 @@ void onewire_host_free(OneWireHost* host) { } bool onewire_host_reset(OneWireHost* host) { + UNUSED(host); uint8_t r; uint8_t retries = 125; @@ -52,6 +53,7 @@ bool onewire_host_reset(OneWireHost* host) { } bool onewire_host_read_bit(OneWireHost* host) { + UNUSED(host); bool result; // drive low @@ -88,6 +90,7 @@ void onewire_host_read_bytes(OneWireHost* host, uint8_t* buffer, uint16_t count) } void onewire_host_write_bit(OneWireHost* host, bool value) { + UNUSED(host); if(value) { // drive low furi_hal_ibutton_pin_low(); @@ -120,10 +123,12 @@ void onewire_host_skip(OneWireHost* host) { } void onewire_host_start(OneWireHost* host) { + UNUSED(host); furi_hal_ibutton_start_drive(); } void onewire_host_stop(OneWireHost* host) { + UNUSED(host); furi_hal_ibutton_stop(); } diff --git a/lib/one_wire/one_wire_host.h b/lib/one_wire/one_wire_host.h index 21530640..5b55ee8d 100644 --- a/lib/one_wire/one_wire_host.h +++ b/lib/one_wire/one_wire_host.h @@ -118,4 +118,4 @@ uint8_t onewire_host_search(OneWireHost* host, uint8_t* newAddr, OneWireHostSear #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_slave.c b/lib/one_wire/one_wire_slave.c index e8cc5ac1..3c9a796d 100644 --- a/lib/one_wire/one_wire_slave.c +++ b/lib/one_wire/one_wire_slave.c @@ -37,6 +37,7 @@ struct OneWireSlave { /*********************** PRIVATE ***********************/ uint32_t onewire_slave_wait_while_gpio_is(OneWireSlave* bus, uint32_t time, const bool pin_value) { + UNUSED(bus); uint32_t start = DWT->CYCCNT; uint32_t time_ticks = time * furi_hal_delay_instructions_per_microsecond(); uint32_t time_captured; @@ -253,6 +254,7 @@ void onewire_slave_start(OneWireSlave* bus) { } void onewire_slave_stop(OneWireSlave* bus) { + UNUSED(bus); furi_hal_ibutton_stop(); furi_hal_ibutton_remove_interrupt(); } diff --git a/lib/one_wire/pulse_protocols/pulse_decoder.h b/lib/one_wire/pulse_protocols/pulse_decoder.h index 4e9f9d22..dbaef52b 100644 --- a/lib/one_wire/pulse_protocols/pulse_decoder.h +++ b/lib/one_wire/pulse_protocols/pulse_decoder.h @@ -67,4 +67,4 @@ void pulse_decoder_get_data(PulseDecoder* decoder, int32_t index, uint8_t* data, #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/pulse_protocols/pulse_glue.h b/lib/one_wire/pulse_protocols/pulse_glue.h index aa58f239..4954e271 100644 --- a/lib/one_wire/pulse_protocols/pulse_glue.h +++ b/lib/one_wire/pulse_protocols/pulse_glue.h @@ -23,4 +23,4 @@ void pulse_glue_pop(PulseGlue* pulse_glue, uint32_t* length, uint32_t* period); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/pulse_protocols/pulse_protocol.c b/lib/one_wire/pulse_protocols/pulse_protocol.c index ac01ea92..76feba11 100644 --- a/lib/one_wire/pulse_protocols/pulse_protocol.c +++ b/lib/one_wire/pulse_protocols/pulse_protocol.c @@ -64,4 +64,4 @@ void pulse_protocol_get_data(PulseProtocol* protocol, uint8_t* data, size_t leng if(protocol->get_data_cb != NULL) { protocol->get_data_cb(protocol->context, data, length); } -} \ No newline at end of file +} diff --git a/lib/one_wire/pulse_protocols/pulse_protocol.h b/lib/one_wire/pulse_protocols/pulse_protocol.h index 01bc14a1..bfce0e76 100644 --- a/lib/one_wire/pulse_protocols/pulse_protocol.h +++ b/lib/one_wire/pulse_protocols/pulse_protocol.h @@ -119,4 +119,4 @@ void pulse_protocol_reset(PulseProtocol* protocol); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/qrcode/qrcode.c b/lib/qrcode/qrcode.c index cbbf4a47..fb5bd8a6 100644 --- a/lib/qrcode/qrcode.c +++ b/lib/qrcode/qrcode.c @@ -972,4 +972,4 @@ bool qrcode_getModule(QRCode* qrcode, uint8_t x, uint8_t y) { uint32_t offset = y * qrcode->size + x; return (qrcode->modules[offset >> 3] & (1 << (7 - (offset & 0x07)))) != 0; -} \ No newline at end of file +} diff --git a/lib/qrcode/qrcode.h b/lib/qrcode/qrcode.h index bc3ccb59..6d637ba0 100644 --- a/lib/qrcode/qrcode.h +++ b/lib/qrcode/qrcode.h @@ -96,4 +96,4 @@ bool qrcode_getModule(QRCode* qrcode, uint8_t x, uint8_t y); } #endif /* __cplusplus */ -#endif /* __QRCODE_H_ */ \ No newline at end of file +#endif /* __QRCODE_H_ */ diff --git a/lib/subghz/protocols/came.c b/lib/subghz/protocols/came.c index 467e3154..8817b380 100644 --- a/lib/subghz/protocols/came.c +++ b/lib/subghz/protocols/came.c @@ -76,6 +76,7 @@ const SubGhzProtocol subghz_protocol_came = { }; void* subghz_protocol_encoder_came_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderCame* instance = malloc(sizeof(SubGhzProtocolEncoderCame)); instance->base.protocol = &subghz_protocol_came; @@ -182,6 +183,7 @@ LevelDuration subghz_protocol_encoder_came_yield(void* context) { } void* subghz_protocol_decoder_came_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderCame* instance = malloc(sizeof(SubGhzProtocolDecoderCame)); instance->base.protocol = &subghz_protocol_came; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/came_atomo.c b/lib/subghz/protocols/came_atomo.c index 67d5398f..51e7fe0b 100644 --- a/lib/subghz/protocols/came_atomo.c +++ b/lib/subghz/protocols/came_atomo.c @@ -136,7 +136,7 @@ void subghz_protocol_decoder_came_atomo_feed(void* context, bool level, uint32_t subghz_protocol_came_atomo_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_came_atomo_const.te_long * 2 + + duration >= ((uint32_t)subghz_protocol_came_atomo_const.te_long * 2 + subghz_protocol_came_atomo_const.te_delta)) { if(instance->decoder.decode_count_bit == subghz_protocol_came_atomo_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/came_twee.c b/lib/subghz/protocols/came_twee.c index fe5f7877..4ca11623 100644 --- a/lib/subghz/protocols/came_twee.c +++ b/lib/subghz/protocols/came_twee.c @@ -103,6 +103,7 @@ const SubGhzProtocol subghz_protocol_came_twee = { }; void* subghz_protocol_encoder_came_twee_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderCameTwee* instance = malloc(sizeof(SubGhzProtocolEncoderCameTwee)); instance->base.protocol = &subghz_protocol_came_twee; @@ -289,6 +290,7 @@ LevelDuration subghz_protocol_encoder_came_twee_yield(void* context) { } void* subghz_protocol_decoder_came_twee_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderCameTwee* instance = malloc(sizeof(SubGhzProtocolDecoderCameTwee)); instance->base.protocol = &subghz_protocol_came_twee; instance->generic.protocol_name = instance->base.protocol->name; @@ -351,7 +353,7 @@ void subghz_protocol_decoder_came_twee_feed(void* context, bool level, uint32_t subghz_protocol_came_twee_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_came_twee_const.te_long * 2 + + duration >= ((uint32_t)subghz_protocol_came_twee_const.te_long * 2 + subghz_protocol_came_twee_const.te_delta)) { if(instance->decoder.decode_count_bit >= subghz_protocol_came_twee_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/faac_slh.c b/lib/subghz/protocols/faac_slh.c index d5006ae6..d5761831 100644 --- a/lib/subghz/protocols/faac_slh.c +++ b/lib/subghz/protocols/faac_slh.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_faac_slh = { }; void* subghz_protocol_decoder_faac_slh_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderFaacSLH* instance = malloc(sizeof(SubGhzProtocolDecoderFaacSLH)); instance->base.protocol = &subghz_protocol_faac_slh; instance->generic.protocol_name = instance->base.protocol->name; @@ -111,7 +112,7 @@ void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t d break; case FaacSLHDecoderStepSaveDuration: if(level) { - if(duration >= (subghz_protocol_faac_slh_const.te_short * 3 + + if(duration >= ((uint32_t)subghz_protocol_faac_slh_const.te_short * 3 + subghz_protocol_faac_slh_const.te_delta)) { instance->decoder.parser_step = FaacSLHDecoderStepFoundPreambula; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/firefly.c b/lib/subghz/protocols/firefly.c index 3a339e0a..21047a30 100644 --- a/lib/subghz/protocols/firefly.c +++ b/lib/subghz/protocols/firefly.c @@ -75,6 +75,7 @@ const SubGhzProtocol subghz_protocol_firefly = { }; void* subghz_protocol_encoder_firefly_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderFirefly* instance = malloc(sizeof(SubGhzProtocolEncoderFirefly)); instance->base.protocol = &subghz_protocol_firefly; @@ -193,6 +194,7 @@ LevelDuration subghz_protocol_encoder_firefly_yield(void* context) { } void* subghz_protocol_decoder_firefly_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderFirefly* instance = malloc(sizeof(SubGhzProtocolDecoderFirefly)); instance->base.protocol = &subghz_protocol_firefly; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/gate_tx.c b/lib/subghz/protocols/gate_tx.c index dd6548a2..5f124c37 100644 --- a/lib/subghz/protocols/gate_tx.c +++ b/lib/subghz/protocols/gate_tx.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_gate_tx = { }; void* subghz_protocol_encoder_gate_tx_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderGateTx* instance = malloc(sizeof(SubGhzProtocolEncoderGateTx)); instance->base.protocol = &subghz_protocol_gate_tx; @@ -175,6 +176,7 @@ LevelDuration subghz_protocol_encoder_gate_tx_yield(void* context) { } void* subghz_protocol_decoder_gate_tx_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderGateTx* instance = malloc(sizeof(SubGhzProtocolDecoderGateTx)); instance->base.protocol = &subghz_protocol_gate_tx; instance->generic.protocol_name = instance->base.protocol->name; @@ -218,7 +220,7 @@ void subghz_protocol_decoder_gate_tx_feed(void* context, bool level, uint32_t du break; case GateTXDecoderStepSaveDuration: if(!level) { - if(duration >= (subghz_protocol_gate_tx_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_gate_tx_const.te_short * 10 + subghz_protocol_gate_tx_const.te_delta)) { instance->decoder.parser_step = GateTXDecoderStepFoundStartBit; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/hormann.c b/lib/subghz/protocols/hormann.c index 7a3fd233..20ff50fc 100644 --- a/lib/subghz/protocols/hormann.c +++ b/lib/subghz/protocols/hormann.c @@ -72,6 +72,7 @@ const SubGhzProtocol subghz_protocol_hormann = { }; void* subghz_protocol_encoder_hormann_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderHormann* instance = malloc(sizeof(SubGhzProtocolEncoderHormann)); instance->base.protocol = &subghz_protocol_hormann; @@ -191,6 +192,7 @@ LevelDuration subghz_protocol_encoder_hormann_yield(void* context) { } void* subghz_protocol_decoder_hormann_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderHormann* instance = malloc(sizeof(SubGhzProtocolDecoderHormann)); instance->base.protocol = &subghz_protocol_hormann; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/ido.c b/lib/subghz/protocols/ido.c index d2962435..93693b68 100644 --- a/lib/subghz/protocols/ido.c +++ b/lib/subghz/protocols/ido.c @@ -68,6 +68,7 @@ const SubGhzProtocol subghz_protocol_ido = { }; void* subghz_protocol_decoder_ido_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderIDo* instance = malloc(sizeof(SubGhzProtocolDecoderIDo)); instance->base.protocol = &subghz_protocol_ido; instance->generic.protocol_name = instance->base.protocol->name; @@ -111,8 +112,8 @@ void subghz_protocol_decoder_ido_feed(void* context, bool level, uint32_t durati break; case IDoDecoderStepSaveDuration: if(level) { - if(duration >= - (subghz_protocol_ido_const.te_short * 5 + subghz_protocol_ido_const.te_delta)) { + if(duration >= ((uint32_t)subghz_protocol_ido_const.te_short * 5 + + subghz_protocol_ido_const.te_delta)) { instance->decoder.parser_step = IDoDecoderStepFoundPreambula; if(instance->decoder.decode_count_bit >= subghz_protocol_ido_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/ido.h b/lib/subghz/protocols/ido.h index c53a1593..266529e1 100644 --- a/lib/subghz/protocols/ido.h +++ b/lib/subghz/protocols/ido.h @@ -72,4 +72,4 @@ bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipp * @param context Pointer to a SubGhzProtocolDecoderIDo instance * @param output Resulting text */ -void subghz_protocol_decoder_ido_get_string(void* context, string_t output); \ No newline at end of file +void subghz_protocol_decoder_ido_get_string(void* context, string_t output); diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index 9c6673e8..566ae576 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -384,7 +384,7 @@ void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t dur break; case KeeloqDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_keeloq_const.te_short * 2 + + if(duration >= ((uint32_t)subghz_protocol_keeloq_const.te_short * 2 + subghz_protocol_keeloq_const.te_delta)) { // Found end TX instance->decoder.parser_step = KeeloqDecoderStepReset; diff --git a/lib/subghz/protocols/keeloq_common.c b/lib/subghz/protocols/keeloq_common.c index 9dfc0934..7e864a32 100644 --- a/lib/subghz/protocols/keeloq_common.c +++ b/lib/subghz/protocols/keeloq_common.c @@ -81,4 +81,4 @@ inline uint64_t subghz_protocol_keeloq_common_magic_xor_type1_learning(uint32_t data, uint64_t xor) { data &= 0x0FFFFFFF; return (((uint64_t)data << 32) | data) ^ xor; -} \ No newline at end of file +} diff --git a/lib/subghz/protocols/kia.c b/lib/subghz/protocols/kia.c index f623a61d..5a89934b 100644 --- a/lib/subghz/protocols/kia.c +++ b/lib/subghz/protocols/kia.c @@ -70,6 +70,7 @@ const SubGhzProtocol subghz_protocol_kia = { }; void* subghz_protocol_decoder_kia_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderKIA* instance = malloc(sizeof(SubGhzProtocolDecoderKIA)); instance->base.protocol = &subghz_protocol_kia; instance->generic.protocol_name = instance->base.protocol->name; @@ -141,7 +142,7 @@ void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t durati case KIADecoderStepSaveDuration: if(level) { if(duration >= - (subghz_protocol_kia_const.te_long + subghz_protocol_kia_const.te_delta * 2)) { + (uint32_t)(subghz_protocol_kia_const.te_long + subghz_protocol_kia_const.te_delta * 2)) { //Found stop bit instance->decoder.parser_step = KIADecoderStepReset; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/nero_radio.c b/lib/subghz/protocols/nero_radio.c index d25c377a..6797843f 100644 --- a/lib/subghz/protocols/nero_radio.c +++ b/lib/subghz/protocols/nero_radio.c @@ -71,6 +71,7 @@ const SubGhzProtocol subghz_protocol_nero_radio = { }; void* subghz_protocol_encoder_nero_radio_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNeroRadio* instance = malloc(sizeof(SubGhzProtocolEncoderNeroRadio)); instance->base.protocol = &subghz_protocol_nero_radio; @@ -200,6 +201,7 @@ LevelDuration subghz_protocol_encoder_nero_radio_yield(void* context) { } void* subghz_protocol_decoder_nero_radio_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNeroRadio* instance = malloc(sizeof(SubGhzProtocolDecoderNeroRadio)); instance->base.protocol = &subghz_protocol_nero_radio; instance->generic.protocol_name = instance->base.protocol->name; @@ -278,7 +280,7 @@ void subghz_protocol_decoder_nero_radio_feed(void* context, bool level, uint32_t break; case NeroRadioDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_nero_radio_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_nero_radio_const.te_short * 10 + subghz_protocol_nero_radio_const.te_delta * 2)) { //Found stop bit if(DURATION_DIFF( diff --git a/lib/subghz/protocols/nero_sketch.c b/lib/subghz/protocols/nero_sketch.c index 474b742a..1ba0cf86 100644 --- a/lib/subghz/protocols/nero_sketch.c +++ b/lib/subghz/protocols/nero_sketch.c @@ -70,6 +70,7 @@ const SubGhzProtocol subghz_protocol_nero_sketch = { }; void* subghz_protocol_encoder_nero_sketch_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNeroSketch* instance = malloc(sizeof(SubGhzProtocolEncoderNeroSketch)); instance->base.protocol = &subghz_protocol_nero_sketch; @@ -194,6 +195,7 @@ LevelDuration subghz_protocol_encoder_nero_sketch_yield(void* context) { } void* subghz_protocol_decoder_nero_sketch_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNeroSketch* instance = malloc(sizeof(SubGhzProtocolDecoderNeroSketch)); instance->base.protocol = &subghz_protocol_nero_sketch; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/nice_flo.c b/lib/subghz/protocols/nice_flo.c index 6f94e8fd..d2844dcd 100644 --- a/lib/subghz/protocols/nice_flo.c +++ b/lib/subghz/protocols/nice_flo.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_nice_flo = { }; void* subghz_protocol_encoder_nice_flo_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNiceFlo* instance = malloc(sizeof(SubGhzProtocolEncoderNiceFlo)); instance->base.protocol = &subghz_protocol_nice_flo; @@ -175,6 +176,7 @@ LevelDuration subghz_protocol_encoder_nice_flo_yield(void* context) { } void* subghz_protocol_decoder_nice_flo_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNiceFlo* instance = malloc(sizeof(SubGhzProtocolDecoderNiceFlo)); instance->base.protocol = &subghz_protocol_nice_flo; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/nice_flo.h b/lib/subghz/protocols/nice_flo.h index ca5cfe3f..430b111d 100644 --- a/lib/subghz/protocols/nice_flo.h +++ b/lib/subghz/protocols/nice_flo.h @@ -106,4 +106,4 @@ bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat* * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance * @param output Resulting text */ -void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output); \ No newline at end of file +void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output); diff --git a/lib/subghz/protocols/princeton.c b/lib/subghz/protocols/princeton.c index 42f035e6..7579a3ca 100644 --- a/lib/subghz/protocols/princeton.c +++ b/lib/subghz/protocols/princeton.c @@ -80,6 +80,7 @@ const SubGhzProtocol subghz_protocol_princeton = { }; void* subghz_protocol_encoder_princeton_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderPrinceton* instance = malloc(sizeof(SubGhzProtocolEncoderPrinceton)); instance->base.protocol = &subghz_protocol_princeton; @@ -194,6 +195,7 @@ LevelDuration subghz_protocol_encoder_princeton_yield(void* context) { } void* subghz_protocol_decoder_princeton_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderPrinceton* instance = malloc(sizeof(SubGhzProtocolDecoderPrinceton)); instance->base.protocol = &subghz_protocol_princeton; instance->generic.protocol_name = instance->base.protocol->name; @@ -238,7 +240,7 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t break; case PrincetonDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_princeton_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_princeton_const.te_short * 10 + subghz_protocol_princeton_const.te_delta)) { instance->decoder.parser_step = PrincetonDecoderStepSaveDuration; if(instance->decoder.decode_count_bit == diff --git a/lib/subghz/protocols/princeton_for_testing.c b/lib/subghz/protocols/princeton_for_testing.c index bdf5f429..5c3f7151 100644 --- a/lib/subghz/protocols/princeton_for_testing.c +++ b/lib/subghz/protocols/princeton_for_testing.c @@ -249,7 +249,7 @@ void subghz_decoder_princeton_for_testing_parse( break; case PrincetonDecoderStepCheckDuration: if(!level) { - if(duration >= (instance->te_short * 10 + instance->te_delta)) { + if(duration >= ((uint32_t)instance->te_short * 10 + instance->te_delta)) { instance->parser_step = PrincetonDecoderStepSaveDuration; if(instance->code_count_bit == instance->code_min_count_bit_for_found) { instance->te /= (instance->code_count_bit * 4 + 1); diff --git a/lib/subghz/protocols/raw.c b/lib/subghz/protocols/raw.c index 111f4536..516aa633 100644 --- a/lib/subghz/protocols/raw.c +++ b/lib/subghz/protocols/raw.c @@ -192,6 +192,7 @@ size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolDecoderRAW* instance) } void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderRAW* instance = malloc(sizeof(SubGhzProtocolDecoderRAW)); instance->base.protocol = &subghz_protocol_raw; instance->upload_raw = NULL; @@ -243,6 +244,7 @@ void subghz_protocol_decoder_raw_get_string(void* context, string_t output) { } void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderRAW* instance = malloc(sizeof(SubGhzProtocolEncoderRAW)); instance->base.protocol = &subghz_protocol_raw; diff --git a/lib/subghz/protocols/scher_khan.c b/lib/subghz/protocols/scher_khan.c index c352b4ae..a9a7c040 100644 --- a/lib/subghz/protocols/scher_khan.c +++ b/lib/subghz/protocols/scher_khan.c @@ -76,6 +76,7 @@ const SubGhzProtocol subghz_protocol_scher_khan = { }; void* subghz_protocol_decoder_scher_khan_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderScherKhan* instance = malloc(sizeof(SubGhzProtocolDecoderScherKhan)); instance->base.protocol = &subghz_protocol_scher_khan; instance->generic.protocol_name = instance->base.protocol->name; @@ -150,7 +151,7 @@ void subghz_protocol_decoder_scher_khan_feed(void* context, bool level, uint32_t break; case ScherKhanDecoderStepSaveDuration: if(level) { - if(duration >= (subghz_protocol_scher_khan_const.te_long + + if(duration >= (uint32_t)(subghz_protocol_scher_khan_const.te_long + subghz_protocol_scher_khan_const.te_delta * 2)) { //Found stop bit instance->decoder.parser_step = ScherKhanDecoderStepReset; diff --git a/lib/subghz/protocols/secplus_v1.c b/lib/subghz/protocols/secplus_v1.c index 1ad605b2..ff43e2a4 100644 --- a/lib/subghz/protocols/secplus_v1.c +++ b/lib/subghz/protocols/secplus_v1.c @@ -89,6 +89,7 @@ const SubGhzProtocol subghz_protocol_secplus_v1 = { }; void* subghz_protocol_decoder_secplus_v1_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSecPlus_v1* instance = malloc(sizeof(SubGhzProtocolDecoderSecPlus_v1)); instance->base.protocol = &subghz_protocol_secplus_v1; instance->generic.protocol_name = instance->base.protocol->name; @@ -321,7 +322,7 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu // pin = (fixed // 3**10) % (3**9) 3^10=59049 3^9=19683 pin = (fixed / 59049) % 19683; - if(0 <= pin && pin <= 9999) { + if(pin <= 9999) { string_cat_printf(output, " pin:%d", pin); } else if(10000 <= pin && pin <= 11029) { string_cat_printf(output, " pin:enter"); diff --git a/lib/subghz/protocols/secplus_v2.c b/lib/subghz/protocols/secplus_v2.c index 4ad1ea9e..936eb0a6 100644 --- a/lib/subghz/protocols/secplus_v2.c +++ b/lib/subghz/protocols/secplus_v2.c @@ -81,6 +81,7 @@ const SubGhzProtocol subghz_protocol_secplus_v2 = { }; void* subghz_protocol_decoder_secplus_v2_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSecPlus_v2* instance = malloc(sizeof(SubGhzProtocolDecoderSecPlus_v2)); instance->base.protocol = &subghz_protocol_secplus_v2; instance->generic.protocol_name = instance->base.protocol->name; @@ -154,7 +155,7 @@ void subghz_protocol_decoder_secplus_v2_feed(void* context, bool level, uint32_t subghz_protocol_secplus_v2_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_secplus_v2_const.te_long * 2 + + duration >= (uint32_t)(subghz_protocol_secplus_v2_const.te_long * 2 + subghz_protocol_secplus_v2_const.te_delta)) { if(instance->decoder.decode_count_bit >= subghz_protocol_secplus_v2_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/somfy_keytis.c b/lib/subghz/protocols/somfy_keytis.c index 9f58d734..764e8147 100644 --- a/lib/subghz/protocols/somfy_keytis.c +++ b/lib/subghz/protocols/somfy_keytis.c @@ -75,6 +75,7 @@ const SubGhzProtocol subghz_protocol_somfy_keytis = { }; void* subghz_protocol_decoder_somfy_keytis_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSomfyKeytis* instance = malloc(sizeof(SubGhzProtocolDecoderSomfyKeytis)); instance->base.protocol = &subghz_protocol_somfy_keytis; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/somfy_telis.c b/lib/subghz/protocols/somfy_telis.c index 4f1212bc..63407427 100644 --- a/lib/subghz/protocols/somfy_telis.c +++ b/lib/subghz/protocols/somfy_telis.c @@ -74,6 +74,7 @@ const SubGhzProtocol subghz_protocol_somfy_telis = { }; void* subghz_protocol_decoder_somfy_telis_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSomfyTelis* instance = malloc(sizeof(SubGhzProtocolDecoderSomfyTelis)); instance->base.protocol = &subghz_protocol_somfy_telis; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/subghz_keystore.c b/lib/subghz/subghz_keystore.c index 1acb6ba5..d3903bc5 100644 --- a/lib/subghz/subghz_keystore.c +++ b/lib/subghz/subghz_keystore.c @@ -303,7 +303,7 @@ bool subghz_keystore_save(SubGhzKeystore* instance, const char* file_name, uint8 } // HEX Encode encrypted line const char xx[] = "0123456789ABCDEF"; - for(size_t i = 0; i < len; i++) { + for(int i = 0; i < len; i++) { size_t cursor = len - i - 1; size_t hex_cursor = len * 2 - i * 2 - 1; encrypted_line[hex_cursor] = xx[encrypted_line[cursor] & 0xF]; @@ -601,4 +601,4 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t* string_clear(str_temp); return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/args.c b/lib/toolbox/args.c index 8d6295dd..287ca7ef 100644 --- a/lib/toolbox/args.c +++ b/lib/toolbox/args.c @@ -92,4 +92,4 @@ bool args_read_hex_bytes(string_t args, uint8_t* bytes, size_t bytes_count) { } return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/args.h b/lib/toolbox/args.h index 4ae1e1db..dc72bdaf 100644 --- a/lib/toolbox/args.h +++ b/lib/toolbox/args.h @@ -78,4 +78,4 @@ bool args_char_to_hex(char hi_nibble, char low_nibble, uint8_t* byte); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/hex.c b/lib/toolbox/hex.c index 8b443e12..739eb30b 100644 --- a/lib/toolbox/hex.c +++ b/lib/toolbox/hex.c @@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value) { } else { return false; } -} \ No newline at end of file +} diff --git a/lib/toolbox/hex.h b/lib/toolbox/hex.h index ac67549a..ca10f2be 100644 --- a/lib/toolbox/hex.h +++ b/lib/toolbox/hex.h @@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/level_duration.h b/lib/toolbox/level_duration.h index bef0b6ec..9406cef3 100644 --- a/lib/toolbox/level_duration.h +++ b/lib/toolbox/level_duration.h @@ -79,4 +79,4 @@ static inline uint32_t level_duration_get_duration(LevelDuration level_duration) return (level_duration >= 0) ? level_duration : -level_duration; } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/manchester_decoder.h b/lib/toolbox/manchester_decoder.h index 580d88e2..4fb6dbc6 100644 --- a/lib/toolbox/manchester_decoder.h +++ b/lib/toolbox/manchester_decoder.h @@ -28,4 +28,4 @@ bool manchester_advance( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/manchester_encoder.c b/lib/toolbox/manchester_encoder.c index c0fc4ca9..c22e4a17 100644 --- a/lib/toolbox/manchester_encoder.c +++ b/lib/toolbox/manchester_encoder.c @@ -51,4 +51,4 @@ bool manchester_encoder_advance( ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state) { state->step = 0; return (state->prev_bit << 1) + state->prev_bit; -} \ No newline at end of file +} diff --git a/lib/toolbox/manchester_encoder.h b/lib/toolbox/manchester_encoder.h index 639d9b81..57ea8fb4 100644 --- a/lib/toolbox/manchester_encoder.h +++ b/lib/toolbox/manchester_encoder.h @@ -29,4 +29,4 @@ ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state) #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/md5.c b/lib/toolbox/md5.c index b873ee0f..3cf7cf05 100644 --- a/lib/toolbox/md5.c +++ b/lib/toolbox/md5.c @@ -296,4 +296,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]) { md5_finish(&ctx, output); memset(&ctx, 0, sizeof(md5_context)); -} \ No newline at end of file +} diff --git a/lib/toolbox/md5.h b/lib/toolbox/md5.h index 7878881e..fe53db8d 100644 --- a/lib/toolbox/md5.h +++ b/lib/toolbox/md5.h @@ -80,4 +80,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/random_name.c b/lib/toolbox/random_name.c index 34a53867..b581bb97 100644 --- a/lib/toolbox/random_name.c +++ b/lib/toolbox/random_name.c @@ -33,8 +33,8 @@ void set_random_name(char* name, uint8_t max_name_size) { "opening", "crack", }; - uint8_t prefix_i = rand() % SIZEOF_ARRAY(prefix); - uint8_t suffix_i = rand() % SIZEOF_ARRAY(suffix); + uint8_t prefix_i = rand() % COUNT_OF(prefix); + uint8_t suffix_i = rand() % COUNT_OF(suffix); sniprintf(name, max_name_size, "%s_%s", prefix[prefix_i], suffix[suffix_i]); // Set first symbol to upper case diff --git a/lib/toolbox/stream/file_stream.c b/lib/toolbox/stream/file_stream.c index 340cb61a..70db8af9 100644 --- a/lib/toolbox/stream/file_stream.c +++ b/lib/toolbox/stream/file_stream.c @@ -228,4 +228,4 @@ static bool file_stream_delete_and_insert( string_clear(scratch_name); return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/file_stream.h b/lib/toolbox/stream/file_stream.h index ec371a53..4531b3e7 100644 --- a/lib/toolbox/stream/file_stream.h +++ b/lib/toolbox/stream/file_stream.h @@ -44,4 +44,4 @@ FS_Error file_stream_get_error(Stream* stream); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/stream/stream.c b/lib/toolbox/stream/stream.c index 4aee8acd..982c4983 100644 --- a/lib/toolbox/stream/stream.c +++ b/lib/toolbox/stream/stream.c @@ -217,7 +217,7 @@ bool stream_delete_and_insert_vaformat( string_init_vprintf(data, format, args); StreamWriteData write_data = { .data = (uint8_t*)string_get_cstr(data), .size = string_size(data)}; - bool result = stream_delete_and_insert(stream, 0, stream_write_struct, &write_data); + bool result = stream_delete_and_insert(stream, delete_size, stream_write_struct, &write_data); string_clear(data); return result; @@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream) { printf("\r\n"); printf("DATA END\r\n"); stream_seek(stream, tell, StreamOffsetFromStart); -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/stream.h b/lib/toolbox/stream/stream.h index 97ded8bd..c10e9f5e 100644 --- a/lib/toolbox/stream/stream.h +++ b/lib/toolbox/stream/stream.h @@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/stream/stream_i.h b/lib/toolbox/stream/stream_i.h index a62e174c..178d3fee 100644 --- a/lib/toolbox/stream/stream_i.h +++ b/lib/toolbox/stream/stream_i.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define STREAM_CACHE_SIZE 512 +#define STREAM_CACHE_SIZE 512u typedef struct StreamVTable StreamVTable; diff --git a/lib/toolbox/stream/string_stream.c b/lib/toolbox/stream/string_stream.c index 5fec06c3..3244b7ba 100644 --- a/lib/toolbox/stream/string_stream.c +++ b/lib/toolbox/stream/string_stream.c @@ -176,4 +176,4 @@ static size_t string_stream_write_char(StringStream* stream, char c) { stream->index++; return 1; -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/string_stream.h b/lib/toolbox/stream/string_stream.h index 1827258d..6cccfa6c 100644 --- a/lib/toolbox/stream/string_stream.h +++ b/lib/toolbox/stream/string_stream.h @@ -15,4 +15,4 @@ Stream* string_stream_alloc(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/tar/tar_archive.c b/lib/toolbox/tar/tar_archive.c index 315497e1..91d2c812 100644 --- a/lib/toolbox/tar/tar_archive.c +++ b/lib/toolbox/tar/tar_archive.c @@ -345,4 +345,4 @@ bool tar_archive_add_dir(TarArchive* archive, const char* fs_full_path, const ch free(name); storage_file_free(directory); return success; -} \ No newline at end of file +} diff --git a/lib/toolbox/tar/tar_archive.h b/lib/toolbox/tar/tar_archive.h index a8976181..d9b0f321 100644 --- a/lib/toolbox/tar/tar_archive.h +++ b/lib/toolbox/tar/tar_archive.h @@ -63,4 +63,4 @@ bool tar_archive_finalize(TarArchive* archive); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/version.c b/lib/toolbox/version.c index 902be876..40c48370 100644 --- a/lib/toolbox/version.c +++ b/lib/toolbox/version.c @@ -55,4 +55,4 @@ uint8_t version_get_target(const Version* v) { bool version_get_dirty_flag(const Version* v) { return v ? v->build_is_dirty : version.build_is_dirty; -} \ No newline at end of file +} diff --git a/lib/toolbox/version.h b/lib/toolbox/version.h index 7e82e45d..652ff3fe 100644 --- a/lib/toolbox/version.h +++ b/lib/toolbox/version.h @@ -84,4 +84,4 @@ bool version_get_dirty_flag(const Version* v); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/u8g2/u8g2_glue.c b/lib/u8g2/u8g2_glue.c index cc186663..33d30f29 100644 --- a/lib/u8g2/u8g2_glue.c +++ b/lib/u8g2/u8g2_glue.c @@ -3,6 +3,8 @@ #include uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + UNUSED(u8x8); + UNUSED(arg_ptr); switch(msg) { case U8X8_MSG_GPIO_AND_DELAY_INIT: /* HAL initialization contains all what we need so we can skip this part. */ @@ -27,6 +29,7 @@ uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, vo } uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + UNUSED(u8x8); switch(msg) { case U8X8_MSG_BYTE_SEND: furi_hal_spi_bus_tx(&furi_hal_spi_bus_handle_display, (uint8_t*)arg_ptr, arg_int, 10000); diff --git a/lib/u8g2/u8x8_display.c b/lib/u8g2/u8x8_display.c index 76a099b1..83b0ca41 100644 --- a/lib/u8g2/u8x8_display.c +++ b/lib/u8g2/u8x8_display.c @@ -147,4 +147,4 @@ void u8x8_ClearLine(u8x8_t* u8x8, uint8_t line) { u8x8->display_cb( u8x8, U8X8_MSG_DISPLAY_DRAW_TILE, u8x8->display_info->tile_width, (void*)&tile); } -} \ No newline at end of file +} diff --git a/lib/u8g2/u8x8_gpio.c b/lib/u8g2/u8x8_gpio.c index bb1470d3..1fcc0a39 100644 --- a/lib/u8g2/u8x8_gpio.c +++ b/lib/u8g2/u8x8_gpio.c @@ -44,4 +44,4 @@ void u8x8_gpio_Delay(u8x8_t *u8x8, uint8_t msg, uint8_t dly) { u8x8->gpio_and_delay_cb(u8x8, msg, dly, NULL); } -*/ \ No newline at end of file +*/ diff --git a/lib/update_util/update_manifest.c b/lib/update_util/update_manifest.c index 3d05d0ba..555d7cfb 100644 --- a/lib/update_util/update_manifest.c +++ b/lib/update_util/update_manifest.c @@ -179,4 +179,4 @@ bool update_manifest_init_mem( flipper_format_free(flipper_file); return update_manifest->valid; -} \ No newline at end of file +} diff --git a/lib/update_util/update_manifest.h b/lib/update_util/update_manifest.h index d03c71d2..75871e1d 100644 --- a/lib/update_util/update_manifest.h +++ b/lib/update_util/update_manifest.h @@ -59,4 +59,4 @@ bool update_manifest_has_obdata(UpdateManifest* update_manifest); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/update_util/update_operation.c b/lib/update_util/update_operation.c index beea98d2..cf72dd0c 100644 --- a/lib/update_util/update_operation.c +++ b/lib/update_util/update_operation.c @@ -194,4 +194,4 @@ void update_operation_disarm() { void update_operation_persist_package_index(uint32_t index) { furi_hal_rtc_set_register(FuriHalRtcRegisterUpdateFolderFSIndex, index); -} \ No newline at end of file +} diff --git a/lib/update_util/update_operation.h b/lib/update_util/update_operation.h index 6b6ab730..10f3c6b4 100644 --- a/lib/update_util/update_operation.h +++ b/lib/update_util/update_operation.h @@ -69,4 +69,4 @@ void update_operation_disarm(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/make/base.mk b/make/base.mk index 696c4294..281419e9 100644 --- a/make/base.mk +++ b/make/base.mk @@ -8,4 +8,4 @@ OPENOCD_OPTS = CFLAGS = CPPFLAGS = LDFLAGS = -SVD_FILE = \ No newline at end of file +SVD_FILE = diff --git a/make/defaults.mk b/make/defaults.mk index 86e4f03d..ade34a6b 100644 --- a/make/defaults.mk +++ b/make/defaults.mk @@ -1,2 +1,2 @@ TARGET ?= f7 -export TARGET \ No newline at end of file +export TARGET diff --git a/make/freertos-heap.mk b/make/freertos-heap.mk index e839e61c..93992900 100644 --- a/make/freertos-heap.mk +++ b/make/freertos-heap.mk @@ -1 +1 @@ -LDFLAGS += -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_calloc_r -Wl,--wrap,_realloc_r \ No newline at end of file +LDFLAGS += -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_calloc_r -Wl,--wrap,_realloc_r diff --git a/scripts/ReadMe.md b/scripts/ReadMe.md index b04ed0d1..86b5b8af 100644 --- a/scripts/ReadMe.md +++ b/scripts/ReadMe.md @@ -57,4 +57,4 @@ Run in the root folder of the repo: ```bash python scripts/storage.py -p send assets/resources /ext -``` \ No newline at end of file +```