mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 19:48:35 -07:00
[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:
@@ -2,7 +2,8 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@ private:
|
||||
|
||||
void reset_state();
|
||||
ProtocolHID10301 hid;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -73,4 +73,4 @@ void DecoderIndala::reset_state() {
|
||||
cursed_raw_data = 0;
|
||||
ready = false;
|
||||
cursed_data_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ private:
|
||||
std::atomic<bool> ready;
|
||||
std::atomic<bool> cursed_data_valid;
|
||||
ProtocolIndala40134 indala;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
#define EM_HEADER_AND_STOP_DATA (EM_HEADER_MASK)
|
||||
|
||||
@@ -19,4 +19,4 @@ private:
|
||||
|
||||
uint64_t card_data;
|
||||
uint8_t card_data_index;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,4 +23,4 @@ private:
|
||||
void write_raw_bit(bool bit, uint8_t position);
|
||||
|
||||
OscFSK* fsk;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -20,4 +20,4 @@ private:
|
||||
bool last_bit;
|
||||
bool current_polarity;
|
||||
static const uint8_t clock_per_bit = 16;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -63,4 +63,4 @@ uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type) {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type);
|
||||
|
||||
@@ -27,4 +27,4 @@ private:
|
||||
const uint16_t freq[2];
|
||||
const uint16_t osc_phase_max;
|
||||
int32_t osc_phase_current;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -57,4 +57,4 @@ public:
|
||||
virtual bool can_be_decoded(const uint8_t* encoded_data, const uint8_t encoded_data_size) = 0;
|
||||
|
||||
virtual ~ProtocolGeneric(){};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -234,4 +234,4 @@ bool ProtocolIndala40134::can_be_decoded(
|
||||
} while(false);
|
||||
|
||||
return can_be_decoded;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,4 @@ private:
|
||||
uint8_t pulse_index = 0;
|
||||
static const uint8_t pulse_max = 6;
|
||||
Pulse pulses[pulse_max];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -45,4 +45,4 @@ private:
|
||||
void sq_write_validate();
|
||||
uint16_t validate_counts;
|
||||
void sq_write_stop_validate();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -22,4 +22,4 @@ private:
|
||||
uint32_t tick_count;
|
||||
|
||||
void do_nothing();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -14,4 +14,4 @@ private:
|
||||
string_t string_header;
|
||||
string_t string_data;
|
||||
string_t string_decrypted;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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<PopupVM>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ public:
|
||||
|
||||
private:
|
||||
static void timeout_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "lfrfid_app_scene_emulate.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
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);
|
||||
|
||||
@@ -9,4 +9,4 @@ public:
|
||||
|
||||
private:
|
||||
string_t data_string;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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<ContainerVM>();
|
||||
|
||||
auto button = container->add<ButtonElement>();
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
static void exit_callback(void* context);
|
||||
static void stay_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "lfrfid_app_scene_read.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) {
|
||||
void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool /* need_restore */) {
|
||||
auto popup = app->view_controller.get<PopupVM>();
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedRfidRead);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
static void submenu_callback(void* context, uint32_t index);
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -12,4 +12,4 @@ private:
|
||||
static void more_callback(void* context);
|
||||
|
||||
string_t string[3];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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<ContainerVM>();
|
||||
|
||||
auto button = container->add<ButtonElement>();
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
static void exit_callback(void* context);
|
||||
static void stay_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,4 +30,4 @@ private:
|
||||
0xBB,
|
||||
0xBB,
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "lfrfid_app_scene_save_name.h"
|
||||
#include <lib/toolbox/random_name.h>
|
||||
|
||||
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, "");
|
||||
|
||||
@@ -9,4 +9,4 @@ public:
|
||||
|
||||
private:
|
||||
static void save_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool need_restore) {
|
||||
void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) {
|
||||
auto popup = app->view_controller.get<PopupVM>();
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedRfidSave);
|
||||
|
||||
@@ -9,4 +9,4 @@ public:
|
||||
|
||||
private:
|
||||
static void timeout_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -12,4 +12,4 @@ private:
|
||||
uint32_t submenu_item_selected = 0;
|
||||
static const uint8_t keys_count = static_cast<uint8_t>(LfrfidKeyType::KeyI40134);
|
||||
string_t submenu_name[keys_count + 1];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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<ContainerVM>();
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -12,4 +12,4 @@ private:
|
||||
|
||||
string_t string_data;
|
||||
string_t string_decrypted;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
static void submenu_callback(void* context, uint32_t index);
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
void LfRfidAppSceneSelectKey::on_exit(LfRfidApp* /* app */) {
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
static void submenu_callback(void* context, uint32_t index);
|
||||
uint32_t submenu_item_selected = 0;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
private:
|
||||
string_t data_string;
|
||||
bool card_not_supported;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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<PopupVM>();
|
||||
popup->set_header("Successfully\nwritten!", 94, 3, AlignCenter, AlignTop);
|
||||
popup->set_icon(0, 6, &I_RFIDDolphinSuccess_108x57);
|
||||
|
||||
@@ -9,4 +9,4 @@ public:
|
||||
|
||||
private:
|
||||
static void timeout_callback(void* context);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -112,4 +112,4 @@ bool ContainerVM::view_input_callback(InputEvent* event, void* context) {
|
||||
|
||||
template StringElement* ContainerVM::add<StringElement>();
|
||||
template IconElement* ContainerVM::add<IconElement>();
|
||||
template ButtonElement* ContainerVM::add<ButtonElement>();
|
||||
template ButtonElement* ContainerVM::add<ButtonElement>();
|
||||
|
||||
@@ -18,4 +18,4 @@ public:
|
||||
|
||||
private:
|
||||
View* view = nullptr;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ void IconElement::draw(Canvas* canvas) {
|
||||
}
|
||||
}
|
||||
|
||||
bool IconElement::input(InputEvent* event) {
|
||||
bool IconElement::input(InputEvent* /* event */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user