mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
eval: Move get_tv_number[_chk] to eval/typval.c
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user