0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -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

@@ -14,9 +14,7 @@
#include "vim.h"
#include "version.h"
#ifdef FEAT_FLOAT
# include <float.h>
#endif
#include <float.h>
static int linelen(int *has_tab);
static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
@@ -275,9 +273,7 @@ static int sort_lc; // sort using locale
static int sort_ic; // ignore case
static int sort_nr; // sort on number
static int sort_rx; // sort on regex instead of skipping it
#ifdef FEAT_FLOAT
static int sort_flt; // sort on floating number
#endif
static int sort_abort; // flag to indicate if sorting has been interrupted
@@ -296,9 +292,7 @@ typedef struct
varnumber_T value; // value if sorting by integer
int is_number; // TRUE when line contains a number
} num;
#ifdef FEAT_FLOAT
float_T value_flt; // value if sorting by float
#endif
} st_u;
} sorti_T;
@@ -334,11 +328,9 @@ sort_compare(const void *s1, const void *s2)
result = l1.st_u.num.value == l2.st_u.num.value ? 0
: l1.st_u.num.value > l2.st_u.num.value ? 1 : -1;
}
#ifdef FEAT_FLOAT
else if (sort_flt)
result = l1.st_u.value_flt == l2.st_u.value_flt ? 0
: l1.st_u.value_flt > l2.st_u.value_flt ? 1 : -1;
#endif
else
{
// We need to copy one line into "sortbuf1", because there is no
@@ -399,9 +391,7 @@ ex_sort(exarg_T *eap)
goto sortend;
sort_abort = sort_ic = sort_lc = sort_rx = sort_nr = 0;
#ifdef FEAT_FLOAT
sort_flt = 0;
#endif
for (p = eap->arg; *p != NUL; ++p)
{
@@ -418,13 +408,11 @@ ex_sort(exarg_T *eap)
sort_nr = 1;
++format_found;
}
#ifdef FEAT_FLOAT
else if (*p == 'f')
{
sort_flt = 1;
++format_found;
}
#endif
else if (*p == 'b')
{
sort_what = STR2NR_BIN + STR2NR_FORCE;
@@ -521,11 +509,7 @@ ex_sort(exarg_T *eap)
if (regmatch.regprog != NULL)
end_col = 0;
if (sort_nr
#ifdef FEAT_FLOAT
|| sort_flt
#endif
)
if (sort_nr || sort_flt)
{
// Make sure vim_str2nr doesn't read any digits past the end
// of the match, by temporarily terminating the string there
@@ -558,7 +542,6 @@ ex_sort(exarg_T *eap)
NULL, 0, FALSE);
}
}
#ifdef FEAT_FLOAT
else
{
s = skipwhite(p);
@@ -572,7 +555,6 @@ ex_sort(exarg_T *eap)
nrs[lnum - eap->line1].st_u.value_flt =
strtod((char *)s, NULL);
}
#endif
*s2 = c;
}
else