|
Lines 545-551
Link Here
|
| 545 |
/* If there are entries */ |
545 |
/* If there are entries */ |
| 546 |
if (g_list_length(skinlist)) { |
546 |
if (g_list_length(skinlist)) { |
| 547 |
/* Get a random value to select the skin to use */ |
547 |
/* Get a random value to select the skin to use */ |
| 548 |
int randval = random() % (g_list_length(skinlist) + 1); |
548 |
int randval = (gint)(random() / (RAND_MAX + 1.0) * (g_list_length(skinlist) + 1)); |
| 549 |
/* If the random value is 0, use the default skin */ |
549 |
/* If the random value is 0, use the default skin */ |
| 550 |
/* Otherwise subtract 1 from the random value and */ |
550 |
/* Otherwise subtract 1 from the random value and */ |
| 551 |
/* select the skin */ |
551 |
/* select the skin */ |
|
Lines 1899-1905
Link Here
|
| 1899 |
{ |
1899 |
{ |
| 1900 |
/* Only find new songs in our current |
1900 |
/* Only find new songs in our current |
| 1901 |
score section */ |
1901 |
score section */ |
| 1902 |
j = (rand() % (next_score_section - i)) + i; |
1902 |
j = (gint)(random() / (RAND_MAX + 1.0) * (next_score_section - i)) + i; |
| 1903 |
|
1903 |
|
| 1904 |
assert(j < next_score_section); |
1904 |
assert(j < next_score_section); |
| 1905 |
} |
1905 |
} |
|
Lines 1984-1990
Link Here
|
| 1984 |
gint j; |
1984 |
gint j; |
| 1985 |
|
1985 |
|
| 1986 |
/* Pick a random song among the ones that are left */ |
1986 |
/* Pick a random song among the ones that are left */ |
| 1987 |
j = (rand() % (len - i)) + i; |
1987 |
j = (gint)(random() / (RAND_MAX + 1.0) * (len - i)) + i; |
| 1988 |
|
1988 |
|
| 1989 |
/* Swap pointer #i and pointer #j */ |
1989 |
/* Swap pointer #i and pointer #j */ |
| 1990 |
swap_ptr = ptrs[i]; |
1990 |
swap_ptr = ptrs[i]; |