]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mood.c
mood.c: Rename mood_loop() to load_mood_loop_func().
[paraslash.git] / mood.c
diff --git a/mood.c b/mood.c
index 61332461d7bbed500723452fb956c3dd05cf416b..7d207f0b965cab0c7fe6b5216d97c49e511085c9 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -502,8 +502,12 @@ static int load_mood(const struct osl_row *mood_row, struct mood **m)
        return 1;
 }
 
-/* returns -E_MOOD_LOADED on _success_ to terminate the loop */
-static int mood_loop(struct osl_row *mood_row, void *data)
+/*
+ * Calls load_mood() and reverts its error value: It returns -E_MOOD_LOADED
+ * on _success_, and 1 on errors. This way the loop over all moods stops at the
+ * first valid mood.
+ */
+static int load_mood_loop_func(struct osl_row *mood_row, void *data)
 {
        struct mood **m = data;
        int ret = load_mood(mood_row, m);
@@ -518,7 +522,7 @@ static int mood_loop(struct osl_row *mood_row, void *data)
 static int load_first_available_mood(struct mood **m)
 {
        int ret = osl_rbtree_loop(moods_table, BLOBCOL_NAME, m,
-               mood_loop);
+               load_mood_loop_func);
        if (ret == -E_MOOD_LOADED) /* success */
                return 1;
        if (ret < 0)