From 6558ba12e9699979aba97292c7cd41889619b83c Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 8 Mar 2022 23:50:02 +0100 Subject: [PATCH] Remove E_NO_MOOD, row_is_admissible() is never called with a NULL mood pointer. --- error.h | 1 - mood.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/error.h b/error.h index 82920ea8..5268feae 100644 --- a/error.h +++ b/error.h @@ -148,7 +148,6 @@ PARA_ERROR(NO_AUDIO_FILE, "no audio file"), \ PARA_ERROR(NOFD, "did not receive open fd from afs"), \ PARA_ERROR(NO_MATCH, "no matches"), \ - PARA_ERROR(NO_MOOD, "no mood available"), \ PARA_ERROR(NO_MORE_SLOTS, "no more empty slots"), \ PARA_ERROR(NOT_PLAYING, "not playing"), \ PARA_ERROR(NO_VALID_FILES, "no valid file found in playlist"), \ diff --git a/mood.c b/mood.c index bcc9bc57..acf8e2ad 100644 --- a/mood.c +++ b/mood.c @@ -122,8 +122,7 @@ __a_const static uint64_t int_sqrt(uint64_t x) /* returns 1 if row admissible, 0 if not, negative on errors */ static int row_is_admissible(const struct osl_row *aft_row, struct mood *m) { - if (!m) - return -E_NO_MOOD; + assert(m); return mp_eval_row(aft_row, m->parser_context); } -- 2.39.2