Code cleanup: srand, PVS warnings (#1974)

* Remove srand invocation

* PVS High priority fixes

* PVS High errors part 2

* Furi: heap tracing inheritance

* Furi add __builtin_unreachable to furi_thread_catch
This commit is contained in:
あく
2022-11-06 00:07:24 +09:00
committed by GitHub
parent 04e50c9f89
commit e8913f2e33
37 changed files with 76 additions and 85 deletions

View File

@@ -436,7 +436,7 @@ void gui_add_framebuffer_callback(Gui* gui, GuiCanvasCommitCallback callback, vo
const CanvasCallbackPair p = {callback, context};
gui_lock(gui);
furi_assert(CanvasCallbackPairArray_count(gui->canvas_callback_pair, p) == 0);
furi_assert(!CanvasCallbackPairArray_count(gui->canvas_callback_pair, p));
CanvasCallbackPairArray_push_back(gui->canvas_callback_pair, p);
gui_unlock(gui);

View File

@@ -359,7 +359,7 @@ static int32_t browser_worker(void* context) {
BrowserWorker*
file_browser_worker_alloc(FuriString* path, const char* filter_ext, bool skip_assets) {
BrowserWorker* browser = malloc(sizeof(BrowserWorker));
BrowserWorker* browser = malloc(sizeof(BrowserWorker)); //-V773
idx_last_array_init(browser->idx_last);

View File

@@ -60,7 +60,7 @@ WidgetElement* widget_element_button_create(
ButtonCallback callback,
void* context) {
// Allocate and init model
GuiButtonModel* model = malloc(sizeof(GuiButtonModel));
GuiButtonModel* model = malloc(sizeof(GuiButtonModel)); //-V773
model->button_type = button_type;
model->callback = callback;
model->context = context;

View File

@@ -23,7 +23,7 @@ void view_dispatcher_free(ViewDispatcher* view_dispatcher) {
gui_remove_view_port(view_dispatcher->gui, view_dispatcher->view_port);
}
// Crash if not all views were freed
furi_assert(ViewDict_size(view_dispatcher->views) == 0);
furi_assert(!ViewDict_size(view_dispatcher->views));
ViewDict_clear(view_dispatcher->views);
// Free ViewPort
@@ -157,7 +157,7 @@ void view_dispatcher_remove_view(ViewDispatcher* view_dispatcher, uint32_t view_
view_dispatcher->ongoing_input_view = NULL;
}
// Remove view
ViewDict_erase(view_dispatcher->views, view_id);
furi_check(ViewDict_erase(view_dispatcher->views, view_id));
view_set_update_callback(view, NULL);
view_set_update_callback_context(view, NULL);