mood.c: Use current_mood as data pointer for parse_mood_line().
authorAndre Noll <maan@systemlinux.org>
Tue, 25 Sep 2007 08:47:38 +0000 (10:47 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 25 Sep 2007 08:47:38 +0000 (10:47 +0200)
mood.c

diff --git a/mood.c b/mood.c
index f7cb81d..8d257e0 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -364,9 +364,9 @@ enum mood_line_type {
  * all matching files
  */
 
-/* TODO: Use current_mood as private_data*/
-static int parse_mood_line(char *mood_line, __a_unused void *private_data)
+static int parse_mood_line(char *mood_line, void *data)
 {
+       struct mood *m = data;
        char **argv;
        char *delim = " \t";
        unsigned num_words;
@@ -374,7 +374,6 @@ static int parse_mood_line(char *mood_line, __a_unused void *private_data)
        int i, ret;
        enum mood_line_type mlt = ML_INVALID;
        struct mood_item *mi = NULL;
-       struct mood *m = current_mood;
        char *buf = para_strdup(mood_line);
 
        num_words = split_args(buf, &argv, delim);
@@ -492,7 +491,7 @@ static int load_mood(const struct osl_row *row)
        new_mood = alloc_new_mood((char*)objs[BLOBCOL_NAME].data);
        current_mood = new_mood;
        ret = for_each_line_ro(objs[BLOBCOL_DEF].data, objs[BLOBCOL_DEF].size,
-               parse_mood_line, NULL);
+               parse_mood_line, &current_mood);
        osl_close_disk_object(&objs[BLOBCOL_DEF]);
        if (ret < 0) {
                PARA_ERROR_LOG("unable to load mood %s: %d\n",