mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
fileinfo: change returntype of os_fileinfo_size
off_t -> uint64_t
This commit is contained in:
@@ -512,7 +512,7 @@ struct file_buffer {
|
|||||||
|
|
||||||
long b_mtime; /* last change time of original file */
|
long b_mtime; /* last change time of original file */
|
||||||
long b_mtime_read; /* last change time when reading */
|
long b_mtime_read; /* last change time when reading */
|
||||||
off_t b_orig_size; /* size of original file in bytes */
|
uint64_t b_orig_size; /* size of original file in bytes */
|
||||||
int b_orig_mode; /* mode of original file */
|
int b_orig_mode; /* mode of original file */
|
||||||
|
|
||||||
pos_T b_namedm[NMARKS]; /* current named marks (mark.c) */
|
pos_T b_namedm[NMARKS]; /* current named marks (mark.c) */
|
||||||
|
@@ -949,7 +949,7 @@ void ex_diffpatch(exarg_T *eap)
|
|||||||
// Only continue if the output file was created.
|
// Only continue if the output file was created.
|
||||||
FileInfo file_info;
|
FileInfo file_info;
|
||||||
bool info_ok = os_fileinfo((char *)tmp_new, &file_info);
|
bool info_ok = os_fileinfo((char *)tmp_new, &file_info);
|
||||||
off_t filesize = os_fileinfo_size(&file_info);
|
uint64_t filesize = os_fileinfo_size(&file_info);
|
||||||
if (!info_ok || filesize == 0) {
|
if (!info_ok || filesize == 0) {
|
||||||
EMSG(_("E816: Cannot read patch output"));
|
EMSG(_("E816: Cannot read patch output"));
|
||||||
} else {
|
} else {
|
||||||
|
@@ -9167,14 +9167,14 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv)
|
|||||||
|
|
||||||
FileInfo file_info;
|
FileInfo file_info;
|
||||||
if (os_fileinfo(fname, &file_info)) {
|
if (os_fileinfo(fname, &file_info)) {
|
||||||
off_t filesize = os_fileinfo_size(&file_info);
|
uint64_t filesize = os_fileinfo_size(&file_info);
|
||||||
if (os_isdir((char_u *)fname))
|
if (os_isdir((char_u *)fname))
|
||||||
rettv->vval.v_number = 0;
|
rettv->vval.v_number = 0;
|
||||||
else {
|
else {
|
||||||
rettv->vval.v_number = (varnumber_T)filesize;
|
rettv->vval.v_number = (varnumber_T)filesize;
|
||||||
|
|
||||||
/* non-perfect check for overflow */
|
/* non-perfect check for overflow */
|
||||||
if ((off_t)rettv->vval.v_number != filesize) {
|
if ((uint64_t)rettv->vval.v_number != filesize) {
|
||||||
rettv->vval.v_number = -2;
|
rettv->vval.v_number = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4790,7 +4790,7 @@ buf_check_timestamp (
|
|||||||
int helpmesg = FALSE;
|
int helpmesg = FALSE;
|
||||||
int reload = FALSE;
|
int reload = FALSE;
|
||||||
int can_reload = FALSE;
|
int can_reload = FALSE;
|
||||||
off_t orig_size = buf->b_orig_size;
|
uint64_t orig_size = buf->b_orig_size;
|
||||||
int orig_mode = buf->b_orig_mode;
|
int orig_mode = buf->b_orig_mode;
|
||||||
static int busy = FALSE;
|
static int busy = FALSE;
|
||||||
int n;
|
int n;
|
||||||
|
@@ -397,7 +397,7 @@ uint64_t os_fileinfo_inode(const FileInfo *file_info)
|
|||||||
/// Get the size of a file from a `FileInfo`.
|
/// Get the size of a file from a `FileInfo`.
|
||||||
///
|
///
|
||||||
/// @return filesize in bytes.
|
/// @return filesize in bytes.
|
||||||
off_t os_fileinfo_size(const FileInfo *file_info)
|
uint64_t os_fileinfo_size(const FileInfo *file_info)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
return file_info->stat.st_size;
|
return file_info->stat.st_size;
|
||||||
|
Reference in New Issue
Block a user