diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-07-09 12:08:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-09 12:08:54 +0200 |
commit | 06af88cd72eaf429190678dcd6d500122e35f349 (patch) | |
tree | 827c969ae10a15ff59bbd6f43dc23a7a74520378 /src/nvim/os/time.c | |
parent | 652be3cb0040d37d295ca9389d72dc8dce0b56fc (diff) | |
download | rneovim-06af88cd72eaf429190678dcd6d500122e35f349.tar.gz rneovim-06af88cd72eaf429190678dcd6d500122e35f349.tar.bz2 rneovim-06af88cd72eaf429190678dcd6d500122e35f349.zip |
viml/reltime(): allow negative result #10453
- define proftime_T as signed integer
- profile_sub(): allow negative result
closes #10452
Diffstat (limited to 'src/nvim/os/time.c')
-rw-r--r-- | src/nvim/os/time.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index 18239c5566..1094fbc946 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -39,7 +39,7 @@ void time_init(void) /// @see gettimeofday(2) /// /// @return Current time in microseconds. -uint64_t os_utime(void) +int64_t os_utime(void) FUNC_ATTR_WARN_UNUSED_RESULT { uv_timeval64_t tm; @@ -47,8 +47,8 @@ uint64_t os_utime(void) if (e != 0 || tm.tv_sec < 0 || tm.tv_usec < 0) { return 0; } - uint64_t rv = (uint64_t)tm.tv_sec * 1000 * 1000; // s => μs - STRICT_ADD(rv, tm.tv_usec, &rv, uint64_t); + int64_t rv = tm.tv_sec * 1000 * 1000; // s => μs + STRICT_ADD(rv, tm.tv_usec, &rv, int64_t); return rv; } |