diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-30 14:33:19 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-30 14:33:19 +0000 |
commit | 38ade145bc5205d45e5677f16d823a102a0b90d8 (patch) | |
tree | c4501446ec113217c926d6649040e36948fe045f /src/playlist.c | |
parent | fb2c5f5d5fbeb5081e40cbbb80cb4e7d99194cb9 (diff) | |
download | mpd-38ade145bc5205d45e5677f16d823a102a0b90d8.tar.gz mpd-38ade145bc5205d45e5677f16d823a102a0b90d8.tar.xz mpd-38ade145bc5205d45e5677f16d823a102a0b90d8.zip |
use random() instead of rand()
git-svn-id: https://svn.musicpd.org/mpd/trunk@2420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playlist.c')
-rw-r--r-- | src/playlist.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/playlist.c b/src/playlist.c index a77581c5c..580a2e1ec 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -177,7 +177,7 @@ void initPlaylist() { memset(playlist.songs,0,sizeof(char *)*playlist_max_length); - srand(time(NULL)); + srandom(time(NULL)); playlist_stateFile = parseConfigFilePath(CONF_STATE_FILE, 0); @@ -643,7 +643,7 @@ int addSongToPlaylist(FILE * fp, Song * song) { else */if(playlist.queued>=0) start = playlist.queued+1; else start = playlist.current+1; if(start < playlist.length) { - swap = rand()%(playlist.length-start); + swap = random()%(playlist.length-start); swap+=start; swapOrder(playlist.length-1,swap); } @@ -1137,7 +1137,7 @@ void randomizeOrder(int start,int end) { } for(i=start;i<=end;i++) { - ri = rand()%(end-start+1)+start; + ri = random()%(end-start+1)+start; if(ri==playlist.current) playlist.current = i; else if(i==playlist.current) playlist.current = ri; swapOrder(i,ri); @@ -1228,7 +1228,7 @@ int shufflePlaylist(FILE * fp) { } /* shuffle the rest of the list */ for(;i<playlist.length;i++) { - ri = rand()%(playlist.length-1)+1; + ri = random()%(playlist.length-1)+1; swapSongs(i,ri); } |