0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.2138: Overflow logic requires long long

Problem:  Overflow logic requires long long
Solution: Define vimlong_T data type to make life easier
          for porters

closes: #13598

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Ernie Rael
2023-11-30 18:20:00 +01:00
committed by Christian Brabandt
parent 72314bb85f
commit fda700cb04
6 changed files with 17 additions and 9 deletions

View File

@@ -229,11 +229,11 @@ shift_line(
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
{
@@ -249,18 +249,18 @@ shift_line(
}
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