mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
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...
This commit is contained in:
@@ -66,8 +66,10 @@ proftime_T profile_setlimit(int64_t msec) FUNC_ATTR_WARN_UNUSED_RESULT
|
|||||||
}
|
}
|
||||||
assert(msec <= (INT64_MAX / 1000000LL) - 1);
|
assert(msec <= (INT64_MAX / 1000000LL) - 1);
|
||||||
proftime_T nsec = msec * 1000000LL;
|
proftime_T nsec = msec * 1000000LL;
|
||||||
|
uint64_t now = os_hrtime();
|
||||||
|
assert(now <= INT64_MAX);
|
||||||
int64_t rv;
|
int64_t rv;
|
||||||
STRICT_ADD(os_hrtime(), nsec, &rv, int64_t);
|
STRICT_ADD((proftime_T)now, nsec, &rv, int64_t);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user