From 24f1f9d145562db4853f1a40ce22ce20274fa730 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 10 Jan 2020 14:12:18 -0800 Subject: sntp.c: fix 32-bit. The epoch was being defined as UL, which is fine for LP64, but too small on LP32 for what we're trying to do. toys/net/sntp.c:60:32: warning: left shift count >= width of type return ((tv.tv_sec+SEVENTIES)<<32)+(((long long)tv.tv_nsec)<<32)/1000000000; ^~ (Android doesn't use this, I'm just fixing this too while I fix the LP64isms I introduced in readelf...) --- toys/net/sntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/net') diff --git a/toys/net/sntp.c b/toys/net/sntp.c index ab6a6031..0cb0b7b4 100644 --- a/toys/net/sntp.c +++ b/toys/net/sntp.c @@ -39,7 +39,7 @@ GLOBALS( ) // Seconds from 1900 to 1970, including appropriate leap days -#define SEVENTIES 2208988800UL +#define SEVENTIES 2208988800ULL // Get time and return ntptime (saving timespec in pointer if not null) // NTP time is high 32 bits = seconds since 1970 (blame RFC 868), low 32 bits -- cgit v1.2.3