Re: API explosion (Re: [RFC/RFT] calloutng)

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Wed, 19 Dec 2012 15:37:28 +0000
--------
In message <20121219150809.GA98673_at_onelab2.iet.unipi.it>, Luigi Rizzo writes:

>>         typedef dur_t   int64_t;        /* signed for bug catching */
>>         #define DURSEC  ((dur_t)1 << 32)
>>         #define DURMIN  (DURSEC * 60)
>>         #define DURMSEC (DURSEC / 1000)
>>         #define DURUSEC (DURSEC / 10000000)
>>         #define DURNSEC (DURSEC / 10000000000)


>only thing, we must be careful with the parentheses

Actually, it's more impportant to be careful with zeros, if you
adjust the above to the correct number of zeros, DURNSEC is 4,
which is within seven percent of the correct value.

>(btw the typedef is swapped, should be "typedef int64_t dur_t")

Yes, I'm trying to find out of people even listen to me :-)


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Wed Dec 19 2012 - 14:37:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC