viml/profile: revert proftime_T to unsigned type #10521

- reltimestr(): Produce negative value by comparing the unsigned
  proftime_T value to INT64_MAX.

https://github.com/neovim/neovim/issues/10452#issuecomment-511155132
1. The interfaces of nearly all platforms return uint64_t. INT64_MAX is
   only half of that.
2. Low-level interfaces like this typically define that there is no
   fixed starting point. The only guarantees are that it's (a)
   monotonically increasing at a rate that (b) matches real time.

ref 06af88cd72
fix #10452
This commit is contained in:
Justin M. Keyes
2019-07-16 20:10:08 +02:00
committed by GitHub
parent f31f2d0b22
commit bab24a88ab
4 changed files with 40 additions and 34 deletions

View File

@@ -13840,7 +13840,7 @@ static void f_reltimestr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
if (list2proftime(&argvars[0], &tm) == OK) {
rettv->vval.v_string = (char_u *) xstrdup(profile_msg(tm));
rettv->vval.v_string = (char_u *)xstrdup(profile_msg(tm));
}
}