diff options
author | hedger <hedger@users.noreply.github.com> | 2022-05-06 16:37:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 16:37:10 +0300 |
commit | 4d6b170769a33711e62deaf1c2a6b3bdda37e665 (patch) | |
tree | ca65f2896946eaa4cec40f59e2a1817d8221e566 /applications/subghz/views | |
parent | 1ca98170d9ea9ea49ce30046ce99ade01bd0ca08 (diff) |
[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>
Diffstat (limited to 'applications/subghz/views')
-rw-r--r-- | applications/subghz/views/receiver.c | 11 | ||||
-rw-r--r-- | applications/subghz/views/subghz_test_packet.c | 1 |
2 files changed, 7 insertions, 5 deletions
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++; |