aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-01-24 18:06:25 +0100
committerMax Kellermann <max@duempel.org>2012-01-24 18:06:25 +0100
commit7e7e3eb8d5686e11a126128ff43adf34a3ad8f90 (patch)
tree1b268d50cbe1b96457d4b5856ceb9365dc0c701c /src
parent2e5f8aeba138b33a799e00dc0416f3b882150155 (diff)
downloadmpd-7e7e3eb8d5686e11a126128ff43adf34a3ad8f90.tar.gz
mpd-7e7e3eb8d5686e11a126128ff43adf34a3ad8f90.tar.xz
mpd-7e7e3eb8d5686e11a126128ff43adf34a3ad8f90.zip
songvec: _delete() returns void
The given song must exist, or MPD will abort. Calling it with an unknown song is illegal.
Diffstat (limited to 'src')
-rw-r--r--src/songvec.c6
-rw-r--r--src/songvec.h2
2 files changed, 4 insertions, 4 deletions
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