[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:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -66,4 +66,4 @@ void byte_input_set_header_text(ByteInput* byte_input, const char* text);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -38,4 +38,4 @@ View* empty_screen_get_view(EmptyScreen* empty_screen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -28,4 +28,4 @@ void file_select_set_selected_file(FileSelect* file_select, const char* filename
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
@@ -19,4 +19,4 @@ bool validator_is_file_callback(const char* text, string_t error, void* context)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user