From 990f99658bb060ac2ac4e1cff2966eab1e96f9d9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 16 Jul 2019 02:14:59 +0200 Subject: viml/profile: cast os_hrtime() result Temporary measure to avoid QuickBuild CI failure: 8:42:54,702 INFO - Executing post-execute action... 18:42:54,702 ERROR - Step 'master>buildall>build-node?testNode=freebsd-64>build-and-run-tests>build-and-run-tests-parameterized?buildType=Release>configure-neovim-and-build-nvim' is failed: Failed to run command: mkdir -p build/Release && cd build/Release && cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DMIN_LOG_LEVEL=3 -DCMAKE_BUILD_TYPE=Release -DTRAVIS_CI_BUILD=ON ../.. && gmake VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs Command return code: 2 Command error output: /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/profile.c:70:27: error: implicit conversion changes signedness: 'proftime_T' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion] STRICT_ADD(os_hrtime(), nsec, &rv, int64_t); ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/assert.h:150:26: note: expanded from macro 'STRICT_ADD' do { *(c) = (t)((a) + (b)); } while (0) ^ 1 error generated. gma... --- src/nvim/profile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/profile.c b/src/nvim/profile.c index e486095fe7..52e03c895e 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -66,8 +66,10 @@ proftime_T profile_setlimit(int64_t msec) FUNC_ATTR_WARN_UNUSED_RESULT } assert(msec <= (INT64_MAX / 1000000LL) - 1); proftime_T nsec = msec * 1000000LL; + uint64_t now = os_hrtime(); + assert(now <= INT64_MAX); int64_t rv; - STRICT_ADD(os_hrtime(), nsec, &rv, int64_t); + STRICT_ADD((proftime_T)now, nsec, &rv, int64_t); return rv; } -- cgit