0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0155: warnings from MinGW compiler; tests fail without +float

Problem:    Warnings from MinGW compiler. (John Marriott) Json test fails when
            building without +float feature.
Solution:   Init variables. Fix Json parsing. Skip a few tests that require
            the +float feature.
This commit is contained in:
Bram Moolenaar
2020-01-26 21:42:03 +01:00
parent 21b9e9773d
commit a5d5953d59
7 changed files with 22 additions and 4 deletions

View File

@@ -761,9 +761,9 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
break;
default:
if (VIM_ISDIGIT(*p) || (*p == '-' && VIM_ISDIGIT(p[1])))
if (VIM_ISDIGIT(*p) || (*p == '-'
&& (VIM_ISDIGIT(p[1]) || p[1] == NUL)))
{
#ifdef FEAT_FLOAT
char_u *sp = p;
if (*sp == '-')
@@ -782,6 +782,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
}
}
sp = skipdigits(sp);
#ifdef FEAT_FLOAT
if (*sp == '.' || *sp == 'e' || *sp == 'E')
{
if (cur_item == NULL)
@@ -889,7 +890,8 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
}
#endif
// check for truncated name
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
len = (int)(reader->js_end
- (reader->js_buf + reader->js_used));
if (
(len < 5 && STRNICMP((char *)p, "false", len) == 0)
#ifdef FEAT_FLOAT