From 7c664de8aadaec0fd4ea5e53e20dbaff8a85f328 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 5 Apr 2021 22:32:33 +0300 Subject: [PATCH] time: fix macos job (building V with -cflags --Werror) --- vlib/time/time_darwin.c.v | 2 +- vlib/time/time_nix.c.v | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/time/time_darwin.c.v b/vlib/time/time_darwin.c.v index 7adf87da5b..3a173a9d35 100644 --- a/vlib/time/time_darwin.c.v +++ b/vlib/time/time_darwin.c.v @@ -68,7 +68,7 @@ fn darwin_now() Time { C.gettimeofday(&tv, 0) loc_tm := C.tm{} asec := voidptr(&tv.tv_sec) - C.localtime_r(&time_t(asec), &loc_tm) + C.localtime_r(asec, &loc_tm) return convert_ctime(loc_tm, int(tv.tv_usec)) } diff --git a/vlib/time/time_nix.c.v b/vlib/time/time_nix.c.v index 2e274b9726..cf9f80dde3 100644 --- a/vlib/time/time_nix.c.v +++ b/vlib/time/time_nix.c.v @@ -30,7 +30,7 @@ fn make_unix_time(t C.tm) int { // local returns t with the location set to local time. pub fn (t Time) local() Time { loc_tm := C.tm{} - C.localtime_r(&time_t(voidptr(&t.unix)), &loc_tm) + C.localtime_r(voidptr(&t.unix), &loc_tm) return convert_ctime(loc_tm, t.microsecond) } @@ -77,7 +77,7 @@ fn linux_now() Time { mut ts := C.timespec{} C.clock_gettime(C.CLOCK_REALTIME, &ts) loc_tm := C.tm{} - C.localtime_r(&time_t(voidptr(&ts.tv_sec)), &loc_tm) + C.localtime_r(voidptr(&ts.tv_sec), &loc_tm) return convert_ctime(loc_tm, int(ts.tv_nsec / 1000)) }