To: vim_dev@googlegroups.com Subject: Patch 8.2.0155 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0155 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. Files: src/vim9script.c, src/vim9compile.c, src/vim9execute.c, src/if_py_both.h, src/json.c, src/testdir/test_method.vim *** ../vim-8.2.0154/src/vim9script.c 2020-01-26 19:26:42.798068312 +0100 --- src/vim9script.c 2020-01-26 20:52:54.982310391 +0100 *************** *** 323,328 **** --- 323,329 ---- *arg = cc; return NULL; } + ufunc = NULL; } else { *************** *** 355,360 **** --- 356,362 ---- *arg = cc; return NULL; } + sv = NULL; } imported = new_imported(gap != NULL ? gap *** ../vim-8.2.0154/src/vim9compile.c 2020-01-26 19:26:42.798068312 +0100 --- src/vim9compile.c 2020-01-26 20:57:44.757394498 +0100 *************** *** 1217,1224 **** --- 1217,1229 ---- case 'f': if (len == 5 && STRNCMP(*arg, "float", len) == 0) { + #ifdef FEAT_FLOAT *arg += len; return &t_float; + #else + emsg(_("E1055: This Vim is not compiled with float support")); + return &t_any; + #endif } if (len == 4 && STRNCMP(*arg, "func", len) == 0) { *** ../vim-8.2.0154/src/vim9execute.c 2020-01-26 19:26:42.798068312 +0100 --- src/vim9execute.c 2020-01-26 20:58:38.453215608 +0100 *************** *** 1095,1100 **** --- 1095,1101 ---- // 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); *************** *** 1127,1132 **** --- 1128,1134 ---- else tv1->vval.v_float = res; } + #endif break; case ISN_COMPARELIST: *************** *** 1618,1624 **** --- 1620,1628 ---- get_var_special_name(iptr->isn_arg.number)); break; case ISN_PUSHF: + #ifdef FEAT_FLOAT smsg("%4d PUSHF %g", current, iptr->isn_arg.fnumber); + #endif break; case ISN_PUSHS: smsg("%4d PUSHS \"%s\"", current, iptr->isn_arg.string); *** ../vim-8.2.0154/src/if_py_both.h 2020-01-26 15:52:33.019833259 +0100 --- src/if_py_both.h 2020-01-26 20:59:51.880967537 +0100 *************** *** 6357,6364 **** ? "" : (char *)tv->vval.v_string); case VAR_NUMBER: return PyLong_FromLong((long) tv->vval.v_number); - #ifdef FEAT_FLOAT case VAR_FLOAT: return PyFloat_FromDouble((double) tv->vval.v_float); #endif case VAR_LIST: --- 6357,6364 ---- ? "" : (char *)tv->vval.v_string); case VAR_NUMBER: return PyLong_FromLong((long) tv->vval.v_number); case VAR_FLOAT: + #ifdef FEAT_FLOAT return PyFloat_FromDouble((double) tv->vval.v_float); #endif case VAR_LIST: *** ../vim-8.2.0154/src/json.c 2020-01-26 15:52:33.019833259 +0100 --- src/json.c 2020-01-26 21:17:22.233184536 +0100 *************** *** 761,769 **** break; default: ! if (VIM_ISDIGIT(*p) || (*p == '-' && VIM_ISDIGIT(p[1]))) { - #ifdef FEAT_FLOAT char_u *sp = p; if (*sp == '-') --- 761,769 ---- break; default: ! if (VIM_ISDIGIT(*p) || (*p == '-' ! && (VIM_ISDIGIT(p[1]) || p[1] == NUL))) { char_u *sp = p; if (*sp == '-') *************** *** 782,787 **** --- 782,788 ---- } } sp = skipdigits(sp); + #ifdef FEAT_FLOAT if (*sp == '.' || *sp == 'e' || *sp == 'E') { if (cur_item == NULL) *************** *** 889,895 **** } #endif // check for truncated name ! len = (int)(reader->js_end - (reader->js_buf + reader->js_used)); if ( (len < 5 && STRNICMP((char *)p, "false", len) == 0) #ifdef FEAT_FLOAT --- 890,897 ---- } #endif // check for truncated name ! len = (int)(reader->js_end ! - (reader->js_buf + reader->js_used)); if ( (len < 5 && STRNICMP((char *)p, "false", len) == 0) #ifdef FEAT_FLOAT *** ../vim-8.2.0154/src/testdir/test_method.vim 2019-10-01 16:43:06.000000000 +0200 --- src/testdir/test_method.vim 2020-01-26 21:31:55.216775828 +0100 *************** *** 1,5 **** --- 1,7 ---- " Tests for ->method() + source check.vim + func Test_list_method() let l = [1, 2, 3] call assert_equal([1, 2, 3, 4], [1, 2, 3]->add(4)) *************** *** 118,123 **** --- 120,126 ---- endfunc func Test_method_float() + CheckFeature float eval 1.234->string()->assert_equal('1.234') eval -1.234->string()->assert_equal('-1.234') endfunc *** ../vim-8.2.0154/src/version.c 2020-01-26 19:26:42.798068312 +0100 --- src/version.c 2020-01-26 21:35:01.719697986 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 155, /**/ -- For society, it's probably a good thing that engineers value function over appearance. For example, you wouldn't want engineers to build nuclear power plants that only _look_ like they would keep all the radiation inside. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///