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.
This commit is contained in:
dundargoc
2023-09-29 14:58:48 +02:00
committed by dundargoc
parent c513cbf361
commit acc646ad8f
57 changed files with 362 additions and 367 deletions

View File

@@ -106,9 +106,9 @@ typedef struct {
// used for recording hunks from xdiff
typedef struct {
linenr_T lnum_orig;
long count_orig;
int count_orig;
linenr_T lnum_new;
long count_new;
int count_new;
} diffhunk_T;
// two diff inputs and one result
@@ -771,7 +771,7 @@ static int diff_write_buffer(buf_T *buf, mmfile_t *m, linenr_T start, linenr_T e
return FAIL;
}
m->ptr = ptr;
m->size = (long)len;
m->size = (int)len;
len = 0;
for (linenr_T lnum = start; lnum <= end; lnum++) {
@@ -2571,7 +2571,7 @@ int diffopt_changed(void)
// recompute the scroll binding with the new option value, may
// remove or add filler lines
check_scrollbind((linenr_T)0, 0L);
check_scrollbind(0, 0);
return OK;
}
@@ -3217,7 +3217,7 @@ bool diff_mode_buf(buf_T *buf)
/// @param count
///
/// @return FAIL if there isn't such a diff block.
int diff_move_to(int dir, long count)
int diff_move_to(int dir, int count)
{
linenr_T lnum = curwin->w_cursor.lnum;
int idx = diff_buf_idx(curbuf);