mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-19 00:48:09 -07:00
Spring cleaning
This commit is contained in:
@@ -832,9 +832,7 @@ void elf_file_free(ELFFile* elf) {
|
||||
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
|
||||
aligned_free(itref->value.data);
|
||||
if(itref->value.fast_rel) {
|
||||
if(itref->value.fast_rel->data) {
|
||||
aligned_free(itref->value.fast_rel->data);
|
||||
}
|
||||
aligned_free(itref->value.fast_rel->data);
|
||||
free(itref->value.fast_rel);
|
||||
}
|
||||
free((void*)itref->key);
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
const ProtocolBase* const lfrfid_protocols[] = {
|
||||
[LFRFIDProtocolEM4100] = &protocol_em4100,
|
||||
[LFRFIDProtocolEM4100_32] = &protocol_em4100_32,
|
||||
[LFRFIDProtocolEM4100_16] = &protocol_em4100_16,
|
||||
[LFRFIDProtocolEM410032] = &protocol_em4100_32,
|
||||
[LFRFIDProtocolEM410016] = &protocol_em4100_16,
|
||||
[LFRFIDProtocolElectra] = &protocol_electra,
|
||||
[LFRFIDProtocolH10301] = &protocol_h10301,
|
||||
[LFRFIDProtocolIdteck] = &protocol_idteck,
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
LFRFIDProtocolEM4100,
|
||||
LFRFIDProtocolEM4100_32,
|
||||
LFRFIDProtocolEM4100_16,
|
||||
LFRFIDProtocolEM410032,
|
||||
LFRFIDProtocolEM410016,
|
||||
LFRFIDProtocolElectra,
|
||||
LFRFIDProtocolH10301,
|
||||
LFRFIDProtocolIdteck,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
#define SUBGHZ_RADIO_DEVICE_PLUGIN_APP_ID "subghz_radio_device"
|
||||
#define SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION 2
|
||||
#define SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION 1
|
||||
|
||||
typedef struct SubGhzDeviceRegistry SubGhzDeviceRegistry;
|
||||
typedef struct SubGhzDevice SubGhzDevice;
|
||||
|
||||
@@ -88,17 +88,12 @@ bool saved_struct_load(const char* path, void* data, size_t size, uint8_t magic,
|
||||
}
|
||||
|
||||
if(result) {
|
||||
size_t bytes_expected = sizeof(SavedStructHeader) + size;
|
||||
uint64_t bytes_file = storage_file_size(file);
|
||||
result = bytes_file == bytes_expected;
|
||||
if(result) {
|
||||
size_t bytes_count = storage_file_read(file, &header, sizeof(SavedStructHeader));
|
||||
bytes_count += storage_file_read(file, data_read, size);
|
||||
result = bytes_count == bytes_expected;
|
||||
}
|
||||
size_t bytes_count = storage_file_read(file, &header, sizeof(SavedStructHeader));
|
||||
bytes_count += storage_file_read(file, data_read, size);
|
||||
|
||||
if(!result) {
|
||||
if(bytes_count != (sizeof(SavedStructHeader) + size)) {
|
||||
FURI_LOG_E(TAG, "Size mismatch of file \"%s\"", path);
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user