comparison src/json.c @ 19193:9f98957582d6 v8.2.0155

patch 8.2.0155: warnings from MinGW compiler; tests fail without +float Commit: https://github.com/vim/vim/commit/a5d5953d59730d9bf9c00a727c4aeb56f6ffc944 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 26 21:42:03 2020 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Jan 2020 21:45:03 +0100
parents 94eda51ba9ba
children e7b4fff348dd
comparison
equal deleted inserted replaced
19192:68049eeb2e00 19193:9f98957582d6
759 } 759 }
760 retval = OK; 760 retval = OK;
761 break; 761 break;
762 762
763 default: 763 default:
764 if (VIM_ISDIGIT(*p) || (*p == '-' && VIM_ISDIGIT(p[1]))) 764 if (VIM_ISDIGIT(*p) || (*p == '-'
765 { 765 && (VIM_ISDIGIT(p[1]) || p[1] == NUL)))
766 #ifdef FEAT_FLOAT 766 {
767 char_u *sp = p; 767 char_u *sp = p;
768 768
769 if (*sp == '-') 769 if (*sp == '-')
770 { 770 {
771 ++sp; 771 ++sp;
780 retval = FAIL; 780 retval = FAIL;
781 break; 781 break;
782 } 782 }
783 } 783 }
784 sp = skipdigits(sp); 784 sp = skipdigits(sp);
785 #ifdef FEAT_FLOAT
785 if (*sp == '.' || *sp == 'e' || *sp == 'E') 786 if (*sp == '.' || *sp == 'e' || *sp == 'E')
786 { 787 {
787 if (cur_item == NULL) 788 if (cur_item == NULL)
788 { 789 {
789 float_T f; 790 float_T f;
887 retval = OK; 888 retval = OK;
888 break; 889 break;
889 } 890 }
890 #endif 891 #endif
891 // check for truncated name 892 // check for truncated name
892 len = (int)(reader->js_end - (reader->js_buf + reader->js_used)); 893 len = (int)(reader->js_end
894 - (reader->js_buf + reader->js_used));
893 if ( 895 if (
894 (len < 5 && STRNICMP((char *)p, "false", len) == 0) 896 (len < 5 && STRNICMP((char *)p, "false", len) == 0)
895 #ifdef FEAT_FLOAT 897 #ifdef FEAT_FLOAT
896 || (len < 9 && STRNICMP((char *)p, "-Infinity", len) == 0) 898 || (len < 9 && STRNICMP((char *)p, "-Infinity", len) == 0)
897 || (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0) 899 || (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)