Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 17680 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 patch
xmms-1.2.8-random_v2.patch (text/plain), 1.26 KB, created by
Bret Towe
on 2003-09-14 00:50:05 UTC
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Bret Towe
Created:
2003-09-14 00:50:05 UTC
Size:
1.26 KB
patch
obsolete
>--- xmms/playlist.c.old 2003-09-14 00:39:21.000000000 -0700 >+++ xmms/playlist.c 2003-09-14 00:45:40.000000000 -0700 >@@ -545,7 +545,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 */ >@@ -1887,7 +1888,7 @@ > { > /* Only find new songs in our current > score section */ >- j = (rand() % (next_score_section - i)) + i; >+ j = (gint)((double)random() / RAND_MAX * (next_score_section - i)) + i; > > assert(j < next_score_section); > } >@@ -1970,7 +1971,7 @@ > gint j; > > /* Pick a random song among the ones that are left */ >- j = (rand() % (len - i)) + i; >+ j = (gint)((double)random() / RAND_MAX * len); > > /* Swap pointer #i and pointer #j */ > swap_ptr = ptrs[i];
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