spring: Avoid looping if time appears to be going backwards
authorRob Bradford <rob@linux.intel.com>
Fri, 3 Aug 2012 16:02:04 +0000 (17:02 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 3 Aug 2012 17:13:34 +0000 (13:13 -0400)
commitc4f3338745fc2074e2c1c68e334fc9aae15a525f
treebf552cdde114ae80a72002c3e314f826d86c6461
parent552d12b10e1faa3f8c8340fcf5fe889b859cd5b0
spring: Avoid looping if time appears to be going backwards

Since the time values are unsigned integers we can check whether the msec is
smaller than spring->timestamp by checking if the subtraction overflows into a
value greater than half the maximum unsigned integer range (ie. top bit set)
src/util.c