mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the MAXLNUM constant which sets the maximum allowable number of lines to 2^32-1. This discrepancy may lead to hard to detect bugs, for example https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a fix maximum size of 2^32-1 will prevent this type of errors in the future. Also change the variables `amount` and `amount_after` to be linenr_T since they're referring to "the line number difference" between two texts.
This commit is contained in:
@@ -727,7 +727,7 @@ static void sign_list_placed(buf_T *rbuf, char_u *sign_group)
|
||||
}
|
||||
|
||||
/// Adjust a placed sign for inserted/deleted lines.
|
||||
void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after)
|
||||
void sign_mark_adjust(linenr_T line1, linenr_T line2, linenr_T amount, linenr_T amount_after)
|
||||
{
|
||||
sign_entry_T *sign; // a sign in a b_signlist
|
||||
sign_entry_T *next; // the next sign in a b_signlist
|
||||
|
Reference in New Issue
Block a user