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
63c9a20f
Commit
63c9a20f
authored
Jul 25, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
queue_save: queue_load_song() returns void
The only caller doesn't use its return value, and the value isn't useful anyway.
parent
b40c0811
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
playlist_state.c
src/playlist_state.c
+1
-3
queue_save.c
src/queue_save.c
+4
-5
queue_save.h
src/queue_save.h
+2
-3
No files found.
src/playlist_state.c
View file @
63c9a20f
...
@@ -101,8 +101,6 @@ playlist_state_save(FILE *fp, const struct playlist *playlist)
...
@@ -101,8 +101,6 @@ playlist_state_save(FILE *fp, const struct playlist *playlist)
static
void
static
void
playlist_state_load
(
FILE
*
fp
,
GString
*
buffer
,
struct
playlist
*
playlist
)
playlist_state_load
(
FILE
*
fp
,
GString
*
buffer
,
struct
playlist
*
playlist
)
{
{
int
song
;
const
char
*
line
=
read_text_line
(
fp
,
buffer
);
const
char
*
line
=
read_text_line
(
fp
,
buffer
);
if
(
line
==
NULL
)
{
if
(
line
==
NULL
)
{
g_warning
(
"No playlist in state file"
);
g_warning
(
"No playlist in state file"
);
...
@@ -110,7 +108,7 @@ playlist_state_load(FILE *fp, GString *buffer, struct playlist *playlist)
...
@@ -110,7 +108,7 @@ playlist_state_load(FILE *fp, GString *buffer, struct playlist *playlist)
}
}
while
(
!
g_str_has_prefix
(
line
,
PLAYLIST_STATE_FILE_PLAYLIST_END
))
{
while
(
!
g_str_has_prefix
(
line
,
PLAYLIST_STATE_FILE_PLAYLIST_END
))
{
song
=
queue_load_song
(
&
playlist
->
queue
,
line
);
queue_load_song
(
&
playlist
->
queue
,
line
);
line
=
read_text_line
(
fp
,
buffer
);
line
=
read_text_line
(
fp
,
buffer
);
if
(
line
==
NULL
)
{
if
(
line
==
NULL
)
{
...
...
src/queue_save.c
View file @
63c9a20f
...
@@ -53,7 +53,7 @@ get_song(const char *uri)
...
@@ -53,7 +53,7 @@ get_song(const char *uri)
return
NULL
;
return
NULL
;
}
}
int
void
queue_load_song
(
struct
queue
*
queue
,
const
char
*
line
)
queue_load_song
(
struct
queue
*
queue
,
const
char
*
line
)
{
{
long
ret
;
long
ret
;
...
@@ -61,20 +61,19 @@ queue_load_song(struct queue *queue, const char *line)
...
@@ -61,20 +61,19 @@ queue_load_song(struct queue *queue, const char *line)
struct
song
*
song
;
struct
song
*
song
;
if
(
queue_is_full
(
queue
))
if
(
queue_is_full
(
queue
))
return
-
1
;
return
;
ret
=
strtol
(
line
,
&
endptr
,
10
);
ret
=
strtol
(
line
,
&
endptr
,
10
);
if
(
ret
<
0
||
*
endptr
!=
':'
||
endptr
[
1
]
==
0
)
{
if
(
ret
<
0
||
*
endptr
!=
':'
||
endptr
[
1
]
==
0
)
{
g_warning
(
"Malformed playlist line in state file"
);
g_warning
(
"Malformed playlist line in state file"
);
return
-
1
;
return
;
}
}
line
=
endptr
+
1
;
line
=
endptr
+
1
;
song
=
get_song
(
line
);
song
=
get_song
(
line
);
if
(
song
==
NULL
)
if
(
song
==
NULL
)
return
-
1
;
return
;
queue_append
(
queue
,
song
);
queue_append
(
queue
,
song
);
return
ret
;
}
}
src/queue_save.h
View file @
63c9a20f
...
@@ -33,10 +33,9 @@ void
...
@@ -33,10 +33,9 @@ void
queue_save
(
FILE
*
fp
,
const
struct
queue
*
queue
);
queue_save
(
FILE
*
fp
,
const
struct
queue
*
queue
);
/**
/**
* Loads one song from the state file line and returns its number.
* Loads one song from the state file and appends it to the queue.
* Returns -1 on failure.
*/
*/
int
void
queue_load_song
(
struct
queue
*
queue
,
const
char
*
line
);
queue_load_song
(
struct
queue
*
queue
,
const
char
*
line
);
#endif
#endif
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