From 66360675cf4d091b7460e4a8e1435c13216c1929 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 11 Sep 2022 17:12:44 +0200 Subject: build: allow IWYU to fix includes for all .c files Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers. --- src/nvim/os_unix.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 473bf5072c..3521703fba 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -1,43 +1,12 @@ // 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 -#include -#include -#include -#include -#include - -#include "nvim/ascii.h" -#include "nvim/buffer.h" -#include "nvim/charset.h" -#include "nvim/eval.h" -#include "nvim/ex_cmds.h" -#include "nvim/fileio.h" -#include "nvim/garray.h" -#include "nvim/getchar.h" -#include "nvim/main.h" -#include "nvim/mbyte.h" -#include "nvim/memline.h" -#include "nvim/memory.h" -#include "nvim/message.h" -#include "nvim/mouse.h" -#include "nvim/msgpack_rpc/helpers.h" -#include "nvim/os/input.h" -#include "nvim/os/os.h" -#include "nvim/os/shell.h" -#include "nvim/os/signal.h" -#include "nvim/os/time.h" +#include "nvim/os/os_defs.h" #include "nvim/os_unix.h" -#include "nvim/path.h" -#include "nvim/screen.h" -#include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/types.h" -#include "nvim/ui.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os_unix.c.generated.h" +# include "os_unix.c.generated.h" // IWYU pragma: export #endif #if defined(HAVE_ACL) -- cgit From a5207304dd7cda519ae94b313b9d4fb6dbd298f6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 16 Dec 2022 17:38:29 +0100 Subject: refactor: rename mch_get_acl => os_get_acl --- src/nvim/os_unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 3521703fba..074a8b7936 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -19,21 +19,21 @@ // Return a pointer to the ACL of file "fname" in allocated memory. // Return NULL if the ACL is not available for whatever reason. -vim_acl_T mch_get_acl(const char_u *fname) +vim_acl_T os_get_acl(const char_u *fname) { vim_acl_T ret = NULL; return ret; } // Set the ACL of file "fname" to "acl" (unless it's NULL). -void mch_set_acl(const char_u *fname, vim_acl_T aclent) +void os_set_acl(const char_u *fname, vim_acl_T aclent) { if (aclent == NULL) { return; } } -void mch_free_acl(vim_acl_T aclent) +void os_free_acl(vim_acl_T aclent) { if (aclent == NULL) { return; -- cgit From a283a99165865e88ea8df366d1b2db290e9c637a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 2 Jan 2023 17:56:17 -0500 Subject: refactor: eliminate os_unix.c #21621 --- src/nvim/os_unix.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 src/nvim/os_unix.c (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c deleted file mode 100644 index 074a8b7936..0000000000 --- a/src/nvim/os_unix.c +++ /dev/null @@ -1,42 +0,0 @@ -// 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 - -#include "nvim/os/os_defs.h" -#include "nvim/os_unix.h" -#include "nvim/types.h" - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os_unix.c.generated.h" // IWYU pragma: export -#endif - -#if defined(HAVE_ACL) -# ifdef HAVE_SYS_ACL_H -# include -# endif -# ifdef HAVE_SYS_ACCESS_H -# include -# endif - -// Return a pointer to the ACL of file "fname" in allocated memory. -// Return NULL if the ACL is not available for whatever reason. -vim_acl_T os_get_acl(const char_u *fname) -{ - vim_acl_T ret = NULL; - return ret; -} - -// Set the ACL of file "fname" to "acl" (unless it's NULL). -void os_set_acl(const char_u *fname, vim_acl_T aclent) -{ - if (aclent == NULL) { - return; - } -} - -void os_free_acl(vim_acl_T aclent) -{ - if (aclent == NULL) { - return; - } -} -#endif -- cgit