From: Joseph Sutton Date: Sun, 10 Dec 2023 23:55:05 +0000 (+1300) Subject: lib:util: Use portable integer constants X-Git-Tag: talloc-2.4.2~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7df67d0ae380a4a67038d88ffdc0a5675d66c5d;p=thirdparty%2Fsamba.git lib:util: Use portable integer constants Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/lib/util/time.c b/lib/util/time.c index bfeb6f4a63c..31bb0a7aad9 100644 --- a/lib/util/time.c +++ b/lib/util/time.c @@ -136,7 +136,7 @@ _PUBLIC_ void unix_to_nt_time(NTTIME *nt, time_t t) uint64_t t2; if (t == (time_t)-1) { - *nt = (NTTIME)-1LL; + *nt = UINT64_MAX; return; } @@ -897,7 +897,7 @@ struct timespec nt_time_to_unix_timespec(NTTIME nt) { struct timespec ret; - if (nt == 0 || nt == (int64_t)-1) { + if (nt == 0 || nt == UINT64_MAX) { ret.tv_sec = 0; ret.tv_nsec = 0; return ret; @@ -1049,7 +1049,7 @@ _PUBLIC_ NTTIME unix_timespec_to_nt_time(struct timespec ts) return 0x7fffffffffffffffLL; } if (ts.tv_sec == (time_t)-1) { - return (uint64_t)-1; + return UINT64_MAX; } d = ts.tv_sec;