Skip to content

Commit

Permalink
time: fix macos job (building V with -cflags --Werror)
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Apr 5, 2021
1 parent 5f07c58 commit 7c664de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vlib/time/time_darwin.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
4 changes: 2 additions & 2 deletions vlib/time/time_nix.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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))
}

Expand Down

0 comments on commit 7c664de

Please sign in to comment.