diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-01 18:17:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-01 18:17:26 +0200 |
commit | 22fcfad29276bd5f317faf516637dcd491b96a12 (patch) | |
tree | 5787f5e2134b066406fd0d222c4f2f0d18e28024 /src/json.c | |
parent | 8767f52fbfd4f053ce00a978227c95f1d7d323fe (diff) | |
download | vim-git-22fcfad29276bd5f317faf516637dcd491b96a12.tar.gz |
patch 7.4.1976v7.4.1976
Problem: Number variables are not 64 bits while they could be.
Solution: Add the num64 feature. (Ken Takata)
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/json.c b/src/json.c index aa168ec11..89c2fd254 100644 --- a/src/json.c +++ b/src/json.c @@ -201,8 +201,8 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options) break; case VAR_NUMBER: - vim_snprintf((char *)numbuf, NUMBUFLEN, "%ld", - (long)val->vval.v_number); + vim_snprintf((char *)numbuf, NUMBUFLEN, "%lld", + val->vval.v_number); ga_concat(gap, numbuf); break; @@ -538,7 +538,7 @@ json_decode_string(js_read_T *reader, typval_T *res) int len; char_u *p; int c; - long nr; + varnumber_T nr; if (res != NULL) ga_init2(&ga, 1, 200); @@ -600,7 +600,7 @@ json_decode_string(js_read_T *reader, typval_T *res) && (int)(reader->js_end - p) >= 6 && *p == '\\' && *(p+1) == 'u') { - long nr2 = 0; + varnumber_T nr2 = 0; /* decode surrogate pair: \ud812\u3456 */ len = 0; @@ -620,7 +620,7 @@ json_decode_string(js_read_T *reader, typval_T *res) buf[utf_char2bytes((int)nr, buf)] = NUL; ga_concat(&ga, buf); #else - ga_append(&ga, nr); + ga_append(&ga, (int)nr); #endif } break; @@ -766,7 +766,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options) else #endif { - long nr; + varnumber_T nr; vim_str2nr(reader->js_buf + reader->js_used, NULL, &len, 0, /* what */ |