X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mood.c;h=32a10e56503147819cbe0a27d3e2e96c1293de6e;hp=cdc0745a255f994eb1a37c661cbfa1dfe1952221;hb=e752cdeab213b329552e1eecd5687bca512217c5;hpb=40de1dd2fdbb054444d585aa70e2d50166a66e07 diff --git a/mood.c b/mood.c index cdc0745a..32a10e56 100644 --- a/mood.c +++ b/mood.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2008 Andre Noll + * Copyright (C) 2007-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -7,6 +7,7 @@ /** \file mood.c Paraslash's mood handling functions. */ #include +#include #include "para.h" #include "error.h" #include "string.h" @@ -266,7 +267,6 @@ static int add_item_score(const struct osl_row *row, struct mood_item *item, lon ret = get_afhi_of_row(row, &afhi); if (ret< 0) return ret; - free(afhi.info_string); /* don't need the tag info */ ret = get_audio_file_path_of_row(row, &path); if (ret< 0) return ret; @@ -537,10 +537,10 @@ static int check_mood(struct osl_row *mood_row, void *data) struct osl_object mood_def; struct mood_line_parser_data mlpd = {.line_num = 0}; - int ret2, ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def); + int ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def); if (ret < 0) { - ret2 = para_printf(pb, "failed to get mood definition: %s\n", + para_printf(pb, "failed to get mood definition: %s\n", para_strerror(-ret)); return ret; } @@ -552,7 +552,7 @@ static int check_mood(struct osl_row *mood_row, void *data) ret = for_each_line_ro(mood_def.data, mood_def.size, parse_mood_line, &mlpd); if (ret < 0) - ret2 = para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num, + para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num, para_strerror(-ret)); out: osl_close_disk_object(&mood_def); @@ -972,7 +972,7 @@ int change_current_mood(char *mood_name) .data = mood_name, .size = strlen(mood_name) + 1 }; - ret = osl_get_row(moods_table, BLOBCOL_NAME, &obj, &row); + ret = osl(osl_get_row(moods_table, BLOBCOL_NAME, &obj, &row)); if (ret < 0) { PARA_NOTICE_LOG("no such mood: %s\n", mood_name); return ret;