1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00
putty-source/notiming.c
Ben Harris d5836982e2 Two related changes to timing code:
First, make absolute times unsigned.  This means that it's safe to 
depend on their overflow behaviour (which is undefined for signed 
integers).  This requires a little extra care in handling comparisons, 
but I think I've correctly adjusted them all.

Second, functions registered with schedule_timer() are guaranteed to be 
called with precisely the time that was returned by schedule_timer().  
Thus, it's only necessary to check these values for equality rather than 
doing risky range checks, so do that.

The timing code still does lots that's undefined, unnecessary, or just
wrong, but this is a good start.

[originally from svn r9667]
2012-09-18 21:42:48 +00:00

22 lines
593 B
C

/*
* notiming.c: stub version of timing API.
*
* Used in any tool which needs a subsystem linked against the
* timing API but doesn't want to actually provide timing. For
* example, key generation tools need the random number generator,
* but they don't want the hassle of calling noise_regular() at
* regular intervals - and they don't _need_ it either, since they
* have their own rigorous and different means of noise collection.
*/
#include "putty.h"
unsigned long schedule_timer(int ticks, timer_fn_t fn, void *ctx)
{
return 0;
}
void expire_timer_context(void *ctx)
{
}