Commit 78506bd6 authored by Michael Natterer's avatar Michael Natterer 😴

quartz: add evil casting to make sure time wraps correctly on 32bit machines

get_time_from_ns_event(): apply patch from Michael Hutchinson which
makes sure the returned guint32 wraps correctly on 32 bit machines
when the uptime exceeds 2^32 ms.
parent e486fb81
......@@ -172,8 +172,11 @@ static guint32
get_time_from_ns_event (NSEvent *event)
double time = [event timestamp];
return time * 1000.0;
/* cast via double->uint64 conversion to make sure that it is
* wrapped on 32-bit machines when it overflows
return (guint32) (guint64) (time * 1000.0);
static int
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment