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/QueueSave.cxx | |
parent | 59f8144c50765189594d5932fc25869f9ea6e265 (diff) | |
download | mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.gz mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.xz mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.zip |
*: use references instead of pointers
Diffstat (limited to '')
-rw-r--r-- | src/QueueSave.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/QueueSave.cxx b/src/QueueSave.cxx index 43fb69846..1875a1270 100644 --- a/src/QueueSave.cxx +++ b/src/QueueSave.cxx @@ -38,43 +38,43 @@ #define PRIO_LABEL "Prio: " static void -queue_save_database_song(FILE *fp, int idx, const Song *song) +queue_save_database_song(FILE *fp, int idx, const Song &song) { - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); fprintf(fp, "%i:%s\n", idx, uri.c_str()); } static void -queue_save_full_song(FILE *fp, const Song *song) +queue_save_full_song(FILE *fp, const Song &song) { song_save(fp, song); } static void -queue_save_song(FILE *fp, int idx, const Song *song) +queue_save_song(FILE *fp, int idx, const Song &song) { - if (song->IsInDatabase()) + if (song.IsInDatabase()) queue_save_database_song(fp, idx, song); else queue_save_full_song(fp, song); } void -queue_save(FILE *fp, const struct queue *queue) +queue_save(FILE *fp, const queue &queue) { - for (unsigned i = 0; i < queue->GetLength(); i++) { - uint8_t prio = queue->GetPriorityAtPosition(i); + for (unsigned i = 0; i < queue.GetLength(); i++) { + uint8_t prio = queue.GetPriorityAtPosition(i); if (prio != 0) fprintf(fp, PRIO_LABEL "%u\n", prio); - queue_save_song(fp, i, queue->Get(i)); + queue_save_song(fp, i, queue.Get(i)); } } void -queue_load_song(TextFile &file, const char *line, queue *queue) +queue_load_song(TextFile &file, const char *line, queue &queue) { - if (queue->IsFull()) + if (queue.IsFull()) return; uint8_t priority = 0; @@ -124,7 +124,7 @@ queue_load_song(TextFile &file, const char *line, queue *queue) } } - queue->Append(song, priority); + queue.Append(song, priority); if (db != nullptr) db->ReturnSong(song); |