From 79e8abb461fa848cce3717333ee5cfa55ee91c71 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 10:49:11 +0200 Subject: song: converted typedef Song to struct song Again, a data type which can be forward-declared. [ew: * used "struct mpd_song" instead to avoid token duplication (like I did with "struct mpd_tag") as there's no good abbreviation for "song" and identical tokens on the same line don't read well * rewritten using perl -i -p -e 's/\bSong\b/struct mpd_song/g' src/*.[ch] since it was too hard to merge * also, I don't care much for forward declarations ] --- src/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stats.c') diff --git a/src/stats.c b/src/stats.c index 4555907db..f200a48b3 100644 --- a/src/stats.c +++ b/src/stats.c @@ -40,7 +40,7 @@ struct visit_data { struct strset *set; }; -static int visit_tag_items(Song *song, void *_data) +static int visit_tag_items(struct mpd_song *song, void *_data) { const struct visit_data *data = _data; unsigned i; -- cgit v1.2.3 From 729523ec80f35a683c982054628cd47d2161d3d4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:07:35 +0200 Subject: directory: moved code to database.c Taming the directory.c monster, part II: move the database management stuff to database. directory.c should only contain code which works on directory objects. --- src/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stats.c') diff --git a/src/stats.c b/src/stats.c index f200a48b3..61cdd1f92 100644 --- a/src/stats.c +++ b/src/stats.c @@ -19,7 +19,7 @@ #include "stats.h" -#include "directory.h" +#include "database.h" #include "myfprintf.h" #include "outputBuffer.h" #include "tag.h" -- cgit v1.2.3 From 4629f646077109f7c6185aab92560da52c237412 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:07:55 +0200 Subject: database: renamed functions, "db_" prefix and no CamelCase Yet another CamelCase removal patch. --- src/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/stats.c') diff --git a/src/stats.c b/src/stats.c index 61cdd1f92..abe03444a 100644 --- a/src/stats.c +++ b/src/stats.c @@ -65,7 +65,7 @@ static unsigned int getNumberOfTagItems(int type) data.type = type; data.set = strset_new(); - traverseAllIn(NULL, visit_tag_items, NULL, &data); + db_walk(NULL, visit_tag_items, NULL, &data); ret = strset_size(data.set); strset_free(data.set); @@ -88,6 +88,6 @@ int printStats(int fd) time(NULL) - stats.daemonStart, (long)(ob_get_total_time() + 0.5), stats.dbPlayTime, - getDbModTime()); + db_get_mtime()); return 0; } -- cgit v1.2.3