aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateContainer.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-19 18:48:38 +0200
committerMax Kellermann <max@duempel.org>2013-10-19 18:48:38 +0200
commitff626ac76357940b2f0ac5cb243a68ac13df0f8a (patch)
tree493888a28950f75f5e254c0ded9dc9703ee83dc3 /src/UpdateContainer.cxx
parent59f8144c50765189594d5932fc25869f9ea6e265 (diff)
downloadmpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.gz
mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.xz
mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.zip
*: use references instead of pointers
Diffstat (limited to '')
-rw-r--r--src/UpdateContainer.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/UpdateContainer.cxx b/src/UpdateContainer.cxx
index 6e0cadfb7..87cc50268 100644
--- a/src/UpdateContainer.cxx
+++ b/src/UpdateContainer.cxx
@@ -43,10 +43,10 @@
* The caller must lock the database.
*/
static Directory *
-make_directory_if_modified(Directory *parent, const char *name,
+make_directory_if_modified(Directory &parent, const char *name,
const struct stat *st)
{
- Directory *directory = parent->FindChild(name);
+ Directory *directory = parent.FindChild(name);
// directory exists already
if (directory != nullptr) {
@@ -59,18 +59,18 @@ make_directory_if_modified(Directory *parent, const char *name,
modified = true;
}
- directory = parent->MakeChild(name);
+ directory = parent.MakeChild(name);
directory->mtime = st->st_mtime;
return directory;
}
bool
-update_container_file(Directory *directory,
+update_container_file(Directory &directory,
const char *name,
const struct stat *st,
- const struct decoder_plugin *plugin)
+ const decoder_plugin &plugin)
{
- if (plugin->container_scan == nullptr)
+ if (plugin.container_scan == nullptr)
return false;
db_lock();
@@ -89,14 +89,14 @@ update_container_file(Directory *directory,
char *vtrack;
unsigned int tnum = 0;
TagBuilder tag_builder;
- while ((vtrack = plugin->container_scan(pathname.c_str(), ++tnum)) != nullptr) {
+ while ((vtrack = plugin.container_scan(pathname.c_str(), ++tnum)) != nullptr) {
Song *song = Song::NewFile(vtrack, contdir);
// shouldn't be necessary but it's there..
song->mtime = st->st_mtime;
const auto child_path_fs =
- map_directory_child_fs(contdir, vtrack);
+ map_directory_child_fs(*contdir, vtrack);
decoder_plugin_scan_file(plugin, child_path_fs.c_str(),
&add_tag_handler, &tag_builder);
@@ -113,7 +113,7 @@ update_container_file(Directory *directory,
modified = true;
FormatInfo(update_domain, "added %s/%s",
- directory->GetPath(), vtrack);
+ directory.GetPath(), vtrack);
g_free(vtrack);
}