Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 17126 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]
xmms-1.2.8-random.patch
xmms-1.2.8-random.patch (text/plain), 1012 bytes, created by
Bret Towe
on 2003-09-05 11:35:48 UTC
(
hide
)
Description:
xmms-1.2.8-random.patch
Filename:
MIME Type:
Creator:
Bret Towe
Created:
2003-09-05 11:35:48 UTC
Size:
1012 bytes
patch
obsolete
>--- ./xmms/playlist.c.old 2003-09-05 11:31:27.000000000 -0700 >+++ ./xmms/playlist.c 2003-09-05 11:33:19.000000000 -0700 >@@ -543,7 +543,8 @@ > /* 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); >+ int len = (g_list_length(skinlist) + 1); >+ int randval = (int)((double)random() / RAND_MAX * len); > /* If the random value is 0, use the default skin */ > /* Otherwise subtract 1 from the random value and */ > /* select the skin */ >@@ -1601,14 +1602,14 @@ > for (node = list, i = 0; i < len; node = g_list_next(node), i++) > ptrs[i] = node; > >- j = random() % len; >+ j = (gint)((double)random() / RAND_MAX * len); > list = ptrs[j]; > ptrs[j]->next = NULL; > ptrs[j] = ptrs[0]; > > for (i = 1; i < len; i++) > { >- j = random() % (len - i); >+ j = (gint)((double)random() / RAND_MAX * (len - i)); > 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