From: Andre Noll Date: Tue, 25 Sep 2007 08:47:38 +0000 (+0200) Subject: mood.c: Use current_mood as data pointer for parse_mood_line(). X-Git-Tag: v0.3.0~356 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=f7fb539505316b2cd8c5e57b6529d43b936208fb;p=paraslash.git mood.c: Use current_mood as data pointer for parse_mood_line(). --- diff --git a/mood.c b/mood.c index f7cb81db..8d257e0c 100644 --- 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, ¤t_mood); osl_close_disk_object(&objs[BLOBCOL_DEF]); if (ret < 0) { PARA_ERROR_LOG("unable to load mood %s: %d\n",