diff options
author | dundargoc <gocdundar@gmail.com> | 2023-09-29 14:58:48 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-11-05 20:19:06 +0100 |
commit | acc646ad8fc3ef11fcc63b69f3d8484e4a91accd (patch) | |
tree | 613753f19fe6f6fa45884750eb176c1517269ec2 /src/nvim/window.c | |
parent | c513cbf361000e6f09cd5b71b718e9de3f88904d (diff) | |
download | rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.tar.gz rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.tar.bz2 rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.zip |
refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 60fe0ade8e..eee500f695 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4079,7 +4079,7 @@ static int win_alloc_firstwin(win_T *oldwin) if (oldwin == NULL) { // Very first window, need to create an empty buffer for it and // initialize from scratch. - curbuf = buflist_new(NULL, NULL, 1L, BLN_LISTED); + curbuf = buflist_new(NULL, NULL, 1, BLN_LISTED); if (curbuf == NULL) { return FAIL; } @@ -6458,7 +6458,7 @@ void win_drag_vsep_line(win_T *dragwin, int offset) redraw_all_later(UPD_NOT_VALID); } -#define FRACTION_MULT 16384L +#define FRACTION_MULT 16384 // Set wp->w_fraction for the current w_wrow and w_height. // Has no effect when the window is less than two lines. @@ -6468,7 +6468,7 @@ void set_fraction(win_T *wp) // When cursor is in the first line the percentage is computed as if // it's halfway that line. Thus with two lines it is 25%, with three // lines 17%, etc. Similarly for the last line: 75%, 83%, etc. - wp->w_fraction = (int)(wp->w_wrow * FRACTION_MULT + FRACTION_MULT / 2) / wp->w_height_inner; + wp->w_fraction = (wp->w_wrow * FRACTION_MULT + FRACTION_MULT / 2) / wp->w_height_inner; } } @@ -6619,7 +6619,7 @@ void scroll_to_fraction(win_T *wp, int prev_height) if (lnum < 1) { // can happen when starting up lnum = 1; } - wp->w_wrow = (int)(wp->w_fraction * height - 1L) / FRACTION_MULT; + wp->w_wrow = (wp->w_fraction * height - 1) / FRACTION_MULT; int line_size = plines_win_col(wp, lnum, wp->w_cursor.col) - 1; int sline = wp->w_wrow - line_size; |