Mail Archives: djgpp/1997/03/31/21:10:57
On Mon, 31 Mar 1997, John K Murphy wrote:
> I was looking for something to seed the random # generator, and
> rawclock() looked like a good choice, since it is supposed to give the
> number of clock_ticks since midnight. I tested it, and found out
> rawclock() gives the number of something (clock_tics?) since it's first
> call, which always returns 0. Is this a bug in DGJPP or a mistake in the
> documentation... or does it work correctly on anybody's computer?
This question has come up before; I looked at the source then, and it made
no sense, and still makes no sense. Here's the important part:
if (base == 0)
base = rv;
return rv - base;
base is assigned 0 at the beginning of the function and never changed.
Then, the test passes, and 0 gets assigned to rv! I removed the assignment
and recompiled to an object file I linked with a test program, and it gave
results that appeared to be correct.
So, to answer your question, yes it's a bug, but it's easily fixable.
firewind
- Raw text -