diff options
Diffstat (limited to '')
-rw-r--r-- | src/songvec.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/songvec.c b/src/songvec.c index cf0991029..c4f702aef 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -7,27 +7,27 @@ static pthread_mutex_t nr_lock = PTHREAD_MUTEX_INITIALIZER; /* Only used for sorting/searchin a songvec, not general purpose compares */ static int songvec_cmp(const void *s1, const void *s2) { - const Song *a = ((const Song * const *)s1)[0]; - const Song *b = ((const Song * const *)s2)[0]; + const struct mpd_song *a = ((const struct mpd_song * const *)s1)[0]; + const struct mpd_song *b = ((const struct mpd_song * const *)s2)[0]; return strcmp(a->url, b->url); } static size_t sv_size(struct songvec *sv) { - return sv->nr * sizeof(Song *); + return sv->nr * sizeof(struct mpd_song *); } void songvec_sort(struct songvec *sv) { pthread_mutex_lock(&nr_lock); - qsort(sv->base, sv->nr, sizeof(Song *), songvec_cmp); + qsort(sv->base, sv->nr, sizeof(struct mpd_song *), songvec_cmp); pthread_mutex_unlock(&nr_lock); } -Song *songvec_find(struct songvec *sv, const char *url) +struct mpd_song *songvec_find(struct songvec *sv, const char *url) { int i; - Song *ret = NULL; + struct mpd_song *ret = NULL; pthread_mutex_lock(&nr_lock); for (i = sv->nr; --i >= 0; ) { @@ -40,7 +40,7 @@ Song *songvec_find(struct songvec *sv, const char *url) return ret; } -int songvec_delete(struct songvec *sv, const Song *del) +int songvec_delete(struct songvec *sv, const struct mpd_song *del) { int i; @@ -54,7 +54,7 @@ int songvec_delete(struct songvec *sv, const Song *del) sv->base = NULL; } else { memmove(&sv->base[i], &sv->base[i + 1], - (sv->nr - i + 1) * sizeof(Song *)); + (sv->nr - i + 1) * sizeof(struct mpd_song *)); sv->base = xrealloc(sv->base, sv_size(sv)); } break; @@ -64,7 +64,7 @@ int songvec_delete(struct songvec *sv, const Song *del) return i; } -void songvec_add(struct songvec *sv, Song *add) +void songvec_add(struct songvec *sv, struct mpd_song *add) { pthread_mutex_lock(&nr_lock); ++sv->nr; @@ -84,13 +84,13 @@ void songvec_destroy(struct songvec *sv) pthread_mutex_unlock(&nr_lock); } -int songvec_for_each(struct songvec *sv, int (*fn)(Song *, void *), void *arg) +int songvec_for_each(struct songvec *sv, int (*fn)(struct mpd_song *, void *), void *arg) { size_t i; pthread_mutex_lock(&nr_lock); for (i = 0; i < sv->nr; ++i) { - Song *song = sv->base[i]; + struct mpd_song *song = sv->base[i]; assert(song); assert(*song->url); |