No subject

Thu Nov 15 09:34:07 CST 2007

that one should always handle wraparound when
checking timers.  So something like
    DWORD delta = now - start_time;
    if (dwTimeout != INFINITE) && (delta < 0x80000000UL) && (delta > dwTimeout))
might be more correct... I used to always use
a signed variable for this, but C compilers
now treat overflow of signed variables as
a conceptual error, so the subtraction has to be unsigned,
There's probably a cleaner way to code this,
but doing the subtraction to get the delta time,
and then comparing against the maximum desired
delta time, is the way to avoid trouble at rollover.
- Dan

More information about the wine-devel mailing list