diff options
author | James McCoy <jamessan@jamessan.com> | 2016-11-16 11:09:04 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-06-04 22:12:13 -0400 |
commit | 81be7358be00d3d75453659bcdc7efc69207ca8e (patch) | |
tree | 9dc19a6e3bda44c63ab678292d498d1b2f504c81 /src/nvim/charset.c | |
parent | 953f26bace041f481e79b67b64401aa07259055c (diff) | |
download | rneovim-81be7358be00d3d75453659bcdc7efc69207ca8e.tar.gz rneovim-81be7358be00d3d75453659bcdc7efc69207ca8e.tar.bz2 rneovim-81be7358be00d3d75453659bcdc7efc69207ca8e.zip |
vim-patch:7.4.1976
Problem: Number variables are not 64 bits while they could be.
Solution: Add the num64 feature. (Ken Takata)
https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r-- | src/nvim/charset.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 5a0590d075..bf4dc25efd 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1621,13 +1621,13 @@ bool vim_isblankline(char_u *lbuf) /// @param unptr Returns the unsigned result. /// @param maxlen Max length of string to check. void vim_str2nr(const char_u *const start, int *const prep, int *const len, - const int what, long *const nptr, unsigned long *const unptr, - const int maxlen) + const int what, varnumber_T *const nptr, + uvarnumber_T *const unptr, const int maxlen) { const char_u *ptr = start; int pre = 0; // default is decimal bool negative = false; - unsigned long un = 0; + uvarnumber_T un = 0; if (ptr[0] == '-') { negative = true; @@ -1683,7 +1683,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, n += 2; // skip over "0b" } while ('0' <= *ptr && *ptr <= '1') { - un = 2 * un + (unsigned long)(*ptr - '0'); + un = 2 * un + (uvarnumber_T)(*ptr - '0'); ptr++; if (n++ == maxlen) { break; @@ -1692,7 +1692,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, } else if ((pre == '0') || what == STR2NR_OCT + STR2NR_FORCE) { // octal while ('0' <= *ptr && *ptr <= '7') { - un = 8 * un + (unsigned long)(*ptr - '0'); + un = 8 * un + (uvarnumber_T)(*ptr - '0'); ptr++; if (n++ == maxlen) { break; @@ -1705,7 +1705,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, n += 2; // skip over "0x" } while (ascii_isxdigit(*ptr)) { - un = 16 * un + (unsigned long)hex2nr(*ptr); + un = 16 * un + (uvarnumber_T)hex2nr(*ptr); ptr++; if (n++ == maxlen) { break; @@ -1733,9 +1733,9 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, if (nptr != NULL) { if (negative) { // account for leading '-' for decimal numbers - *nptr = -(long)un; + *nptr = -(varnumber_T)un; } else { - *nptr = (long)un; + *nptr = (varnumber_T)un; } } |