From fd98a9eb785bb0809269bfc623ba16c452fb0c1a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 6 Jul 2017 20:46:29 +0200 Subject: [PATCH] mood.c: Rename compute_mood_score(). The main purpose of this function is to determine whether the audio file is admissible with respect to the given mood. So row_is_admissible() is more to the point. --- mood.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mood.c b/mood.c index 2b063cfd..208bdc45 100644 --- a/mood.c +++ b/mood.c @@ -142,8 +142,8 @@ static bool get_item_score(struct mood_item *item, const struct afs_info *afsi, } /* returns 1 if row admissible, 0 if not, negative on errors */ -static int compute_mood_score(const struct osl_row *aft_row, struct mood *m, - long *result) +static int row_is_admissible(const struct osl_row *aft_row, struct mood *m, + long *scorep) { struct mood_item *item; int ret; @@ -192,7 +192,7 @@ static int compute_mood_score(const struct osl_row *aft_row, struct mood *m, } if (score_arg_sum) score /= score_arg_sum; - *result = score; + *scorep = score; return 1; } @@ -571,7 +571,7 @@ static int add_if_admissible(struct osl_row *aft_row, void *data) int ret; long score = 0; - ret = compute_mood_score(aft_row, aa->m, &score); + ret = row_is_admissible(aft_row, aa->m, &score); if (ret <= 0) return ret; if (statistics.num >= aa->size) { @@ -718,7 +718,7 @@ static int mood_update_audio_file(const struct osl_row *aft_row, if (ret < 0) return ret; was_admissible = ret; - ret = compute_mood_score(aft_row, current_mood, &score); + ret = row_is_admissible(aft_row, current_mood, &score); if (ret < 0) return ret; is_admissible = (ret > 0); -- 2.39.2