From e12ebb484bf369ea425e93521d99cc6813996e4e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2008 21:51:28 +0100 Subject: filelist: filelist_find_song() returns position instead of pointer Making the function return the index makes it more flexible: those who want the pointer can use filelist_get(), and the others may use the index for other purposes. --- src/filelist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/filelist.c') diff --git a/src/filelist.c b/src/filelist.c index 415eec402..2e078635a 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -118,7 +118,7 @@ filelist_sort(struct filelist *filelist, GCompareFunc compare_func) compare_func); } -struct filelist_entry * +int filelist_find_song(struct filelist *fl, const struct mpd_song *song) { guint i; @@ -133,11 +133,11 @@ filelist_find_song(struct filelist *fl, const struct mpd_song *song) struct mpd_song *song2 = entity->info.song; if (strcmp(song->file, song2->file) == 0) - return entry; + return i; } } - return NULL; + return -1; } int -- cgit v1.2.3