diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-17 21:08:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-17 21:08:33 +0100 |
commit | 73e28dcc6125f616cf1f2d56443d22428a79e434 (patch) | |
tree | bc26b3d1bb2e1675b7dae14b6c9cda1cd42c90d6 /src/ex_cmds.c | |
parent | 1c3dd8ddcba63c1af5112e567215b3cec2de11d0 (diff) |
patch 9.0.0491: no good reason to build without the float featurev9.0.0491
Problem: No good reason to build without the float feature.
Solution: Remove configure check for float and "#ifdef FEAT_FLOAT".
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index ebcd441c81..9fdbe955e0 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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 |