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/strings.c | |
parent | 1c3dd8ddcba63c1af5112e567215b3cec2de11d0 (diff) | |
download | vim-git-73e28dcc6125f616cf1f2d56443d22428a79e434.tar.gz |
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/strings.c')
-rw-r--r-- | src/strings.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/strings.c b/src/strings.c index 55ee69ab1..3befb86ea 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1895,7 +1895,6 @@ tv_str(typval_T *tvs, int *idxp, char_u **tofree) return s; } -# ifdef FEAT_FLOAT /* * Get float argument from "idxp" entry in "tvs". First entry is 1. */ @@ -1919,11 +1918,9 @@ tv_float(typval_T *tvs, int *idxp) } return f; } -# endif #endif -#ifdef FEAT_FLOAT /* * Return the representation of infinity for printf() function: * "-inf", "inf", "+inf", " inf", "-INF", "INF", "+INF" or " INF". @@ -1945,7 +1942,6 @@ infinity_str(int positive, idx += 4; return table[idx]; } -#endif /* * This code was included to provide a portable vsnprintf() and snprintf(). @@ -2079,13 +2075,9 @@ vim_vsnprintf_typval( char length_modifier = '\0'; // temporary buffer for simple numeric->string conversion -# if defined(FEAT_FLOAT) -# define TMP_LEN 350 // On my system 1e308 is the biggest number possible. +# define TMP_LEN 350 // On my system 1e308 is the biggest number possible. // That sounds reasonable to use as the maximum // printable. -# else -# define TMP_LEN 66 -# endif char tmp[TMP_LEN]; // string address in case of string argument @@ -2637,7 +2629,6 @@ vim_vsnprintf_typval( break; } -# ifdef FEAT_FLOAT case 'f': case 'F': case 'e': @@ -2653,9 +2644,9 @@ vim_vsnprintf_typval( int remove_trailing_zeroes = FALSE; f = -# if defined(FEAT_EVAL) +# if defined(FEAT_EVAL) tvs != NULL ? tv_float(tvs, &arg_idx) : -# endif +# endif va_arg(ap, double); abs_f = f < 0 ? -f : f; @@ -2672,11 +2663,11 @@ vim_vsnprintf_typval( } if ((fmt_spec == 'f' || fmt_spec == 'F') && -# ifdef VAX +# ifdef VAX abs_f > 1.0e38 -# else +# else abs_f > 1.0e307 -# endif +# endif ) { // Avoid a buffer overflow @@ -2801,7 +2792,6 @@ vim_vsnprintf_typval( str_arg = tmp; break; } -# endif default: // unrecognized conversion specifier, keep format string |