From 38ade145bc5205d45e5677f16d823a102a0b90d8 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sat, 30 Oct 2004 14:33:19 +0000 Subject: use random() instead of rand() git-svn-id: https://svn.musicpd.org/mpd/trunk@2420 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 8 ++++---- 1 file 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