Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 51972 Details for
Bug 24137
A patch to improve xmms random generator
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
updated updated randomize patch...solarisisms
xmms-1.2.10-random.patch (text/plain), 1.22 KB, created by
devsk
on 2005-02-23 10:54:21 UTC
(
hide
)
Description:
updated updated randomize patch...solarisisms
Filename:
MIME Type:
Creator:
devsk
Created:
2005-02-23 10:54:21 UTC
Size:
1.22 KB
patch
obsolete
>--- xmms-1.2.10/xmms/playlist.c.orig 2005-02-23 09:57:20.751963000 -0800 >+++ xmms-1.2.10/xmms/playlist.c 2005-02-23 10:24:51.879273000 -0800 >@@ -563,7 +563,11 @@ > /* If there are entries */ > if (g_list_length(skinlist)) { > /* Get a random value to select the skin to use */ >- int randval = random() % (g_list_length(skinlist) + 1); >+#if defined(sun) >+ int randval = (gint)(random() / (INT_MAX + 1.0) * (g_list_length(skinlist) + 1)); >+#else >+ int randval = (gint)(random() / (RAND_MAX + 1.0) * (g_list_length(skinlist) + 1)); >+#endif > /* If the random value is 0, use the default skin */ > /* Otherwise subtract 1 from the random value and */ > /* select the skin */ >@@ -1664,14 +1668,22 @@ > for (node = list, i = 0; i < len; node = g_list_next(node), i++) > ptrs[i] = node; > >+#if defined(sun) >+ j = (int)(random() / (INT_MAX + 1.0) * len); >+#else > j = (int)(random() / (RAND_MAX + 1.0) * len); >+#endif > list = ptrs[j]; > ptrs[j]->next = NULL; > ptrs[j] = ptrs[0]; > > for (i = 1; i < len; i++) > { >+#if defined(sun) >+ j = (int)(random() / (INT_MAX + 1.0) * (len - i)); >+#else > j = (int)(random() / (RAND_MAX + 1.0) * (len - i)); >+#endif > list->prev = ptrs[i + j]; > ptrs[i + j]->next = list; > list = ptrs[i + j];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24137
:
17126
|
17680
|
51964
| 51972