mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-13 13:29:50 +04:00
Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks * Api Symbols: replace asserts with checks part 2 * Update no args function signatures with void, to help compiler to track incorrect usage * More unavoidable void * Update PVS config and code to make it happy * Format sources * nfc: fix checks * dead code cleanup & include fixes Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -300,7 +300,7 @@ static bool
|
||||
|
||||
static int32_t browser_worker(void* context) {
|
||||
BrowserWorker* browser = (BrowserWorker*)context;
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
FURI_LOG_D(TAG, "Start");
|
||||
|
||||
uint32_t items_cnt = 0;
|
||||
@@ -316,7 +316,7 @@ static int32_t browser_worker(void* context) {
|
||||
while(1) {
|
||||
uint32_t flags =
|
||||
furi_thread_flags_wait(WORKER_FLAGS_ALL, FuriFlagWaitAny, FuriWaitForever);
|
||||
furi_assert((flags & FuriFlagError) == 0);
|
||||
furi_check((flags & FuriFlagError) == 0);
|
||||
|
||||
if(flags & WorkerEvtConfigChange) {
|
||||
// If start path is a path to the file - try finding index of this file in a folder
|
||||
@@ -437,7 +437,7 @@ BrowserWorker* file_browser_worker_alloc(
|
||||
} //-V773
|
||||
|
||||
void file_browser_worker_free(BrowserWorker* browser) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
|
||||
furi_thread_flags_set(furi_thread_get_id(browser->thread), WorkerEvtStop);
|
||||
furi_thread_join(browser->thread);
|
||||
@@ -454,35 +454,35 @@ void file_browser_worker_free(BrowserWorker* browser) {
|
||||
}
|
||||
|
||||
void file_browser_worker_set_callback_context(BrowserWorker* browser, void* context) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->cb_ctx = context;
|
||||
}
|
||||
|
||||
void file_browser_worker_set_folder_callback(
|
||||
BrowserWorker* browser,
|
||||
BrowserWorkerFolderOpenCallback cb) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->folder_cb = cb;
|
||||
}
|
||||
|
||||
void file_browser_worker_set_list_callback(
|
||||
BrowserWorker* browser,
|
||||
BrowserWorkerListLoadCallback cb) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->list_load_cb = cb;
|
||||
}
|
||||
|
||||
void file_browser_worker_set_item_callback(
|
||||
BrowserWorker* browser,
|
||||
BrowserWorkerListItemCallback cb) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->list_item_cb = cb;
|
||||
}
|
||||
|
||||
void file_browser_worker_set_long_load_callback(
|
||||
BrowserWorker* browser,
|
||||
BrowserWorkerLongLoadCallback cb) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->long_load_cb = cb;
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ void file_browser_worker_set_config(
|
||||
const char* ext_filter,
|
||||
bool skip_assets,
|
||||
bool hide_dot_files) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
furi_string_set(browser->path_next, path);
|
||||
browser_parse_ext_filter(browser->ext_filter, ext_filter);
|
||||
browser->skip_assets = skip_assets;
|
||||
@@ -501,30 +501,30 @@ void file_browser_worker_set_config(
|
||||
}
|
||||
|
||||
void file_browser_worker_folder_enter(BrowserWorker* browser, FuriString* path, int32_t item_idx) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
furi_string_set(browser->path_next, path);
|
||||
browser->item_sel_idx = item_idx;
|
||||
furi_thread_flags_set(furi_thread_get_id(browser->thread), WorkerEvtFolderEnter);
|
||||
}
|
||||
|
||||
bool file_browser_worker_is_in_start_folder(BrowserWorker* browser) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
return (furi_string_cmp(browser->path_start, browser->path_current) == 0);
|
||||
}
|
||||
|
||||
void file_browser_worker_folder_exit(BrowserWorker* browser) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
furi_thread_flags_set(furi_thread_get_id(browser->thread), WorkerEvtFolderExit);
|
||||
}
|
||||
|
||||
void file_browser_worker_folder_refresh(BrowserWorker* browser, int32_t item_idx) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->item_sel_idx = item_idx;
|
||||
furi_thread_flags_set(furi_thread_get_id(browser->thread), WorkerEvtFolderRefresh);
|
||||
}
|
||||
|
||||
void file_browser_worker_load(BrowserWorker* browser, uint32_t offset, uint32_t count) {
|
||||
furi_assert(browser);
|
||||
furi_check(browser);
|
||||
browser->load_offset = offset;
|
||||
browser->load_count = count;
|
||||
furi_thread_flags_set(furi_thread_get_id(browser->thread), WorkerEvtLoad);
|
||||
|
||||
Reference in New Issue
Block a user