summaryrefslogtreecommitdiff
path: root/audio/xmms
diff options
context:
space:
mode:
authorhans <hans@pkgsrc.org>2011-05-14 16:17:46 +0000
committerhans <hans@pkgsrc.org>2011-05-14 16:17:46 +0000
commit4ff3200381252175156c028962cb0fe929eff337 (patch)
tree511c43f4c2a454f2926797fe57c81f6bdff126b1 /audio/xmms
parentaa7e2d1e7be2b4079a2aa97408082ee6641f614d (diff)
downloadpkgsrc-4ff3200381252175156c028962cb0fe929eff337.tar.gz
Fix a segfault, seen on SunOS when compiled with lang/gcc44.
Diffstat (limited to 'audio/xmms')
-rw-r--r--audio/xmms/distinfo3
-rw-r--r--audio/xmms/patches/patch-ax30
2 files changed, 32 insertions, 1 deletions
diff --git a/audio/xmms/distinfo b/audio/xmms/distinfo
index fc6ccd30127..1ef81f531ae 100644
--- a/audio/xmms/distinfo
+++ b/audio/xmms/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.35 2011/05/14 16:13:39 hans Exp $
+$NetBSD: distinfo,v 1.36 2011/05/14 16:17:46 hans Exp $
SHA1 (xmms-1.2.11.tar.bz2) = 9d1eae4baab25fd35c9ddfb49321ca60222f672d
RMD160 (xmms-1.2.11.tar.bz2) = 466a624572574c56595ef34f42c43d0b74857b0a
@@ -15,3 +15,4 @@ SHA1 (patch-ap) = 101c54e2ce0e575893b8d3880ca54a021e89a8dd
SHA1 (patch-aq) = 2a16fbd747e03df4ef0fbb94e45c79e9c3de9ac8
SHA1 (patch-ar) = b9cf22e3ab585ef255a533e56a3430f49f2fba4f
SHA1 (patch-aw) = eed1a2b95f8d92bb75c118f64a4e33b97b9b4ee5
+SHA1 (patch-ax) = 252a76fe3d0c96b850cd6cec5a8a7d02f80912ee
diff --git a/audio/xmms/patches/patch-ax b/audio/xmms/patches/patch-ax
new file mode 100644
index 00000000000..cc00bf70a26
--- /dev/null
+++ b/audio/xmms/patches/patch-ax
@@ -0,0 +1,30 @@
+$NetBSD: patch-ax,v 1.1 2011/05/14 16:17:46 hans Exp $
+
+--- xmms/playlist.c.orig 2007-11-16 22:51:30.000000000 +0100
++++ xmms/playlist.c 2010-01-16 00:31:37.850435192 +0100
+@@ -564,7 +564,7 @@ void playlist_play(void)
+ /* If there are entries */
+ if (g_list_length(skinlist)) {
+ /* Get a random value to select the skin to use */
+- int randval = (gint)(random() / (RAND_MAX + 1.0) * (g_list_length(skinlist) + 1));
++ int randval = (gint)((double)rand() / (double)(RAND_MAX + 1) * (g_list_length(skinlist) + 1));
+ /* If the random value is 0, use the default skin */
+ /* Otherwise subtract 1 from the random value and */
+ /* select the skin */
+@@ -1693,14 +1693,14 @@ static GList *playlist_shuffle_list(GLis
+ for (node = list, i = 0; i < len; node = g_list_next(node), i++)
+ ptrs[i] = node;
+
+- j = (int)(random() / (RAND_MAX + 1.0) * len);
++ j = (int)((double)rand() / (double)(RAND_MAX + 1.0) * len);
+ list = ptrs[j];
+ ptrs[j]->next = NULL;
+ ptrs[j] = ptrs[0];
+
+ for (i = 1; i < len; i++)
+ {
+- j = (int)(random() / (RAND_MAX + 1.0) * (len - i));
++ j = (int)((double)rand() / (double)(RAND_MAX + 1.0) * (len - i));
+ list->prev = ptrs[i + j];
+ ptrs[i + j]->next = list;
+ list = ptrs[i + j];