Date: Thu, 19 Dec 2013 21:46:47 +0100 From: Andreas Tobler <andreast@FreeBSD.org> To: Stefan Esser <se@FreeBSD.org>, Bruce Evans <brde@optusnet.com.au> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r259609 - head/sys/kern Message-ID: <52B35B37.5070809@FreeBSD.org> In-Reply-To: <52B32647.2030008@freebsd.org> References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org>
index | next in thread | previous in thread | raw e-mail
On 19.12.13 18:00, Stefan Esser wrote:
> I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the
> missing empty line:
>
> static __inline sbintime_t
> timer2sbintime(intptr_t data)
> {
>
> if (data > INT64_MAX / SBT_1MS)
> return INT64_MAX;
> return (SBT_1MS * data);
> }
>
> If you can show evidence that a limit of INT64_MAX/2 is more appropriate
> (2^30 seconds or 34 years), the limit could be of course be reduced to
> that value.
>
> I could not find any code that would not tolerate INT64_MAX, though ...
Aehm, what about 32-bit systems where intptr_t == __int32_t?
cc1: warnings being treated as errors
/export/devel/fbsd/src/sys/kern/kern_event.c: In function 'timer2sbintime':
/export/devel/fbsd/src/sys/kern/kern_event.c:529: warning: comparison is
always false due to limited range of data type
Andreas
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52B35B37.5070809>
