aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue_print.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-24 15:56:30 +0100
committerMax Kellermann <max@duempel.org>2009-01-24 15:56:30 +0100
commitba7c9962663d2e80a6320ca097c06a0849218d27 (patch)
tree797807ad8df6a95b967945299e2160465e0df6f9 /src/queue_print.c
parente1001491240f5925d5f75673552e297c3244e107 (diff)
downloadmpd-ba7c9962663d2e80a6320ca097c06a0849218d27.tar.gz
mpd-ba7c9962663d2e80a6320ca097c06a0849218d27.tar.xz
mpd-ba7c9962663d2e80a6320ca097c06a0849218d27.zip
locate: added struct locate_item_list
Instead of passing two parameters around (number of items, array of items), combine both in a variable size struct.
Diffstat (limited to '')
-rw-r--r--src/queue_print.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/queue_print.c b/src/queue_print.c
index b7510a15d..3c0437ca0 100644
--- a/src/queue_print.c
+++ b/src/queue_print.c
@@ -84,20 +84,20 @@ queue_search(struct client *client, const struct queue *queue,
unsigned num_items, const struct locate_item *items)
{
unsigned i;
- struct locate_item *new_items =
- g_memdup(items, sizeof(items[0]) * num_items);
+ struct locate_item_list *new_list = locate_item_list_new(num_items);
for (i = 0; i < num_items; i++)
- new_items[i].needle = g_utf8_casefold(new_items[i].needle, -1);
+ new_list->items[i].needle =
+ g_utf8_casefold(items[i].needle, -1);
for (i = 0; i < queue_length(queue); i++) {
const struct song *song = queue_get(queue, i);
- if (locate_song_search(song, num_items, new_items))
+ if (locate_song_search(song, num_items, new_list->items))
queue_print_song_info(client, queue, i);
}
- locate_item_list_free(num_items, new_items);
+ locate_item_list_free(new_list);
}
void