aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-07 22:09:55 +0200
committerMax Kellermann <max@duempel.org>2008-10-07 22:09:55 +0200
commitf0366cc8ca8c42063d18196fca757017a4390f88 (patch)
tree080bef24a262f77d38df40eee1e8eceea55770bf /src
parent8be60263361fa00e9ea332e64db8122455d234d9 (diff)
downloadmpd-f0366cc8ca8c42063d18196fca757017a4390f88.tar.gz
mpd-f0366cc8ca8c42063d18196fca757017a4390f88.tar.xz
mpd-f0366cc8ca8c42063d18196fca757017a4390f88.zip
songvec: pass const pointers
Pass const songvec pointers to songvec_find() and songvec_for_each().
Diffstat (limited to '')
-rw-r--r--src/songvec.c7
-rw-r--r--src/songvec.h7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/songvec.c b/src/songvec.c
index b22ac4c1b..08ff7f236 100644
--- a/src/songvec.c
+++ b/src/songvec.c
@@ -23,7 +23,8 @@ void songvec_sort(struct songvec *sv)
pthread_mutex_unlock(&nr_lock);
}
-Song *songvec_find(struct songvec *sv, const char *url)
+Song *
+songvec_find(const struct songvec *sv, const char *url)
{
int i;
Song *ret = NULL;
@@ -83,7 +84,9 @@ 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(const struct songvec *sv,
+ int (*fn)(Song *, void *), void *arg)
{
size_t i;
diff --git a/src/songvec.h b/src/songvec.h
index dbe6be508..0373ed3e7 100644
--- a/src/songvec.h
+++ b/src/songvec.h
@@ -11,7 +11,8 @@ struct songvec {
void songvec_sort(struct songvec *sv);
-Song *songvec_find(struct songvec *sv, const char *url);
+Song *
+songvec_find(const struct songvec *sv, const char *url);
int songvec_delete(struct songvec *sv, const Song *del);
@@ -19,6 +20,8 @@ void songvec_add(struct songvec *sv, Song *add);
void songvec_destroy(struct songvec *sv);
-int songvec_for_each(struct songvec *sv, int (*fn)(Song *, void *), void *arg);
+int
+songvec_for_each(const struct songvec *sv,
+ int (*fn)(Song *, void *), void *arg);
#endif /* SONGVEC_H */