summaryrefslogtreecommitdiff
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-01 18:17:26 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-01 18:17:26 +0200
commit22fcfad29276bd5f317faf516637dcd491b96a12 (patch)
tree5787f5e2134b066406fd0d222c4f2f0d18e28024 /src/charset.c
parent8767f52fbfd4f053ce00a978227c95f1d7d323fe (diff)
downloadvim-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/charset.c')
-rw-r--r--src/charset.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/charset.c b/src/charset.c
index e008399e1..9fcd88cb9 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1836,14 +1836,14 @@ vim_str2nr(
is bin */
int *len, /* return: detected length of number */
int what, /* what numbers to recognize */
- long *nptr, /* return: signed result */
- unsigned long *unptr, /* return: unsigned result */
+ varnumber_T *nptr, /* return: signed result */
+ uvarnumber_T *unptr, /* return: unsigned result */
int maxlen) /* max length of string to check */
{
char_u *ptr = start;
int pre = 0; /* default is decimal */
int negative = FALSE;
- unsigned long un = 0;
+ uvarnumber_T un = 0;
int n;
if (ptr[0] == '-')
@@ -1912,7 +1912,7 @@ vim_str2nr(
/* 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;
@@ -1925,7 +1925,7 @@ vim_str2nr(
n += 2; /* skip over "0x" */
while (vim_isxdigit(*ptr))
{
- un = 16 * un + (unsigned long)hex2nr(*ptr);
+ un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
++ptr;
if (n++ == maxlen)
break;
@@ -1936,7 +1936,7 @@ vim_str2nr(
/* decimal */
while (VIM_ISDIGIT(*ptr))
{
- un = 10 * un + (unsigned long)(*ptr - '0');
+ un = 10 * un + (uvarnumber_T)(*ptr - '0');
++ptr;
if (n++ == maxlen)
break;
@@ -1950,9 +1950,9 @@ vim_str2nr(
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;
}
if (unptr != NULL)
*unptr = un;