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/directory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/directory.c') diff --git a/src/directory.c b/src/directory.c index 2a49fe8ff..93bde7de9 100644 --- a/src/directory.c +++ b/src/directory.c @@ -173,7 +173,7 @@ int printDirectoryInfo(int fd, const char *name) return 0; } -static int directory_song_write(Song *song, void *data) +static int directory_song_write(struct mpd_song *song, void *data) { int fd = (int)(size_t)data; @@ -463,7 +463,7 @@ int readDirectoryDB(void) static int traverseAllInSubDirectory(struct directory * directory, - int (*forEachSong) (Song *, void *), + int (*forEachSong) (struct mpd_song *, void *), int (*forEachDir) (struct directory *, void *), void *data) { @@ -489,13 +489,13 @@ traverseAllInSubDirectory(struct directory * directory, int traverseAllIn(const char *name, - int (*forEachSong) (Song *, void *), + int (*forEachSong) (struct mpd_song *, void *), int (*forEachDir) (struct directory *, void *), void *data) { struct directory *directory; if ((directory = getDirectory(name)) == NULL) { - Song *song; + struct mpd_song *song; if ((song = getSongFromDB(name)) && forEachSong) { return forEachSong(song, data); } @@ -514,9 +514,9 @@ void directory_init(void) stats.dbPlayTime = sumSongTimesIn(NULL); } -Song *getSongFromDB(const char *file) +struct mpd_song *getSongFromDB(const char *file) { - Song *song = NULL; + struct mpd_song *song = NULL; struct directory *directory; char *dir = NULL; char *duplicated = xstrdup(file); -- cgit v1.2.3