From 7e7e3eb8d5686e11a126128ff43adf34a3ad8f90 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Jan 2012 18:06:25 +0100 Subject: songvec: _delete() returns void The given song must exist, or MPD will abort. Calling it with an unknown song is illegal. --- src/songvec.c | 6 +++--- src/songvec.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/songvec.c b/src/songvec.c index 9c7b30845..5f5b43f08 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -142,7 +142,7 @@ songvec_find(const struct songvec *sv, const char *uri) return ret; } -int +void songvec_delete(struct songvec *sv, const struct song *del) { size_t i; @@ -161,11 +161,11 @@ songvec_delete(struct songvec *sv, const struct song *del) sv->base = g_realloc(sv->base, sv_size(sv)); } db_unlock(); - return i; + return; } db_unlock(); - return -1; /* not found */ + assert(false); } void diff --git a/src/songvec.h b/src/songvec.h index 521a37700..e839b537b 100644 --- a/src/songvec.h +++ b/src/songvec.h @@ -36,7 +36,7 @@ void songvec_sort(struct songvec *sv); struct song * songvec_find(const struct songvec *sv, const char *uri); -int +void songvec_delete(struct songvec *sv, const struct song *del); void -- cgit v1.2.3