[FL-2520] FW build with -Wextra (#1185)
* Fixing compiler warnings with -Wextra * More warnings suppression, WIP * Even more warning fixes * Added new lines at end of text files. * Padding fix * Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline * Fixes for Secplus v1 * -additional warnings * +-Wredundant-decls fixes * FuriHal: print stack overflow task name in console * FuriHal: add missing include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
| @@ -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; | ||||
| extern const uint32_t subghz_frequencies_433_92_testing; | ||||
|   | ||||
| @@ -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) | ||||
| ADD_SCENE(subghz, need_saving, NeedSaving) | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
| @@ -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; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| #pragma once | ||||
|  | ||||
| typedef struct SubGhz SubGhz; | ||||
| typedef struct SubGhz SubGhz; | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
| @@ -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++; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user