[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:
hedger
2022-05-06 16:37:10 +03:00
committed by GitHub
parent 1ca98170d9
commit 4d6b170769
461 changed files with 940 additions and 519 deletions

View File

@@ -9,4 +9,4 @@ enum NfcCustomEvent {
NfcCustomEventByteInputDone,
NfcCustomEventTextInputDone,
NfcCustomEventDictAttackDone,
};
};

View File

@@ -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);

View File

@@ -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);

View File

@@ -37,4 +37,4 @@ void nfc_scene_delete_success_on_exit(void* context) {
// Clear view
popup_reset(nfc->popup);
}
}

View File

@@ -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);

View File

@@ -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(

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -2,6 +2,7 @@
#include <dolphin/dolphin.h>
void nfc_read_card_worker_callback(NfcWorkerEvent event, void* context) {
UNUSED(event);
Nfc* nfc = context;
view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit);
}

View File

@@ -2,6 +2,7 @@
#include <dolphin/dolphin.h>
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);
}

View File

@@ -2,6 +2,7 @@
#include <dolphin/dolphin.h>
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);
}

View File

@@ -2,6 +2,7 @@
#include <dolphin/dolphin.h>
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);
}

View File

@@ -2,6 +2,7 @@
#include <dolphin/dolphin.h>
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);
}