- fix build with gcc2
This commit is contained in:
parent
92b9cd5d45
commit
36bcb889b3
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.3 2010/09/06 00:04:28 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.4 2010/09/06 11:40:39 jasper Exp $
|
||||
|
||||
COMMENT= library for interfacing MPD
|
||||
|
||||
DISTNAME= libmpdclient-2.1
|
||||
REVISION= 0
|
||||
REVISION= 1
|
||||
SHARED_LIBS= mpdclient 0.0 # 2.0
|
||||
CATEGORIES= audio
|
||||
HOMEPAGE= http://mpd.wikia.com/wiki/ClientLib:libmpdclient
|
||||
|
45
audio/libmpdclient/patches/patch-src_idle_c
Normal file
45
audio/libmpdclient/patches/patch-src_idle_c
Normal file
@ -0,0 +1,45 @@
|
||||
$OpenBSD: patch-src_idle_c,v 1.1 2010/09/06 11:40:39 jasper Exp $
|
||||
|
||||
Fix build on gcc2.
|
||||
|
||||
--- src/idle.c.orig Sun Sep 5 22:39:01 2010
|
||||
+++ src/idle.c Sun Sep 5 22:40:02 2010
|
||||
@@ -57,7 +57,8 @@ static const char *const idle_names[] = {
|
||||
const char *
|
||||
mpd_idle_name(enum mpd_idle idle)
|
||||
{
|
||||
- for (unsigned i = 0; idle_names[i] != NULL; ++i)
|
||||
+ unsigned i;
|
||||
+ for (i = 0; idle_names[i] != NULL; ++i)
|
||||
if (idle == (enum mpd_idle)(1 << i))
|
||||
return idle_names[i];
|
||||
|
||||
@@ -67,9 +68,10 @@ mpd_idle_name(enum mpd_idle idle)
|
||||
enum mpd_idle
|
||||
mpd_idle_name_parse(const char *name)
|
||||
{
|
||||
+ unsigned i;
|
||||
assert(name != NULL);
|
||||
|
||||
- for (unsigned i = 0; idle_names[i] != NULL; ++i)
|
||||
+ for (i = 0; idle_names[i] != NULL; ++i)
|
||||
if (strcmp(name, idle_names[i]) == 0)
|
||||
return 1 << i;
|
||||
|
||||
@@ -141,6 +143,7 @@ mpd_send_idle(struct mpd_connection *connection)
|
||||
bool
|
||||
mpd_send_idle_mask(struct mpd_connection *connection, enum mpd_idle mask)
|
||||
{
|
||||
+ unsigned i;
|
||||
/* this buffer is large enough even for the full mask */
|
||||
char buffer[128] = "idle";
|
||||
|
||||
@@ -149,7 +152,7 @@ mpd_send_idle_mask(struct mpd_connection *connection,
|
||||
if (mpd_error_is_defined(&connection->error))
|
||||
return false;
|
||||
|
||||
- for (unsigned i = 0; idle_names[i] != NULL; ++i) {
|
||||
+ for (i = 0; idle_names[i] != NULL; ++i) {
|
||||
if (mask & (1 << i)) {
|
||||
mask &= ~(1 << i);
|
||||
strcat(buffer, " ");
|
58
audio/libmpdclient/patches/patch-src_song_c
Normal file
58
audio/libmpdclient/patches/patch-src_song_c
Normal file
@ -0,0 +1,58 @@
|
||||
$OpenBSD: patch-src_song_c,v 1.1 2010/09/06 11:40:39 jasper Exp $
|
||||
|
||||
Fix build on gcc2.
|
||||
|
||||
--- src/song.c.orig Mon Sep 6 02:24:51 2010
|
||||
+++ src/song.c Mon Sep 6 03:26:07 2010
|
||||
@@ -86,6 +86,7 @@ static struct mpd_song *
|
||||
mpd_song_new(const char *uri)
|
||||
{
|
||||
struct mpd_song *song;
|
||||
+ unsigned i;
|
||||
|
||||
assert(uri != NULL);
|
||||
|
||||
@@ -100,7 +101,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;
|
||||
@@ -116,12 +117,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;
|
||||
@@ -151,6 +155,7 @@ struct mpd_song *
|
||||
mpd_song_dup(const struct mpd_song *song)
|
||||
{
|
||||
struct mpd_song *ret;
|
||||
+ unsigned i;
|
||||
bool success;
|
||||
|
||||
assert(song != NULL);
|
||||
@@ -160,7 +165,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)
|
30
audio/libmpdclient/patches/patch-src_tag_c
Normal file
30
audio/libmpdclient/patches/patch-src_tag_c
Normal file
@ -0,0 +1,30 @@
|
||||
$OpenBSD: patch-src_tag_c,v 1.1 2010/09/06 11:40:39 jasper Exp $
|
||||
|
||||
Fix build on gcc2.
|
||||
|
||||
--- src/tag.c.orig Mon Sep 6 05:17:09 2010
|
||||
+++ src/tag.c Mon Sep 6 05:18:21 2010
|
||||
@@ -69,9 +69,10 @@ mpd_tag_name(enum mpd_tag_type type)
|
||||
enum mpd_tag_type
|
||||
mpd_tag_name_parse(const char *name)
|
||||
{
|
||||
+ unsigned i;
|
||||
assert(name != NULL);
|
||||
|
||||
- for (unsigned i = 0; i < MPD_TAG_COUNT; ++i)
|
||||
+ for (i = 0; i < MPD_TAG_COUNT; ++i)
|
||||
if (strcmp(name, mpd_tag_type_names[i]) == 0)
|
||||
return (enum mpd_tag_type)i;
|
||||
|
||||
@@ -108,9 +109,10 @@ ignore_case_string_equals(const char *a, const char *b
|
||||
enum mpd_tag_type
|
||||
mpd_tag_name_iparse(const char *name)
|
||||
{
|
||||
+ unsigned i;
|
||||
assert(name != NULL);
|
||||
|
||||
- for (unsigned i = 0; i < MPD_TAG_COUNT; ++i)
|
||||
+ for (i = 0; i < MPD_TAG_COUNT; ++i)
|
||||
if (ignore_case_string_equals(name, mpd_tag_type_names[i]))
|
||||
return (enum mpd_tag_type)i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user