Cyril Brulebois <[email protected]> wrote:
> If TimerSet gets called with a big timeout, this call can overflow:
> millis += now;
>
> Detect overflow and set millis to the maximal integer when that happens,
> to avoid falling in the “already expired” case.
Hi Cyril,
I found this, buried in Section 6.2.5 (9) of the C Standard:
A computation involving unsigned operands can never overflow,
because a result that cannot be represented by the resulting
unsigned integer type is reduced modulo the number that is one
greater than the largest value that can be represented by the
resulting type.
So, I presume, something isn't quite right in this series.
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel