0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0491: no good reason to build without the float feature

Problem:    No good reason to build without the float feature.
Solution:   Remove configure check for float and "#ifdef FEAT_FLOAT".
This commit is contained in:
Bram Moolenaar
2022-09-17 21:08:33 +01:00
parent 1c3dd8ddcb
commit 73e28dcc61
74 changed files with 589 additions and 1152 deletions

View File

@@ -3872,12 +3872,10 @@ exec_instructions(ectx_T *ectx)
tv->v_type = VAR_SPECIAL;
tv->vval.v_number = iptr->isn_arg.number;
break;
#ifdef FEAT_FLOAT
case ISN_PUSHF:
tv->v_type = VAR_FLOAT;
tv->vval.v_float = iptr->isn_arg.fnumber;
break;
#endif
case ISN_PUSHBLOB:
blob_copy(iptr->isn_arg.blob, tv);
break;
@@ -4569,7 +4567,6 @@ exec_instructions(ectx_T *ectx)
// Computation with two float arguments
case ISN_OPFLOAT:
case ISN_COMPAREFLOAT:
#ifdef FEAT_FLOAT
{
typval_T *tv1 = STACK_TV_BOT(-2);
typval_T *tv2 = STACK_TV_BOT(-1);
@@ -4602,7 +4599,6 @@ exec_instructions(ectx_T *ectx)
else
tv1->vval.v_float = res;
}
#endif
break;
case ISN_COMPARELIST:
@@ -4744,9 +4740,7 @@ exec_instructions(ectx_T *ectx)
typval_T *tv1 = STACK_TV_BOT(-2);
typval_T *tv2 = STACK_TV_BOT(-1);
varnumber_T n1, n2;
#ifdef FEAT_FLOAT
float_T f1 = 0, f2 = 0;
#endif
int error = FALSE;
if (iptr->isn_arg.op.op_type == EXPR_ADD)
@@ -4767,42 +4761,33 @@ exec_instructions(ectx_T *ectx)
break;
}
}
#ifdef FEAT_FLOAT
if (tv1->v_type == VAR_FLOAT)
{
f1 = tv1->vval.v_float;
n1 = 0;
}
else
#endif
{
SOURCING_LNUM = iptr->isn_lnum;
n1 = tv_get_number_chk(tv1, &error);
if (error)
goto on_error;
#ifdef FEAT_FLOAT
if (tv2->v_type == VAR_FLOAT)
f1 = n1;
#endif
}
#ifdef FEAT_FLOAT
if (tv2->v_type == VAR_FLOAT)
{
f2 = tv2->vval.v_float;
n2 = 0;
}
else
#endif
{
n2 = tv_get_number_chk(tv2, &error);
if (error)
goto on_error;
#ifdef FEAT_FLOAT
if (tv1->v_type == VAR_FLOAT)
f2 = n2;
#endif
}
#ifdef FEAT_FLOAT
// if there is a float on either side the result is a float
if (tv1->v_type == VAR_FLOAT || tv2->v_type == VAR_FLOAT)
{
@@ -4823,7 +4808,6 @@ exec_instructions(ectx_T *ectx)
--ectx->ec_stack.ga_len;
}
else
#endif
{
int failed = FALSE;
@@ -5110,11 +5094,9 @@ exec_instructions(ectx_T *ectx)
case ISN_NEGATENR:
tv = STACK_TV_BOT(-1);
// CHECKTYPE should have checked the variable type
#ifdef FEAT_FLOAT
if (tv->v_type == VAR_FLOAT)
tv->vval.v_float = -tv->vval.v_float;
else
#endif
tv->vval.v_number = -tv->vval.v_number;
break;
@@ -6279,9 +6261,7 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
get_var_special_name(iptr->isn_arg.number));
break;
case ISN_PUSHF:
#ifdef FEAT_FLOAT
smsg("%s%4d PUSHF %g", pfx, current, iptr->isn_arg.fnumber);
#endif
break;
case ISN_PUSHS:
smsg("%s%4d PUSHS \"%s\"", pfx, current, iptr->isn_arg.string);
@@ -6896,11 +6876,7 @@ tv2bool(typval_T *tv)
case VAR_NUMBER:
return tv->vval.v_number != 0;
case VAR_FLOAT:
#ifdef FEAT_FLOAT
return tv->vval.v_float != 0.0;
#else
break;
#endif
case VAR_PARTIAL:
return tv->vval.v_partial != NULL;
case VAR_FUNC: