diff options
author | Max Kellermann <max@duempel.org> | 2009-01-24 15:56:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-24 15:56:30 +0100 |
commit | ba7c9962663d2e80a6320ca097c06a0849218d27 (patch) | |
tree | 797807ad8df6a95b967945299e2160465e0df6f9 /src/dbUtils.c | |
parent | e1001491240f5925d5f75673552e297c3244e107 (diff) | |
download | mpd-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 'src/dbUtils.c')
-rw-r--r-- | src/dbUtils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c index bfe262b85..e130ba680 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -92,20 +92,21 @@ searchForSongsIn(struct client *client, const char *name, { int ret; int i; - struct locate_item *new_items = - g_memdup(items, sizeof(items[0]) * numItems); + struct locate_item_list *new_list; struct search_data data; + new_list = locate_item_list_new(numItems); for (i = 0; i < numItems; 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); data.client = client; data.array.numItems = numItems; - data.array.items = new_items; + data.array.items = new_list->items; ret = db_walk(name, searchInDirectory, NULL, &data); - locate_item_list_free(numItems, new_items); + locate_item_list_free(new_list); return ret; } |