Furi: cleanup crash use (#3175)
* Furi: optional message in furi_crash and furi_halt * Consistent furi_crash use * UnitTests: crash instead of assert * furi: check: fixed macro for default arg * unit_tests: fixed crashes everywhere * lib: infrared: fixed PVS warnings * furi: eliminated __FURI_ASSERT_MESSAGE_FLAG * Furi: update check.h docs * Furi: add check.h usage note * Docs: grammar --------- Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -135,7 +135,7 @@ void canvas_set_font(Canvas* canvas, Font font) {
|
||||
} else if(font == FontBigNumbers) {
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_profont22_tn);
|
||||
} else {
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void canvas_draw_str_aligned(
|
||||
x -= (u8g2_GetStrWidth(&canvas->fb, str) / 2);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ void canvas_draw_str_aligned(
|
||||
y += (u8g2_GetAscent(&canvas->fb) / 2);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ void canvas_set_orientation(Canvas* canvas, CanvasOrientation orientation) {
|
||||
rotate_cb = U8G2_R1;
|
||||
break;
|
||||
default:
|
||||
furi_assert(0);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
if(need_swap) FURI_SWAP(canvas->width, canvas->height);
|
||||
|
||||
@@ -232,7 +232,7 @@ static size_t
|
||||
} else if(horizontal == AlignRight) {
|
||||
px_left = x;
|
||||
} else {
|
||||
furi_assert(0);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
if(len_px > px_left) {
|
||||
|
||||
@@ -79,7 +79,7 @@ static uint8_t byte_input_get_row_size(uint8_t row_index) {
|
||||
row_size = COUNT_OF(keyboard_keys_row_2);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
return row_size;
|
||||
@@ -102,7 +102,7 @@ static const ByteInputKey* byte_input_get_row(uint8_t row_index) {
|
||||
row = keyboard_keys_row_2;
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
return row;
|
||||
|
||||
@@ -98,7 +98,7 @@ void popup_start_timer(void* context) {
|
||||
if(timer_period == 0) timer_period = 1;
|
||||
|
||||
if(furi_timer_start(popup->timer, timer_period) != FuriStatusOk) {
|
||||
furi_assert(0);
|
||||
furi_crash();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ static uint8_t get_row_size(uint8_t row_index) {
|
||||
row_size = COUNT_OF(keyboard_keys_row_3);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
return row_size;
|
||||
@@ -121,7 +121,7 @@ static const TextInputKey* get_row(uint8_t row_index) {
|
||||
row = keyboard_keys_row_3;
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
|
||||
return row;
|
||||
|
||||
@@ -82,7 +82,7 @@ void view_allocate_model(View* view, ViewModelType type, size_t size) {
|
||||
model->data = malloc(size);
|
||||
view->model = model;
|
||||
} else {
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void view_free_model(View* view) {
|
||||
free(model);
|
||||
view->model = NULL;
|
||||
} else {
|
||||
furi_crash(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ void view_dispatcher_attach_to_gui(
|
||||
} else if(type == ViewDispatcherTypeFullscreen) {
|
||||
gui_add_view_port(gui, view_dispatcher->view_port, GuiLayerFullscreen);
|
||||
} else {
|
||||
furi_check(NULL);
|
||||
furi_crash();
|
||||
}
|
||||
view_dispatcher->gui = gui;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user