Yo Hal!
On Wed, 15 Mar 2017 14:32:50 -0700
Hal Murray wrote:
> g...@rellim.com said:
> > I'm gonna go with this for now, it seems pretty hard to
> > misunderstand: #define NS_PER_S 10
> > #define S_PER_NS 1e-9
> > DItto for other units.
>
> Looks good to me.
I'm half done with the co
g...@rellim.com said:
> I'm gonna go with this for now, it seems pretty hard to misunderstand:
> #define NS_PER_S 10
> #define S_PER_NS 1e-9
> DItto for other units.
Looks good to me.
An alternative hack is to undef NANOSECOND in the top of timespecops.h
#include "ntp_calendar.h"
#inc
Yo Hal!
I'm gonna go with this for now, it seems pretty hard to misunderstand:
#define NS_PER_S 10
#define S_PER_NS 1e-9
DItto for other units.
I see no preactical reason for a fefine of 1e9 as NS_PER_S will
do fine for that too.
RGDS
GARY
--
Gary E. Miller writes:
>> They don't. Integer and floating point constants are different.
>
> But in this case the defines are the reciprocals of each other. Very
> bad collision.
I was responding to Hal's apparent assertion that NANOSECONDS defined as
10 and 1.e9 were the same number.
Yo Achim!
On Wed, 15 Mar 2017 19:31:43 +0100
Achim Gratz wrote:
> Hal Murray writes:
> > They all duplicate stuff already defined in timespecops.h
>
> They don't. Integer and floating point constants are different.
But in this case the defines are the reciprocals of each other. Very
bad co
Hal Murray writes:
> They all duplicate stuff already defined in timespecops.h
They don't. Integer and floating point constants are different.
> I assume the compiler doesn't complain about redefines if the result doesn't
> change.
The gcc preprocessor does it that way, yes. It's considered a
Gary E. Miller writes:
> So, any preferences for different and dsescription names that
> do not conflict with the misleading *BSD names?
Use a namespace specific to NTP(sec) for all defines. *ducks*
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Factory
g...@rellim.com said:
> So, any preferences for different and dsescription names that do not
> conflict with the misleading *BSD names?
I don't have any good suggestions.
I'd probably try a functional notation:
x = sec2ns(y)
It needs another something to distinguish integers from floating poi
Yo Hal!
On Tue, 14 Mar 2017 20:28:40 -0700
Hal Murray wrote:
> ../../include/timespecops.h:65:9: warning: 'NANOSECOND' macro
> redefined [-Wmacro-redefined]
>
> NetBSD:
> /usr/include/sys/timex.h:#define NANOSECOND 10L /*
> nanoseconds in one second */
>
> FreeBSD:
> /usr/include/s
../../include/timespecops.h:65:9: warning: 'NANOSECOND' macro redefined
[-Wmacro-redefined]
NetBSD:
/usr/include/sys/timex.h:#define NANOSECOND 10L /* nanoseconds in
one second */
FreeBSD:
/usr/include/sys/timex.h:#define NANOSECOND 10L /* nanoseconds in
one second */
10 matches
Mail list logo