projects
/
platform
/
upstream
/
flac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cda02d3
)
working RNG patch for MSVC
author
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 8 Jan 2003 08:03:39 +0000
(08:03 +0000)
committer
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 8 Jan 2003 08:03:39 +0000
(08:03 +0000)
src/test_streams/main.c
patch
|
blob
|
history
diff --git
a/src/test_streams/main.c
b/src/test_streams/main.c
index
3b79984
..
28e1764
100644
(file)
--- a/
src/test_streams/main.c
+++ b/
src/test_streams/main.c
@@
-538,7
+538,7
@@
static FLAC__bool generate_noise(const char *fn, unsigned bytes)
}
srandom(tv.tv_usec);
#else
- /* who has the patience to figure out how to do RNG with VC++? */
+ srand(time(0));
#endif
if(0 == (f = fopen(fn, mode)))
@@
-548,7
+548,7
@@
static FLAC__bool generate_noise(const char *fn, unsigned bytes)
#if !defined _MSC_VER && !defined __MINGW32__
FLAC__byte x = (FLAC__byte)(((unsigned)random()) & 0xff);
#else
- FLAC__byte x = (FLAC__byte)(((
(unsigned)generate_noise) >> 8) ^ (b * 17)); /* fake it */
+ FLAC__byte x = (FLAC__byte)(((
unsigned)rand()) & 0xff);
#endif
if(fwrite(&x, sizeof(x), 1, f) < 1)
goto foo;