char_u *p;
char_u *l;
char_u *digits;
- long long n;
+ vimlong_T n;
int divider;
int fraction = 0;
int sw;
{
n *= sw;
if (divider)
- n += ((long long)sw * fraction + divider / 2) / divider;
+ n += ((vimlong_T)sw * fraction + divider / 2) / divider;
}
++p;
}
// Return something that fits into an int.
int
-trim_to_int(long long x)
+trim_to_int(vimlong_T x)
{
return x > INT_MAX ? INT_MAX : x < INT_MIN ? INT_MIN : x;
}
int amount,
int call_changed_bytes) // call changed_bytes()
{
- long long count;
+ vimlong_T count;
int i, j;
int sw_val = trim_to_int(get_sw_value_indent(curbuf));
- count = (long long)get_indent(); // get current indent
+ count = get_indent(); // get current indent
if (round) // round off indent
{
}
else
i += amount;
- count = (long long)i * (long long)sw_val;
+ count = (vimlong_T)i * (vimlong_T)sw_val;
}
else // original vi indent
{
if (left)
{
- count -= (long long)sw_val * (long long)amount;
+ count -= (vimlong_T)sw_val * (vimlong_T)amount;
if (count < 0)
count = 0;
}
else
- count += (long long)sw_val * (long long)amount;
+ count += (vimlong_T)sw_val * (vimlong_T)amount;
}
// Set new indent
void may_trigger_modechanged(void);
int vim_append_digit_int(int *value, int digit);
int vim_append_digit_long(long *value, int digit);
-int trim_to_int(long long x);
+int trim_to_int(vimlong_T x);
/* vim: set ft=c : */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2138,
/**/
2137,
/**/
*/
typedef unsigned int u8char_T; // int is 32 bits or more
+/*
+ * The vimlong_T has sizeof(vimlong_T) >= 2 * sizeof(int).
+ * One use is simple handling of overflow in int calculations.
+ */
+typedef long long vimlong_T;
+
#ifndef UNIX // For Unix this is included in os_unix.h
# include <stdio.h>
# include <ctype.h>