From 1a75abffa531d67f3c76f8cdc0423623d1324a95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 7 Aug 2012 21:32:08 +0200 Subject: Database{Plugin,Visitor}: pass references --- src/DatabasePlaylist.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/DatabasePlaylist.cxx') diff --git a/src/DatabasePlaylist.cxx b/src/DatabasePlaylist.cxx index 61e6d1a4f..79d956d7c 100644 --- a/src/DatabasePlaylist.cxx +++ b/src/DatabasePlaylist.cxx @@ -31,6 +31,13 @@ extern "C" { #include +static bool +AddSong(const char *playlist_path_utf8, + song &song, GError **error_r) +{ + return spl_append_song(playlist_path_utf8, &song, error_r); +} + bool addAllInToStoredPlaylist(const char *uri_utf8, const char *playlist_path_utf8, GError **error_r) @@ -39,17 +46,17 @@ addAllInToStoredPlaylist(const char *uri_utf8, const char *playlist_path_utf8, db_selection_init(&selection, uri_utf8, true); using namespace std::placeholders; - const auto f = std::bind(spl_append_song, playlist_path_utf8, _1, _2); - return GetDatabase()->Visit(&selection, f, error_r); + const auto f = std::bind(AddSong, playlist_path_utf8, _1, _2); + return GetDatabase()->Visit(selection, f, error_r); } static bool SearchAddSong(const char *playlist_path_utf8, const struct locate_item_list *criteria, - struct song *song, GError **error_r) + song &song, GError **error_r) { - return !locate_song_search(song, criteria) || - spl_append_song(playlist_path_utf8, song, error_r); + return !locate_song_search(&song, criteria) || + spl_append_song(playlist_path_utf8, &song, error_r); } bool @@ -66,7 +73,7 @@ search_add_to_playlist(const char *uri, const char *playlist_path_utf8, using namespace std::placeholders; const auto f = std::bind(SearchAddSong, playlist_path_utf8, new_list, _1, _2); - bool success = GetDatabase()->Visit(&selection, f, error_r); + bool success = GetDatabase()->Visit(selection, f, error_r); locate_item_list_free(new_list); -- cgit v1.2.3