diff options
| author | dundargoc <gocdundar@gmail.com> | 2023-12-18 10:55:23 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-21 17:38:42 +0100 |
| commit | af93a74a0f4afa9a3a4f55ffdf28141eaf776d22 (patch) | |
| tree | 76068552bf3a74b4170ecd7b087905c96ddd6f8f /src | |
| parent | ade42d531bcc9ca61facfb0524128a8a9f9b2444 (diff) | |
| download | rneovim-af93a74a0f4afa9a3a4f55ffdf28141eaf776d22.tar.gz rneovim-af93a74a0f4afa9a3a4f55ffdf28141eaf776d22.tar.bz2 rneovim-af93a74a0f4afa9a3a4f55ffdf28141eaf776d22.zip | |
refactor: run IWYU on entire repo
Reference: https://github.com/neovim/neovim/issues/6371.
Diffstat (limited to 'src')
120 files changed, 308 insertions, 418 deletions
diff --git a/src/clint.py b/src/clint.py index 80ebf565a1..303c3df25d 100755 --- a/src/clint.py +++ b/src/clint.py @@ -897,8 +897,6 @@ def CheckIncludes(filename, lines, error): }): return - # These should be synced with the ignored headers in the `iwyu` target in - # the Makefile. check_includes_ignore = [ "src/nvim/api/private/validate.h", "src/nvim/assert_defs.h", @@ -913,6 +911,7 @@ def CheckIncludes(filename, lines, error): "src/nvim/eval/userfunc.h", "src/nvim/event/libuv_process.h", "src/nvim/event/loop.h", + "src/nvim/event/multiqueue.h", "src/nvim/event/process.h", "src/nvim/event/rstream.h", "src/nvim/event/signal.h", @@ -928,6 +927,7 @@ def CheckIncludes(filename, lines, error): "src/nvim/keycodes.h", "src/nvim/lua/executor.h", "src/nvim/main.h", + "src/nvim/mark.h", "src/nvim/msgpack_rpc/channel_defs.h", "src/nvim/msgpack_rpc/helpers.h", "src/nvim/msgpack_rpc/unpacker.h", diff --git a/src/nvim/api/private/converter.h b/src/nvim/api/private/converter.h index fc82abf332..a5acc56c7c 100644 --- a/src/nvim/api/private/converter.h +++ b/src/nvim/api/private/converter.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/api/private/defs.h" // IWYU pragma: keep +#include "nvim/api/private/defs.h" // IWYU pragma: export #include "nvim/eval/typval_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h index b627db6b00..d322c1ceca 100644 --- a/src/nvim/api/private/dispatch.h +++ b/src/nvim/api/private/dispatch.h @@ -3,7 +3,7 @@ #include <stdbool.h> #include <stdint.h> -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: export #include "nvim/memory_defs.h" #include "nvim/types_defs.h" diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 701ce91257..1ee66f906b 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -4,7 +4,7 @@ #include <stddef.h> #include "klib/kvec.h" -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: export #include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" // IWYU pragma: keep #include "nvim/ex_eval_defs.h" diff --git a/src/nvim/api/private/validate.h b/src/nvim/api/private/validate.h index d1c977cd6e..692ea46176 100644 --- a/src/nvim/api/private/validate.h +++ b/src/nvim/api/private/validate.h @@ -3,7 +3,7 @@ #include <stdbool.h> #include <stddef.h> -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: export #include "nvim/api/private/helpers.h" #include "nvim/assert_defs.h" #include "nvim/macros_defs.h" diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 678d23fbeb..82d42d652d 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -15,7 +15,8 @@ #include "nvim/autocmd.h" #include "nvim/channel.h" #include "nvim/eval.h" -#include "nvim/event/defs.h" +#include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/wstream.h" #include "nvim/globals.h" #include "nvim/grid.h" diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 9ae5244fa1..aed286165a 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -64,6 +64,7 @@ #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/terminal.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/vim_defs.h" #include "nvim/window.h" diff --git a/src/nvim/ascii_defs.h b/src/nvim/ascii_defs.h index 3de04cd9fa..4215157654 100644 --- a/src/nvim/ascii_defs.h +++ b/src/nvim/ascii_defs.h @@ -86,35 +86,6 @@ static inline bool ascii_iswhite(int c) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_iswhite_or_nul(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isdigit(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isxdigit(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isident(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isbdigit(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isodigit(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - -static inline bool ascii_isspace(int c) - REAL_FATTR_CONST - REAL_FATTR_ALWAYS_INLINE; - /// Checks if `c` is a space or tab character. /// /// @see {ascii_isdigit} @@ -123,6 +94,9 @@ static inline bool ascii_iswhite(int c) return c == ' ' || c == '\t'; } +static inline bool ascii_iswhite_or_nul(int c) + REAL_FATTR_CONST + REAL_FATTR_ALWAYS_INLINE; /// Checks if `c` is a space or tab character or NUL. /// /// @see {ascii_isdigit} @@ -131,6 +105,9 @@ static inline bool ascii_iswhite_or_nul(int c) return ascii_iswhite(c) || c == NUL; } +static inline bool a |