diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-07 02:08:29 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-07 02:08:29 -0700 |
commit | 99841dca7bdc7e85df88800df86e22bb70ed683d (patch) | |
tree | f1628abbe045184623e585896c0787ba72bf8da5 /src | |
parent | a67facd051d817dd53bac1aebfc554b07420e8cd (diff) | |
download | mpd-99841dca7bdc7e85df88800df86e22bb70ed683d.tar.gz mpd-99841dca7bdc7e85df88800df86e22bb70ed683d.tar.xz mpd-99841dca7bdc7e85df88800df86e22bb70ed683d.zip |
dbUtils: more cleanups
Remove unnecessary wrapper function now that we have
song_print_url_x and also return the results directly
since we'll know the song_print_* functions will all
return -1 on error.
Diffstat (limited to 'src')
-rw-r--r-- | src/dbUtils.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c index a9d83eb41..adcb7e0da 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -64,12 +64,6 @@ static int printDirectoryInDirectory(Directory * directory, void *data) return 0; } -static int printSongInDirectory(Song * song, void *data) -{ - song_print_url(song, (int)(size_t)data); - return 0; -} - struct search_data { int fd; LocateTagItemArray array; @@ -82,8 +76,7 @@ static int searchInDirectory(Song * song, void *_data) LocateTagItemArray *array = &data->array; if (strstrSearchTags(song, array->numItems, array->items)) - if (song_print_info(song, fd) < 0) - return -1; + return (int)song_print_info(song, fd); return 0; } @@ -125,8 +118,7 @@ static int findInDirectory(Song * song, void *_data) LocateTagItemArray *array = &data->array; if (tagItemsFoundAndMatches(song, array->numItems, array->items)) - if (song_print_info(song, fd) < 0) - return -1; + return (int)song_print_info(song, fd); return 0; } @@ -182,7 +174,7 @@ int searchStatsForSongsIn(int fd, const char *name, int numItems, int printAllIn(int fd, const char *name) { - return traverseAllIn(name, printSongInDirectory, + return traverseAllIn(name, song_print_url_x, printDirectoryInDirectory, (void*)(size_t)fd); } |