From 009f16f93b2a055ec0e14751e6d779849f87ab04 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 11 Mar 2022 12:02:51 -0800 Subject: main: move til_init() to start of main Currently this was done rather late for vestigial pre-libtil reasons; it used to be a local function for specifically "create rendering threads" purpose. But it's rather awkward now to see such an initializer called late after myriad other til_* API is being used, and there's nothing gauranteeing til_init() will continue to strictly create rendering threads. Nothing is actually changing in what til_init() does here, it's just a cosmetic movement of the call site and s/librototiller/libtil/ in the error message. --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 0cf41c0..a8a1988 100644 --- a/src/main.c +++ b/src/main.c @@ -233,6 +233,9 @@ int main(int argc, const char *argv[]) til_args_t args = {}; int r; + exit_if((r = til_init()) < 0, + "unable to initialize libtil: %s", strerror(-r)); + exit_if(til_args_parse(argc, argv, &args) < 0, "unable to process arguments"); @@ -254,9 +257,6 @@ int main(int argc, const char *argv[]) exit_if(!fps_setup(), "unable to setup fps counter"); - exit_if((r = til_init()) < 0, - "unable to initialize librototiller: %s", strerror(-r)); - gettimeofday(&rototiller.start_tv, NULL); exit_if((r = til_module_create_context( rototiller.module, -- cgit v1.2.3