diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /src/nvim/os/fileio.c | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.gz rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.bz2 rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'src/nvim/os/fileio.c')
-rw-r--r-- | src/nvim/os/fileio.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 5af39555c9..79d6ac08e7 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - /// @file fileio.c /// /// Buffered reading/writing to a file. Unlike fileio.c this is not dealing with @@ -18,14 +15,22 @@ #include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/log.h" -#include "nvim/macros.h" +#include "nvim/macros_defs.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/fileio.h" -#include "nvim/os/os.h" +#include "nvim/os/fs.h" #include "nvim/os/os_defs.h" #include "nvim/rbuffer.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" + +#ifdef MSWIN +# include "nvim/os/os_win_console.h" +#endif + +#ifdef HAVE_SYS_UIO_H +# include <sys/uio.h> +#endif #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/fileio.c.generated.h" @@ -49,7 +54,6 @@ int file_open(FileDescriptor *const ret_fp, const char *const fname, const int f { int os_open_flags = 0; TriState wr = kNone; - // -V:FLAG:501 #define FLAG(flags, flag, fcntl_flags, wrval, cond) \ do { \ if (flags & flag) { \ @@ -278,9 +282,10 @@ static char writebuf[kRWBufferSize]; /// /// @param[in,out] rv RBuffer instance used. /// @param[in,out] fp File to work with. -static void file_rb_write_full_cb(RBuffer *const rv, FileDescriptor *const fp) +static void file_rb_write_full_cb(RBuffer *const rv, void *const fp_in) FUNC_ATTR_NONNULL_ALL { + FileDescriptor *const fp = fp_in; assert(fp->wr); assert(rv->data == (void *)fp); if (rbuffer_size(rv) == 0) { |