[FL-2811] Fix PVS-Studio warnings (#2142)
Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
@@ -119,7 +119,7 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
|
||||
c2_ver = ble_glue_get_c2_info();
|
||||
#endif
|
||||
|
||||
if(!ver) {
|
||||
if(!ver) { //-V1051
|
||||
furi_string_cat_printf(buffer, "No info\n");
|
||||
} else {
|
||||
furi_string_cat_printf(
|
||||
@@ -208,4 +208,4 @@ int32_t about_settings_app(void* p) {
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
|
||||
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(strcmp(FLIPPER_APPS[event.event].name, FAP_LOADER_APP_NAME)) {
|
||||
if(strcmp(FLIPPER_APPS[event.event].name, FAP_LOADER_APP_NAME) != 0) {
|
||||
if(primary_favorite) {
|
||||
app->settings.favorite_primary.is_external = false;
|
||||
strncpy(
|
||||
|
@@ -32,9 +32,7 @@ bool desktop_settings_scene_pin_setup_howto_on_event(void* context, SceneManager
|
||||
consumed = true;
|
||||
break;
|
||||
default:
|
||||
furi_assert(0);
|
||||
consumed = true;
|
||||
break;
|
||||
furi_crash(NULL);
|
||||
}
|
||||
}
|
||||
return consumed;
|
||||
|
@@ -52,9 +52,7 @@ bool desktop_settings_scene_pin_setup_howto2_on_event(void* context, SceneManage
|
||||
break;
|
||||
}
|
||||
default:
|
||||
furi_assert(0);
|
||||
consumed = true;
|
||||
break;
|
||||
furi_crash(NULL);
|
||||
}
|
||||
}
|
||||
return consumed;
|
||||
|
@@ -49,7 +49,7 @@ static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
|
||||
snprintf(
|
||||
value,
|
||||
sizeof(value),
|
||||
"%ld.%ldV %ldmA",
|
||||
"%lu.%luV %lumA",
|
||||
(uint32_t)(data->vbus_voltage),
|
||||
(uint32_t)(data->vbus_voltage * 10) % 10,
|
||||
charge_current);
|
||||
@@ -75,7 +75,7 @@ static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
|
||||
snprintf(
|
||||
value,
|
||||
sizeof(value),
|
||||
"%ld.%ldV",
|
||||
"%lu.%luV",
|
||||
(uint32_t)(data->charging_voltage),
|
||||
(uint32_t)(data->charging_voltage * 10) % 10);
|
||||
} else {
|
||||
@@ -100,14 +100,14 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
|
||||
char voltage[10];
|
||||
char health[10];
|
||||
|
||||
snprintf(batt_level, sizeof(batt_level), "%ld%%", (uint32_t)model->charge);
|
||||
snprintf(temperature, sizeof(temperature), "%ld C", (uint32_t)model->gauge_temperature);
|
||||
snprintf(batt_level, sizeof(batt_level), "%lu%%", (uint32_t)model->charge);
|
||||
snprintf(temperature, sizeof(temperature), "%lu C", (uint32_t)model->gauge_temperature);
|
||||
snprintf(
|
||||
voltage,
|
||||
sizeof(voltage),
|
||||
"%ld.%01ld V",
|
||||
"%lu.%01lu V",
|
||||
(uint32_t)model->gauge_voltage,
|
||||
(uint32_t)(model->gauge_voltage * 10) % 10);
|
||||
(uint32_t)(model->gauge_voltage * 10) % 10UL);
|
||||
snprintf(health, sizeof(health), "%d%%", model->health);
|
||||
|
||||
draw_stat(canvas, 8, 42, &I_Battery_16x16, batt_level);
|
||||
|
@@ -40,8 +40,6 @@ bool storage_settings_scene_format_confirm_on_event(void* context, SceneManagerE
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DialogExResultLeft:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
case DialogExResultCenter:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
|
@@ -47,8 +47,6 @@ bool storage_settings_scene_sd_info_on_event(void* context, SceneManagerEvent ev
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DialogExResultLeft:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
case DialogExResultCenter:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
|
@@ -41,8 +41,6 @@ bool storage_settings_scene_unmount_confirm_on_event(void* context, SceneManager
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DialogExResultCenter:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
case DialogExResultLeft:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user