From 6c308c6f1220bc8ba4c3aa54510ad852123421e4 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 3 Nov 2023 11:56:52 -0700 Subject: modules/*: drop til_setup_t.free_func() NULL setup checks Trivial cleanup. These are unnecessary nowadays since til_setup_free() won't invoke the free_func() on a NULL setup, and everything uses til_setup_free() to free a til_setup_t. --- src/modules/asc/asc.c | 6 ++---- src/modules/checkers/checkers.c | 6 ++---- src/modules/mixer/mixer.c | 8 +++----- src/modules/montage/montage.c | 8 +++----- src/modules/rkt/rkt.c | 16 +++++++--------- src/modules/roto/roto.c | 6 ++---- 6 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/modules/asc/asc.c b/src/modules/asc/asc.c index e359e62..50f81b3 100644 --- a/src/modules/asc/asc.c +++ b/src/modules/asc/asc.c @@ -167,10 +167,8 @@ static void asc_setup_free(til_setup_t *setup) { asc_setup_t *s = (asc_setup_t *)setup; - if (s) { - free((void *)s->string); - free(s); - } + free((void *)s->string); + free(s); } diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c index 998c5bf..0e11d72 100644 --- a/src/modules/checkers/checkers.c +++ b/src/modules/checkers/checkers.c @@ -515,10 +515,8 @@ static void checkers_setup_free(til_setup_t *setup) { checkers_setup_t *s = (checkers_setup_t *)setup; - if (s) { - til_setup_free(s->fill_module_setup); - free(setup); - } + til_setup_free(s->fill_module_setup); + free(setup); } diff --git a/src/modules/mixer/mixer.c b/src/modules/mixer/mixer.c index d8c1326..cf57d3d 100644 --- a/src/modules/mixer/mixer.c +++ b/src/modules/mixer/mixer.c @@ -318,12 +318,10 @@ static void mixer_setup_free(til_setup_t *setup) { mixer_setup_t *s = (mixer_setup_t *)setup; - if (s) { - for (size_t i = 0; i < nelems(s->inputs); i++) - til_setup_free(s->inputs[i].setup); + for (size_t i = 0; i < nelems(s->inputs); i++) + til_setup_free(s->inputs[i].setup); - free(setup); - } + free(setup); } diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index 8ee8df7..7dba5a6 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -216,11 +216,9 @@ static void montage_setup_free(til_setup_t *setup) { montage_setup_t *s = (montage_setup_t *)setup; - if (s) { - for (size_t i = 0; i < s->n_tiles; i++) - til_setup_free(s->tiles[i].setup); - free(setup); - } + for (size_t i = 0; i < s->n_tiles; i++) + til_setup_free(s->tiles[i].setup); + free(setup); } diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c index 2e8e696..8790f53 100644 --- a/src/modules/rkt/rkt.c +++ b/src/modules/rkt/rkt.c @@ -387,15 +387,13 @@ static void rkt_setup_free(til_setup_t *setup) { rkt_setup_t *s = (rkt_setup_t *)setup; - if (s) { - for (size_t i = 0; i < s->n_scenes; i++) - til_setup_free(s->scenes[i].setup); - - free((void *)s->base); - free((void *)s->host); - free((void *)s->scener_address); - free(setup); - } + for (size_t i = 0; i < s->n_scenes; i++) + til_setup_free(s->scenes[i].setup); + + free((void *)s->base); + free((void *)s->host); + free((void *)s->scener_address); + free(setup); } diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c index 8d71cba..4d97fa5 100644 --- a/src/modules/roto/roto.c +++ b/src/modules/roto/roto.c @@ -412,10 +412,8 @@ static void roto_setup_free(til_setup_t *setup) { roto_setup_t *s = (roto_setup_t *)setup; - if (s) { - til_setup_free(s->fill_module_setup); - free(setup); - } + til_setup_free(s->fill_module_setup); + free(setup); } -- cgit v1.2.3