Date: Mon, 31 Mar 1997 20:57:17 -0500 (EST) From: firewind To: John K Murphy cc: djgpp AT delorie DOT com Subject: Re: rawclock() not working right? In-Reply-To: <19970331.170447.12510.0.john.k.murphy@juno.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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