Re: [chrony-dev] [PATCH] Fix rounding in UTI_DoubleToTimeval()

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Fri, Jul 24, 2015 at 04:24:06AM +1200, Bryan Christianson wrote:
> typedef long			__darwin_time_t;	/* time() */
> 
> typedef __int32_t	__darwin_suseconds_t;	/* [???] microseconds */
> 
> So there is no 2038 issue and 1.0e6 microseconds will always fit into an int32. Weird that the struct timeval is no longer symmetrical tho. I hadn't actually noticed that before.
> 
> Casting tv_usec values to int will work on a Mac and suppress the warnings. Does any supported OS have int < 32 bits ? 

I think there are many places in the code that assume int is at least
32 bits. It would probably be better to use int32_t instead.

Does casting frac_part to suseconds_t help?

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/