aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Hillegeer <nicolas@hillegeer.com>2014-07-03 14:20:16 +0200
committerJustin M. Keyes <justinkz@gmail.com>2014-07-11 13:10:59 -0400
commit94f488d1ca71dd1adffad1ffdf561a8b47db515d (patch)
treebf768b7f32da472047a707569e4e4ea262139184
parent958b3c5ffb6154b92fce7ecc0380e88e89893438 (diff)
downloadrneovim-94f488d1ca71dd1adffad1ffdf561a8b47db515d.tar.gz
rneovim-94f488d1ca71dd1adffad1ffdf561a8b47db515d.tar.bz2
rneovim-94f488d1ca71dd1adffad1ffdf561a8b47db515d.zip
c99: remove vim_round #909
C89 did not have round(), vim emulated it with vim_round. But since we're using C99 this is not a problem anymore.
-rw-r--r--src/nvim/eval.c11
-rw-r--r--src/nvim/ex_cmds2.c2
2 files changed, 2 insertions, 11 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 973088a806..88f4765f54 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -12177,15 +12177,6 @@ theend:
return retval;
}
-
-/*
- * round() is not in C90, use ceil() or floor() instead.
- */
-float_T vim_round(float_T f)
-{
- return f > 0 ? floor(f + 0.5) : ceil(f - 0.5);
-}
-
/*
* "round({float})" function
*/
@@ -12195,7 +12186,7 @@ static void f_round(typval_T *argvars, typval_T *rettv)
rettv->v_type = VAR_FLOAT;
if (get_float_arg(argvars, &f) == OK)
- rettv->vval.v_float = vim_round(f);
+ rettv->vval.v_float = round(f);
else
rettv->vval.v_float = 0.0;
}
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index e3024f6fb0..3158eafe65 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -848,7 +848,7 @@ void profile_divide(proftime_T *tm, int count, proftime_T *tm2)
double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
tm2->tv_sec = floor(usec / 1000000.0);
- tm2->tv_usec = vim_round(usec - (tm2->tv_sec * 1000000.0));
+ tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0));
}
}