Skip to content

Commit

Permalink
Misc sonarcloud fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Feb 13, 2023
1 parent 8812dbc commit 53780e7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions applications/main/bad_kb/bad_kb_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/protoview/view_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions applications/services/desktop/animations/animation_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/fbt/appmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ def _check_if_app_target_supported(self, app_name: str):
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(
f"Skipping {app_name} due to target mismatch (building for {self.hw_target}, app supports {app_def.targets}"
)
return []

app_def = self.appmgr.get(app_name)
return list(
filter(
self._check_if_app_target_supported,
Expand Down

0 comments on commit 53780e7

Please sign in to comment.