aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-05 16:44:59 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-05 17:20:02 -0700
commitda744eba5313dd59b107872b83b8ee207b71f74a (patch)
treee4209c405744cc313e97c24050655c11566fef40
parentd19a44a5f80dd4b02ab03b8639358f83927076a9 (diff)
downloadmpd-da744eba5313dd59b107872b83b8ee207b71f74a.tar.gz
mpd-da744eba5313dd59b107872b83b8ee207b71f74a.tar.xz
mpd-da744eba5313dd59b107872b83b8ee207b71f74a.zip
song: get rid of newNullSong()
It didn't save us any lines of code nor did it do anything useful since we would overwrite everything anyways.
Diffstat (limited to '')
-rw-r--r--src/song.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/song.c b/src/song.c
index d1a35afb3..943adfe73 100644
--- a/src/song.c
+++ b/src/song.c
@@ -29,18 +29,6 @@
#include "os_compat.h"
-static Song *newNullSong(void)
-{
- Song *song = xmalloc(sizeof(Song));
-
- song->tag = NULL;
- song->url = NULL;
- song->type = SONG_TYPE_FILE;
- song->parentDir = NULL;
-
- return song;
-}
-
Song *newSong(const char *url, int type, Directory * parentDir)
{
Song *song;
@@ -50,8 +38,8 @@ Song *newSong(const char *url, int type, Directory * parentDir)
return NULL;
}
- song = newNullSong();
-
+ song = xmalloc(sizeof(Song));
+ song->tag = NULL;
song->url = xstrdup(url);
song->type = type;
song->parentDir = parentDir;
@@ -169,7 +157,8 @@ void readSongInfoIntoList(FILE * fp, Directory * parentDir)
if (!prefixcmp(buffer, SONG_KEY)) {
if (song)
insertSongIntoList(sv, song);
- song = newNullSong();
+ song = xmalloc(sizeof(Song));
+ song->tag = NULL;
song->url = xstrdup(buffer + strlen(SONG_KEY));
song->type = SONG_TYPE_FILE;
song->parentDir = parentDir;