From 38533c81e7b7ebfc5f281c2523188aeaa38d09c3 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 15:41:39 +0300 Subject: Drop the app state struct from the hello example hello only tracked a failure flag, so keep it as a file-scope static like simple_window and leave yasl_app_desc.userdata unset. Co-Authored-By: Claude Opus 5.5 --- tests/common/test_hello_example.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/common/test_hello_example.c b/tests/common/test_hello_example.c index 6e0318f..7faa147 100644 --- a/tests/common/test_hello_example.c +++ b/tests/common/test_hello_example.c @@ -6,15 +6,14 @@ static void draw_once(void *ud, struct yasl_surface *surface, struct yasl_frame_context *frame) { draw(ud, surface, frame); - if (!((struct app *)ud)->failed) yasl_surface_destroy(surface); + if (!failed) yasl_surface_destroy(surface); } int main(void) { - struct app app = {0}; struct yasl_app_desc desc = { - .app_id = "org.yasl.test.hello", .userdata = &app, + .app_id = "org.yasl.test.hello", .init = init, .event = event, .frame = draw_once, }; - return yasl_run(&desc) || app.failed ? 1 : 0; + return yasl_run(&desc) || failed ? 1 : 0; } -- cgit v1.2.3