eval: Move get_tv_number[_chk] to eval/typval.c

This commit is contained in:
ZyX
2016-08-28 08:55:58 +03:00
parent 1b3e13da5b
commit 233b0c93bb
5 changed files with 446 additions and 373 deletions

View File

@@ -50,7 +50,7 @@ int eexe_mod_op(typval_T *const tv1, const typval_T *const tv2,
}
if (*op == '+' || *op == '-') {
// nr += nr or nr -= nr
varnumber_T n = get_tv_number(tv1);
varnumber_T n = tv_get_number(tv1);
if (tv2->v_type == VAR_FLOAT) {
float_T f = n;
@@ -64,9 +64,9 @@ int eexe_mod_op(typval_T *const tv1, const typval_T *const tv2,
tv1->vval.v_float = f;
} else {
if (*op == '+') {
n += get_tv_number(tv2);
n += tv_get_number(tv2);
} else {
n -= get_tv_number(tv2);
n -= tv_get_number(tv2);
}
tv_clear(tv1);
tv1->v_type = VAR_NUMBER;
@@ -96,7 +96,7 @@ int eexe_mod_op(typval_T *const tv1, const typval_T *const tv2,
}
const float_T f = (tv2->v_type == VAR_FLOAT
? tv2->vval.v_float
: get_tv_number(tv2));
: tv_get_number(tv2));
if (*op == '+') {
tv1->vval.v_float += f;
} else {