a57e192971
From maintainer Tobias Ulmer before the lock.
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
$OpenBSD: patch-src_song_c,v 1.2 2011/04/05 20:09:32 landry Exp $
|
|
|
|
Fix build on gcc2.
|
|
|
|
--- src/song.c.orig Tue Jan 4 03:17:22 2011
|
|
+++ src/song.c Sun Jan 16 02:57:01 2011
|
|
@@ -101,6 +101,7 @@ static struct mpd_song *
|
|
mpd_song_new(const char *uri)
|
|
{
|
|
struct mpd_song *song;
|
|
+ unsigned i;
|
|
|
|
assert(uri != NULL);
|
|
assert(mpd_verify_uri(uri));
|
|
@@ -116,7 +117,7 @@ mpd_song_new(const char *uri)
|
|
return NULL;
|
|
}
|
|
|
|
- for (unsigned i = 0; i < MPD_TAG_COUNT; ++i)
|
|
+ for (i = 0; i < MPD_TAG_COUNT; ++i)
|
|
song->tags[i].value = NULL;
|
|
|
|
song->duration = 0;
|
|
@@ -134,12 +135,15 @@ mpd_song_new(const char *uri)
|
|
}
|
|
|
|
void mpd_song_free(struct mpd_song *song) {
|
|
+ struct mpd_tag_value *tag, *next = NULL;
|
|
+ unsigned i;
|
|
+
|
|
assert(song != NULL);
|
|
|
|
free(song->uri);
|
|
|
|
- for (unsigned i = 0; i < MPD_TAG_COUNT; ++i) {
|
|
- struct mpd_tag_value *tag = &song->tags[i], *next;
|
|
+ for (i = 0; i < MPD_TAG_COUNT; ++i) {
|
|
+ tag = &song->tags[i];
|
|
|
|
if (tag->value == NULL)
|
|
continue;
|
|
@@ -169,6 +173,7 @@ struct mpd_song *
|
|
mpd_song_dup(const struct mpd_song *song)
|
|
{
|
|
struct mpd_song *ret;
|
|
+ unsigned i;
|
|
bool success;
|
|
|
|
assert(song != NULL);
|
|
@@ -178,7 +183,7 @@ mpd_song_dup(const struct mpd_song *song)
|
|
/* out of memory */
|
|
return NULL;
|
|
|
|
- for (unsigned i = 0; i < MPD_TAG_COUNT; ++i) {
|
|
+ for (i = 0; i < MPD_TAG_COUNT; ++i) {
|
|
const struct mpd_tag_value *src_tag = &song->tags[i];
|
|
|
|
if (src_tag->value == NULL)
|