diff options
author | Max Kellermann <max@duempel.org> | 2012-08-07 21:32:08 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-07 21:32:08 +0200 |
commit | 1a75abffa531d67f3c76f8cdc0423623d1324a95 (patch) | |
tree | d6172bad2b8a3012b4ceb224081eead06db954c1 /src/DatabasePlaylist.cxx | |
parent | c6a0f5d3f9d70b890dfdc3ae0474dbcf72fe0499 (diff) | |
download | mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.tar.gz mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.tar.xz mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.zip |
Database{Plugin,Visitor}: pass references
Diffstat (limited to '')
-rw-r--r-- | src/DatabasePlaylist.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
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 <functional> +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); |