Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
43761441
Commit
43761441
authored
Oct 06, 2008
by
Eric Wong
Committed by
Max Kellermann
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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.
parent
dc245f38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
16 deletions
+3
-16
song.c
src/song.c
+2
-13
song.h
src/song.h
+0
-2
song_save.c
src/song_save.c
+1
-1
No files found.
src/song.c
View file @
43761441
...
...
@@ -28,17 +28,6 @@
#include "os_compat.h"
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
,
enum
song_type
type
,
Directory
*
parentDir
)
{
...
...
@@ -49,8 +38,8 @@ Song *newSong(const char *url, enum song_type type, Directory * parentDir)
return
NULL
;
}
song
=
newNullSong
(
);
song
=
xmalloc
(
sizeof
(
*
song
)
);
song
->
tag
=
NULL
;
song
->
url
=
xstrdup
(
url
);
song
->
type
=
type
;
song
->
parentDir
=
parentDir
;
...
...
src/song.h
View file @
43761441
...
...
@@ -42,8 +42,6 @@ typedef struct _Song {
time_t
mtime
;
}
Song
;
Song
*
newNullSong
(
void
);
Song
*
newSong
(
const
char
*
url
,
enum
song_type
type
,
struct
_Directory
*
parentDir
);
...
...
src/song_save.c
View file @
43761441
...
...
@@ -111,7 +111,7 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
if
(
song
)
insertSongIntoList
(
sv
,
song
);
song
=
newNullSong
(
);
song
=
xmalloc
(
sizeof
(
*
song
)
);
song
->
url
=
xstrdup
(
buffer
+
strlen
(
SONG_KEY
));
song
->
type
=
SONG_TYPE_FILE
;
song
->
parentDir
=
parentDir
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment