]> oss.titaniummirror.com Git - rgblamp.git/commitdiff
Better cross-platform handling of time calcs
authorR. Steve McKown <rsmckown@gmail.com>
Sun, 1 Jan 2012 02:11:32 +0000 (19:11 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sun, 1 Jan 2012 03:03:49 +0000 (20:03 -0700)
Thanks to integral promotion, a C compiler might treat the intermediate
value (t1 - t0) as a larger signed value when t1 and t0 are unsigned
values.  Cast the intermediate result to unsigned in these cases, as
this is necessary to get the correct result in the case of timer value
roll-over.


No differences found