mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 00:38:36 -07:00
Misc sonarcloud fixes
This commit is contained in:
@@ -595,8 +595,6 @@ static int32_t ducky_script_execute_next(BadKbScript* bad_kb, File* script_file)
|
||||
bad_kb->buf_len = 0;
|
||||
if(bad_kb->file_end) return SCRIPT_STATE_END;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bad_kb_bt_hid_state_callback(BtStatus status, void* context) {
|
||||
|
||||
@@ -88,7 +88,7 @@ void process_input_settings(ProtoViewApp* app, InputEvent input) {
|
||||
if(input.key == InputKeyUp) {
|
||||
modid = modid == 0 ? count - 1 : modid - 1;
|
||||
} else if(input.key == InputKeyDown) {
|
||||
modid = (modid + 1) % count;
|
||||
modid = (modid + 1) % (count ? count : 1);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ bool spi_mem_tools_read_chip_info(SPIMemChip* chip) {
|
||||
|
||||
bool spi_mem_tools_check_chip_info(SPIMemChip* chip) {
|
||||
SPIMemChip new_chip_info;
|
||||
spi_mem_tools_read_chip_info(&new_chip_info);
|
||||
do {
|
||||
if(!spi_mem_tools_read_chip_info(&new_chip_info)) break;
|
||||
if(chip->vendor_id != new_chip_info.vendor_id) break;
|
||||
if(chip->type_id != new_chip_info.type_id) break;
|
||||
if(chip->capacity_id != new_chip_info.capacity_id) break;
|
||||
|
||||
@@ -291,9 +291,10 @@ static void animation_storage_free_frames(BubbleAnimation* animation) {
|
||||
|
||||
const Icon* icon = &animation->icon_animation;
|
||||
for(int i = 0; i < icon->frame_count; ++i) {
|
||||
if(icon->frames[i]) {
|
||||
free((void*)icon->frames[i]);
|
||||
if(!icon->frames[i]) {
|
||||
break;
|
||||
}
|
||||
free((void*)icon->frames[i]);
|
||||
}
|
||||
|
||||
free((void*)icon->frames);
|
||||
@@ -336,6 +337,7 @@ static bool animation_storage_load_frames(
|
||||
frames_ok = false;
|
||||
furi_string_printf(filename, "%s/%s/frame_%d.bm", ANIMATION_DIR, name, i);
|
||||
|
||||
FURI_CONST_ASSIGN_PTR(icon->frames[i], 0);
|
||||
if(storage_common_stat(storage, furi_string_get_cstr(filename), &file_info) != FSE_OK)
|
||||
break;
|
||||
if(file_info.size > max_filesize) {
|
||||
|
||||
@@ -194,6 +194,8 @@ class AppBuildset:
|
||||
return self.appmgr.get(app_name).supports_hardware_target(self.hw_target)
|
||||
|
||||
def _get_app_depends(self, app_name: str) -> List[str]:
|
||||
app_def = self.appmgr.get(app_name)
|
||||
|
||||
# Skip app if its target is not supported by the target we are building for
|
||||
if not self._check_if_app_target_supported(app_name):
|
||||
self._writer(
|
||||
@@ -201,7 +203,6 @@ class AppBuildset:
|
||||
)
|
||||
return []
|
||||
|
||||
app_def = self.appmgr.get(app_name)
|
||||
return list(
|
||||
filter(
|
||||
self._check_if_app_target_supported,
|
||||
|
||||
Reference in New Issue
Block a user