Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct BtTestParam {
void* context;
};

ARRAY_DEF(BtTestParamArray, BtTestParam, M_POD_OPLIST);
ARRAY_DEF(BtTestParamArray, BtTestParam, M_POD_OPLIST); //-V658

struct BtTest {
View* view;
Expand Down
2 changes: 1 addition & 1 deletion applications/main/infrared/infrared_brute_force.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "infrared_signal.h"

ARRAY_DEF(SignalPositionArray, size_t, M_DEFAULT_OPLIST);
ARRAY_DEF(SignalPositionArray, size_t, M_DEFAULT_OPLIST); //-V658

typedef struct {
size_t index;
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/helpers/mfkey32_logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ typedef struct {
uint32_t ar1;
} Mfkey32LoggerParams;

ARRAY_DEF(Mfkey32LoggerParams, Mfkey32LoggerParams, M_POD_OPLIST);
ARRAY_DEF(Mfkey32LoggerParams, Mfkey32LoggerParams, M_POD_OPLIST); //-V658

struct Mfkey32Logger {
uint32_t cuid;
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/helpers/nfc_supported_cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef struct {
NfcSupportedCardsPluginFeature feature;
} NfcSupportedCardsPluginCache;

ARRAY_DEF(NfcSupportedCardsPluginCache, NfcSupportedCardsPluginCache, M_POD_OPLIST);
ARRAY_DEF(NfcSupportedCardsPluginCache, NfcSupportedCardsPluginCache, M_POD_OPLIST); //-V658

typedef enum {
NfcSupportedCardsLoadStateIdle,
Expand Down
2 changes: 1 addition & 1 deletion applications/main/onewire/onewire_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void onewire_cli_search(PipeSide* pipe) {
onewire_host_start(onewire);
power_enable_otg(power, true);

while(!done) {
while(!done) { //-V1044
if(onewire_host_search(onewire, address, OneWireHostSearchModeNormal) != 1) {
printf("Search finished\r\n");
onewire_host_reset_search(onewire);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TUPLE_DEF2( //-V1048
M_DEFAULT_OPLIST)

/* Define the array, register the oplist and define further algorithms on it */
ARRAY_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItem_t) //-V779
ARRAY_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItem_t) //-V779 //-V658
#define M_OPL_SubGhzFrequencyAnalyzerLogItemArray_t() \
ARRAY_OPLIST(SubGhzFrequencyAnalyzerLogItemArray, M_OPL_SubGhzFrequencyAnalyzerLogItem_t())
ALGO_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItemArray_t)
Expand Down
2 changes: 1 addition & 1 deletion applications/main/subghz/subghz_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct {
SubGhzRadioPreset* preset;
} SubGhzHistoryItem;

ARRAY_DEF(SubGhzHistoryItemArray, SubGhzHistoryItem, M_POD_OPLIST)
ARRAY_DEF(SubGhzHistoryItemArray, SubGhzHistoryItem, M_POD_OPLIST) //-V658

#define M_OPL_SubGhzHistoryItemArray_t() ARRAY_OPLIST(SubGhzHistoryItemArray, M_POD_OPLIST)

Expand Down
2 changes: 1 addition & 1 deletion applications/main/subghz/views/receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef struct {
uint8_t type;
} SubGhzReceiverMenuItem;

ARRAY_DEF(SubGhzReceiverMenuItemArray, SubGhzReceiverMenuItem, M_POD_OPLIST)
ARRAY_DEF(SubGhzReceiverMenuItemArray, SubGhzReceiverMenuItem, M_POD_OPLIST) //-V658

#define M_OPL_SubGhzReceiverMenuItemArray_t() \
ARRAY_OPLIST(SubGhzReceiverMenuItemArray, M_POD_OPLIST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,17 @@ static const FrameBubble*
bubble_animation_pick_bubble(BubbleAnimationViewModel* model, bool active) {
const FrameBubble* bubble = NULL;

if((model->active_bubbles == 0) && (model->passive_bubbles == 0)) {
// Check for division by zero based on the active parameter
if((active && model->active_bubbles == 0) || (!active && model->passive_bubbles == 0)) {
return NULL;
}

uint8_t index =
furi_hal_random_get() % (active ? model->active_bubbles : model->passive_bubbles);
uint8_t random_value = furi_hal_random_get();
// In case random generator return zero lets set it to 3
if(random_value == 0) {
random_value = 3;
}
uint8_t index = random_value % (active ? model->active_bubbles : model->passive_bubbles);
const BubbleAnimation* animation = model->current;

for(int i = 0; i < animation->frame_bubble_sequences_count; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/canvas_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef struct {
void* context;
} CanvasCallbackPair;

ARRAY_DEF(CanvasCallbackPairArray, CanvasCallbackPair, M_POD_OPLIST);
ARRAY_DEF(CanvasCallbackPairArray, CanvasCallbackPair, M_POD_OPLIST); //-V658

#define M_OPL_CanvasCallbackPairArray_t() ARRAY_OPLIST(CanvasCallbackPairArray, M_POD_OPLIST)

Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/elements.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ void elements_text_box(
for(size_t i = 0; i < line_num; i++) {
for(size_t j = 0; j < line[i].len; j++) {
// Process format symbols
if(line[i].text[j] == '\e' && j < line[i].len - 1) {
if(line[i].text[j] == '\e' && j < line[i].len - 1) { //-V781
++j;
if(line[i].text[j] == ELEMENTS_BOLD_MARKER) {
if(bold) {
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/modules/button_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct ButtonMenuItem {
void* callback_context;
};

ARRAY_DEF(ButtonMenuItemArray, ButtonMenuItem, M_POD_OPLIST);
ARRAY_DEF(ButtonMenuItemArray, ButtonMenuItem, M_POD_OPLIST); //-V658

struct ButtonMenu {
View* view;
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/modules/button_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void button_panel_reserve(ButtonPanel* button_panel, size_t reserve_x, size_t re
furi_check(reserve_x > 0);
furi_check(reserve_y > 0);

with_view_model(
with_view_model( //-V621
button_panel->view,
ButtonPanelModel * model,
{
Expand Down
4 changes: 2 additions & 2 deletions applications/services/gui/modules/file_browser_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ typedef enum {
(WorkerEvtStop | WorkerEvtLoad | WorkerEvtFolderEnter | WorkerEvtFolderExit | \
WorkerEvtFolderRefresh | WorkerEvtConfigChange)

ARRAY_DEF(IdxLastArray, int32_t)
ARRAY_DEF(ExtFilterArray, FuriString*, FURI_STRING_OPLIST)
ARRAY_DEF(IdxLastArray, int32_t) //-V658
ARRAY_DEF(ExtFilterArray, FuriString*, FURI_STRING_OPLIST) //-V658

struct BrowserWorker {
FuriThread* thread;
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/modules/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct {
void* callback_context;
} MenuItem;

ARRAY_DEF(MenuItemArray, MenuItem, M_POD_OPLIST);
ARRAY_DEF(MenuItemArray, MenuItem, M_POD_OPLIST); //-V658

#define M_OPL_MenuItemArray_t() ARRAY_OPLIST(MenuItemArray, M_POD_OPLIST)

Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/modules/variable_item_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct VariableItem {
void* context;
};

ARRAY_DEF(VariableItemArray, VariableItem, M_POD_OPLIST);
ARRAY_DEF(VariableItemArray, VariableItem, M_POD_OPLIST); //-V658

struct VariableItemList {
View* view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct {
FuriString* text;
} TextScrollLineArray;

ARRAY_DEF(TextScrollLineArray, TextScrollLineArray, M_POD_OPLIST)
ARRAY_DEF(TextScrollLineArray, TextScrollLineArray, M_POD_OPLIST) //-V658

typedef struct {
TextScrollLineArray_t line_array;
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/scene_manager_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "scene_manager.h"
#include <m-array.h>

ARRAY_DEF(SceneManagerIdStack, uint32_t, M_DEFAULT_OPLIST);
ARRAY_DEF(SceneManagerIdStack, uint32_t, M_DEFAULT_OPLIST); //-V658

typedef struct {
uint32_t state;
Expand Down
10 changes: 8 additions & 2 deletions applications/services/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static void loader_show_gui_error(
LoaderMessageLoaderStatusResult status,
const char* name,
FuriString* error_message) {
furi_check(name);
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
DialogMessage* message = dialog_message_alloc();

Expand Down Expand Up @@ -609,6 +610,8 @@ static LoaderMessageLoaderStatusResult loader_do_start_by_name(
status.value = loader_make_success_status(error_message);
status.error = LoaderStatusErrorUnknown;

if(name == NULL) return status;

LoaderEvent event;
event.type = LoaderEventTypeApplicationBeforeLoad;
furi_pubsub_publish(loader->pubsub, &event);
Expand Down Expand Up @@ -835,7 +838,10 @@ int32_t loader_srv(void* p) {
switch(message.type) {
case LoaderMessageTypeStartByName: {
LoaderMessageLoaderStatusResult status = loader_do_start_by_name(
loader, message.start.name, message.start.args, message.start.error_message);
loader,
message.start.name,
message.start.args,
message.start.error_message); //-V595
*(message.status_value) = status;
if(status.value != LoaderStatusOk) loader_do_emit_queue_empty_event(loader);
api_lock_unlock(message.api_lock);
Expand All @@ -844,7 +850,7 @@ int32_t loader_srv(void* p) {
case LoaderMessageTypeStartByNameDetachedWithGuiError: {
FuriString* error_message = furi_string_alloc();
LoaderMessageLoaderStatusResult status = loader_do_start_by_name(
loader, message.start.name, message.start.args, error_message);
loader, message.start.name, message.start.args, error_message); //-V595
loader_show_gui_error(status, message.start.name, error_message);
if(status.value != LoaderStatusOk) loader_do_emit_queue_empty_event(loader);
if(message.start.name) free((void*)message.start.name);
Expand Down
2 changes: 1 addition & 1 deletion applications/services/rpc/rpc_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static void rpc_system_storage_list_process(const PB_Main* request, void* contex
finish = true;
}

while(!finish) {
while(!finish) { //-V1044
FileInfo fileinfo;
char* name = malloc(MAX_NAME_LENGTH + 1);
if(storage_dir_read(dir, &fileinfo, name, MAX_NAME_LENGTH)) {
Expand Down
3 changes: 2 additions & 1 deletion applications/services/rpc/rpc_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ static void rpc_system_system_ping_process(const PB_Main* request, void* context
}

PB_Main response = PB_Main_init_default;
response.command_status = PB_CommandStatus_OK;
// PB_CommandStatus_OK is 0 in current case, and var by default is 0 too, commenting PVS warn
response.command_status = PB_CommandStatus_OK; //-V1048
response.command_id = request->command_id;
response.which_content = PB_Main_system_ping_response_tag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
default_passport = true;
}
} else {
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP);
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP); //-V784
furi_assert(favorite_id < DummyAppNumber);
curr_favorite_app = &app->settings.dummy_apps[favorite_id];
default_passport = true;
Expand Down Expand Up @@ -182,7 +182,7 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
furi_assert(favorite_id < FavoriteAppNumber);
curr_favorite_app = &app->settings.favorite_apps[favorite_id];
} else {
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP);
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP); //-V784
furi_assert(favorite_id < DummyAppNumber);
curr_favorite_app = &app->settings.dummy_apps[favorite_id];
}
Expand Down
2 changes: 1 addition & 1 deletion applications/system/js_app/js_modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef struct {
// - an rbtree because i deemed it more tedious to implement, and with the
// amount of modules in use (under 10 in the overwhelming majority of cases)
// i bet it's going to be slower than a plain array
ARRAY_DEF(JsModuleArray, JsModuleData, M_POD_OPLIST);
ARRAY_DEF(JsModuleArray, JsModuleData, M_POD_OPLIST); //-V658
#define M_OPL_JsModuleArray_t() ARRAY_OPLIST(JsModuleArray)

static const JsModuleDescriptor modules_builtin[] = {
Expand Down
2 changes: 1 addition & 1 deletion applications/system/js_app/modules/js_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct {
char* data;
} PatternArrayItem;

ARRAY_DEF(PatternArray, PatternArrayItem, M_POD_OPLIST);
ARRAY_DEF(PatternArray, PatternArrayItem, M_POD_OPLIST); //-V658

static void
js_serial_on_async_rx(FuriHalSerialHandle* handle, FuriHalSerialRxEvent event, void* context) {
Expand Down
3 changes: 3 additions & 0 deletions lib/drivers/lp5562.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ void lp5562_execute_ramp(
// Prepare command sequence
uint16_t program[16];
uint8_t diff = (val_end > val_start) ? (val_end - val_start) : (val_start - val_end);
if(diff == 0) { // Making division below safer
diff = 1;
}
uint16_t time_step = time * 2 / diff;
uint8_t prescaller = 0;
if(time_step > 0x3F) {
Expand Down
2 changes: 1 addition & 1 deletion lib/music_worker/music_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef struct {
uint8_t dots;
} NoteBlock;

ARRAY_DEF(NoteBlockArray, NoteBlock, M_POD_OPLIST);
ARRAY_DEF(NoteBlockArray, NoteBlock, M_POD_OPLIST); //-V658

struct MusicWorker {
FuriThread* thread;
Expand Down
2 changes: 1 addition & 1 deletion lib/print/printf_tiny.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static int

// evaluate flags
flags = 0U;
do {
do { //-V1044
switch(*format) {
case '0':
flags |= FLAGS_ZEROPAD;
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/bin_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static bool

//sort by number of occurrences
bool swap = true;
while(swap) {
while(swap) { //-V1044
swap = false;
for(size_t i = 1; i < BIN_RAW_SEARCH_CLASSES; i++) {
if(classes[i].count > classes[i - 1].count) {
Expand Down Expand Up @@ -571,7 +571,7 @@ static bool
bit_count = 0;

if(data_markup_ind == BIN_RAW_MAX_MARKUP_COUNT) break;
ind &= 0xFFFFFFF8; //jump to the pre whole byte
ind &= 0xFFFFFFF8; //jump to the pre whole byte //-V784
}
} while(gap_ind != 0);
if((data_markup_ind != BIN_RAW_MAX_MARKUP_COUNT) && (ind != 0)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ typedef struct {
SubGhzProtocolEncoderBase* base;
} SubGhzReceiverSlot;

ARRAY_DEF(SubGhzReceiverSlotArray, SubGhzReceiverSlot, M_POD_OPLIST);
ARRAY_DEF(SubGhzReceiverSlotArray, SubGhzReceiverSlot, M_POD_OPLIST); //-V658
#define M_OPL_SubGhzReceiverSlotArray_t() ARRAY_OPLIST(SubGhzReceiverSlotArray, M_POD_OPLIST)

struct SubGhzReceiver {
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/subghz_keystore.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
uint16_t type;
} SubGhzKey;

ARRAY_DEF(SubGhzKeyArray, SubGhzKey, M_POD_OPLIST)
ARRAY_DEF(SubGhzKeyArray, SubGhzKey, M_POD_OPLIST) //-V658

#define M_OPL_SubGhzKeyArray_t() ARRAY_OPLIST(SubGhzKeyArray, M_POD_OPLIST)

Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/subghz_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ typedef struct {
size_t custom_preset_data_size;
} SubGhzSettingCustomPresetItem;

ARRAY_DEF(SubGhzSettingCustomPresetItemArray, SubGhzSettingCustomPresetItem, M_POD_OPLIST)
ARRAY_DEF(SubGhzSettingCustomPresetItemArray, SubGhzSettingCustomPresetItem, M_POD_OPLIST) //-V658

#define M_OPL_SubGhzSettingCustomPresetItemArray_t() \
ARRAY_OPLIST(SubGhzSettingCustomPresetItemArray, M_POD_OPLIST)
Expand Down
2 changes: 1 addition & 1 deletion lib/toolbox/cli/shell/cli_shell_completions.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "cli_shell_completions.h"

ARRAY_DEF(CommandCompletions, FuriString*, FURI_STRING_OPLIST); // -V524
ARRAY_DEF(CommandCompletions, FuriString*, FURI_STRING_OPLIST); // -V524 //-V658
#define M_OPL_CommandCompletions_t() ARRAY_OPLIST(CommandCompletions)

struct CliShellCompletions {
Expand Down
2 changes: 1 addition & 1 deletion lib/toolbox/strint.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ StrintParseError strint_to_uint64_internal(

if(result > mul_limit) return StrintParseOverflowError;
result *= base;
if(result > limit - digit_value) return StrintParseOverflowError;
if(result > limit - digit_value) return StrintParseOverflowError; //-V658
result += digit_value;

read_total++;
Expand Down
2 changes: 1 addition & 1 deletion targets/f7/src/stm32wb55_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void SystemInit(void) {
RCC->PLLSAI1CFGR = 0x22041000U;
#endif
// Reset HSEBYP bit
RCC->CR &= 0xFFFBFFFFU;
RCC->CR &= 0xFFFBFFFFU; //-V784
// Disable all RCC related interrupts
RCC->CIER = 0x00000000;
}
Expand Down
Loading