Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
flac
Commits
1f208a89
Commit
1f208a89
authored
Jan 08, 2003
by
Josh Coalson
Browse files
working RNG patch for MSVC
parent
cda02d30
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test_streams/main.c
View file @
1f208a89
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment