aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-09-29 14:58:48 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-10-03 22:02:55 +0200
commite72b546354cd90bf0cd8ee6dd045538d713009ad (patch)
tree680a28f2e9ca4ab5a3221afbffff4d64cfdef842 /src/nvim/fileio.c
parent70ec8d60e0dc71c5ca06fdd83698c82b16ea474f (diff)
downloadrneovim-e72b546354cd90bf0cd8ee6dd045538d713009ad.tar.gz
rneovim-e72b546354cd90bf0cd8ee6dd045538d713009ad.tar.bz2
rneovim-e72b546354cd90bf0cd8ee6dd045538d713009ad.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/fileio.c')
-rw-r--r--src/nvim/fileio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index e94dfceaad..05b48966ff 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1753,7 +1753,7 @@ failed:
c = true;
}
- msg_add_lines(c, (long)linecnt, filesize);
+ msg_add_lines(c, linecnt, filesize);
XFREE_CLEAR(keep_msg);
p = NULL;
@@ -2156,7 +2156,7 @@ bool msg_add_fileformat(int eol_type)
}
/// Append line and character count to IObuff.
-void msg_add_lines(int insert_space, long lnum, off_T nchars)
+void msg_add_lines(int insert_space, linenr_T lnum, off_T nchars)
{
char *p = IObuff + strlen(IObuff);
@@ -2700,7 +2700,7 @@ int vim_rename(const char *from, const char *to)
}
// Rename() failed, try copying the file.
- long perm = os_getperm(from);
+ int perm = os_getperm(from);
// For systems that support ACL: get the ACL from the original file.
vim_acl_T acl = os_get_acl(from);
int fd_in = os_open(from, O_RDONLY, 0);
@@ -2710,7 +2710,7 @@ int vim_rename(const char *from, const char *to)
}
// Create the new file with same permissions as the original.
- int fd_out = os_open(to, O_CREAT|O_EXCL|O_WRONLY|O_NOFOLLOW, (int)perm);
+ int fd_out = os_open(to, O_CREAT|O_EXCL|O_WRONLY|O_NOFOLLOW, perm);
if (fd_out < 0) {
close(fd_in);
os_free_acl(acl);
@@ -2905,7 +2905,7 @@ int buf_check_timestamp(buf_T *buf)
&& (!(file_info_ok = os_fileinfo(buf->b_ffname, &file_info))
|| time_differs(&file_info, buf->b_mtime, buf->b_mtime_ns)
|| (int)file_info.stat.st_mode != buf->b_orig_mode)) {
- const long prev_b_mtime = buf->b_mtime;
+ const int prev_b_mtime = (int)buf->b_mtime;
retval = 1;