diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-10-12 03:54:29 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-10-12 03:54:29 +0000 |
commit | b305bf616804db7176601bc2acd3495f0217e1c4 (patch) | |
tree | 872d15cd162204ec273199e7d0495bb163daa1b4 /src/libstddjb/ntp_from_tain.c | |
parent | 4fa9aa58a926275c2db31a4cc98122e7883c714a (diff) | |
download | skalibs-b305bf616804db7176601bc2acd3495f0217e1c4.tar.xz |
Add UINT??_BSWAP as constexp macro; rip off typedef uint?? bandaid
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/ntp_from_tain.c')
-rw-r--r-- | src/libstddjb/ntp_from_tain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstddjb/ntp_from_tain.c b/src/libstddjb/ntp_from_tain.c index 85a338a..5fc0a57 100644 --- a/src/libstddjb/ntp_from_tain.c +++ b/src/libstddjb/ntp_from_tain.c @@ -12,9 +12,9 @@ int ntp_from_tain (uint64_t *u, tain const *a) secs += NTP_OFFSET ; if (secs < TAI_MAGIC + 2147483648UL) goto ifail ; secs -= TAI_MAGIC ; - if (secs >= ((uint64)3 << 31)) goto ifail ; - secs &= (secs < ((uint64)1 << 32)) ? 0xFFFFFFFFUL : 0x7FFFFFFFUL ; - frac = ((uint64)a->nano << 32) / 1000000000UL ; + if (secs >= ((uint64_t)3 << 31)) goto ifail ; + secs &= (secs < ((uint64_t)1 << 32)) ? 0xFFFFFFFFUL : 0x7FFFFFFFUL ; + frac = ((uint64_t)a->nano << 32) / 1000000000UL ; *u = (secs << 32) + frac ; return 1 ; ifail: |