diff options
author | Max Kellermann <max@duempel.org> | 2013-10-19 18:48:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-19 18:48:38 +0200 |
commit | ff626ac76357940b2f0ac5cb243a68ac13df0f8a (patch) | |
tree | 493888a28950f75f5e254c0ded9dc9703ee83dc3 /src/SongPrint.cxx | |
parent | 59f8144c50765189594d5932fc25869f9ea6e265 (diff) |
*: use references instead of pointers
Diffstat (limited to 'src/SongPrint.cxx')
-rw-r--r-- | src/SongPrint.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index 65d27ca77..721fa1b1a 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -30,18 +30,18 @@ #include <glib.h> void -song_print_uri(Client *client, Song *song) +song_print_uri(Client &client, const Song &song) { - if (song->IsInDatabase() && !song->parent->IsRoot()) { + if (song.IsInDatabase() && !song.parent->IsRoot()) { client_printf(client, "%s%s/%s\n", SONG_FILE, - song->parent->GetPath(), song->uri); + song.parent->GetPath(), song.uri); } else { char *allocated; const char *uri; - uri = allocated = uri_remove_auth(song->uri); + uri = allocated = uri_remove_auth(song.uri); if (uri == NULL) - uri = song->uri; + uri = song.uri; client_printf(client, "%s%s\n", SONG_FILE, map_to_relative_path(uri)); @@ -51,24 +51,24 @@ song_print_uri(Client *client, Song *song) } void -song_print_info(Client *client, Song *song) +song_print_info(Client &client, const Song &song) { song_print_uri(client, song); - if (song->end_ms > 0) + if (song.end_ms > 0) client_printf(client, "Range: %u.%03u-%u.%03u\n", - song->start_ms / 1000, - song->start_ms % 1000, - song->end_ms / 1000, - song->end_ms % 1000); - else if (song->start_ms > 0) + song.start_ms / 1000, + song.start_ms % 1000, + song.end_ms / 1000, + song.end_ms % 1000); + else if (song.start_ms > 0) client_printf(client, "Range: %u.%03u-\n", - song->start_ms / 1000, - song->start_ms % 1000); + song.start_ms / 1000, + song.start_ms % 1000); - if (song->mtime > 0) - time_print(client, "Last-Modified", song->mtime); + if (song.mtime > 0) + time_print(client, "Last-Modified", song.mtime); - if (song->tag != nullptr) - tag_print(client, *song->tag); + if (song.tag != nullptr) + tag_print(client, *song.tag); } |