diff options
| author | dundargoc <gocdundar@gmail.com> | 2022-09-11 17:12:44 +0200 |
|---|---|---|
| committer | dundargoc <gocdundar@gmail.com> | 2022-11-15 10:30:03 +0100 |
| commit | 66360675cf4d091b7460e4a8e1435c13216c1929 (patch) | |
| tree | af3a60083c23986c15b62b51aa0224d6c20f1aac /src/nvim/event | |
| parent | 9d2a6cd11e092de838939ce993e8d18f5c9584b7 (diff) | |
| download | rneovim-66360675cf4d091b7460e4a8e1435c13216c1929.tar.gz rneovim-66360675cf4d091b7460e4a8e1435c13216c1929.tar.bz2 rneovim-66360675cf4d091b7460e4a8e1435c13216c1929.zip | |
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.
Diffstat (limited to 'src/nvim/event')
| -rw-r--r-- | src/nvim/event/libuv_process.c | 6 | ||||
| -rw-r--r-- | src/nvim/event/libuv_process.h | 1 | ||||
| -rw-r--r-- | src/nvim/event/loop.c | 7 | ||||
| -rw-r--r-- | src/nvim/event/multiqueue.c | 6 | ||||
| -rw-r--r-- | src/nvim/event/process.c | 7 | ||||
| -rw-r--r-- | src/nvim/event/process.h | 9 | ||||
| -rw-r--r-- | src/nvim/event/rstream.c | 9 | ||||
| -rw-r--r-- | src/nvim/event/signal.c | 1 | ||||
| -rw-r--r-- | src/nvim/event/signal.h | 3 | ||||
| -rw-r--r-- | src/nvim/event/socket.c | 11 | ||||
| -rw-r--r-- | src/nvim/event/socket.h | 3 | ||||
| -rw-r--r-- | src/nvim/event/stream.c | 4 | ||||
| -rw-r--r-- | src/nvim/event/stream.h | 3 | ||||
| -rw-r--r-- | src/nvim/event/time.h | 4 | ||||
| -rw-r--r-- | src/nvim/event/wstream.c | 6 | ||||
| -rw-r--r-- | src/nvim/event/wstream.h | 3 |
16 files changed, 59 insertions, 24 deletions
diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index f012bacdd9..c5d3b94c95 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -1,14 +1,14 @@ // 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 <assert.h> +#include <stdint.h> #include <uv.h> +#include "nvim/eval/typval.h" #include "nvim/event/libuv_process.h" #include "nvim/event/loop.h" #include "nvim/event/process.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" +#include "nvim/event/stream.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/os/os.h" diff --git a/src/nvim/event/libuv_process.h b/src/nvim/event/libuv_process.h index 1132ce79ca..8f987847d8 100644 --- a/src/nvim/event/libuv_process.h +++ b/src/nvim/event/libuv_process.h @@ -3,6 +3,7 @@ #include <uv.h> +#include "nvim/event/loop.h" #include "nvim/event/process.h" typedef struct libuv_process { diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index 3329cbd574..934f5fc69a 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -1,13 +1,16 @@ // 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 <stdarg.h> +#include <stdbool.h> #include <stdint.h> +#include <stdlib.h> #include <uv.h> +#include "nvim/event/defs.h" #include "nvim/event/loop.h" -#include "nvim/event/process.h" #include "nvim/log.h" +#include "nvim/memory.h" +#include "nvim/os/time.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/loop.c.generated.h" diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index 40d20033e0..e05084b656 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -46,14 +46,14 @@ // other sources and focus on a specific channel. #include <assert.h> -#include <stdarg.h> #include <stdbool.h> -#include <stdint.h> +#include <stddef.h> #include <uv.h> +#include "nvim/event/defs.h" #include "nvim/event/multiqueue.h" +#include "nvim/lib/queue.h" #include "nvim/memory.h" -#include "nvim/os/time.h" typedef struct multiqueue_item MultiQueueItem; struct multiqueue_item { diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index e029f778f6..e74e95669d 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -2,20 +2,23 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <inttypes.h> +#include <signal.h> #include <stdlib.h> #include <uv.h> +#include "klib/klist.h" #include "nvim/event/libuv_process.h" #include "nvim/event/loop.h" #include "nvim/event/process.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/os/process.h" #include "nvim/os/pty_process.h" #include "nvim/os/shell.h" +#include "nvim/os/time.h" +#include "nvim/rbuffer.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/process.c.generated.h" diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 30254bfe07..26e03ff4f3 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -1,11 +1,20 @@ #ifndef NVIM_EVENT_PROCESS_H #define NVIM_EVENT_PROCESS_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/rstream.h" +#include "nvim/event/stream.h" #include "nvim/event/wstream.h" +struct process; + typedef enum { kProcessTypeUv, kProcessTypePty, diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c index 2847788ef8..a88d62fd6b 100644 --- a/src/nvim/event/rstream.c +++ b/src/nvim/event/rstream.c @@ -3,17 +3,18 @@ #include <assert.h> #include <stdbool.h> +#include <stddef.h> #include <stdint.h> -#include <stdlib.h> #include <uv.h> -#include "nvim/ascii.h" #include "nvim/event/loop.h" #include "nvim/event/rstream.h" +#include "nvim/event/stream.h" #include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/memory.h" -#include "nvim/vim.h" +#include "nvim/os/os_defs.h" +#include "nvim/rbuffer.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/rstream.c.generated.h" diff --git a/src/nvim/event/signal.c b/src/nvim/event/signal.c index 4a45a2ec2f..8256ca2091 100644 --- a/src/nvim/event/signal.c +++ b/src/nvim/event/signal.c @@ -1,6 +1,7 @@ // 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 <stddef.h> #include <uv.h> #include "nvim/event/loop.h" diff --git a/src/nvim/event/signal.h b/src/nvim/event/signal.h index 7fe352edef..f9adf62c20 100644 --- a/src/nvim/event/signal.h +++ b/src/nvim/event/signal.h @@ -4,6 +4,9 @@ #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" + +struct signal_watcher; typedef struct signal_watcher SignalWatcher; typedef void (*signal_cb)(SignalWatcher *watcher, int signum, void *data); diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 9ca3dcc276..10756015ad 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -2,23 +2,24 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <stdint.h> +#include <inttypes.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> #include <uv.h> #include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/event/loop.h" -#include "nvim/event/rstream.h" #include "nvim/event/socket.h" -#include "nvim/event/wstream.h" +#include "nvim/event/stream.h" +#include "nvim/gettext.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/memory.h" #include "nvim/os/os.h" #include "nvim/path.h" -#include "nvim/strings.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/socket.c.generated.h" diff --git a/src/nvim/event/socket.h b/src/nvim/event/socket.h index d30ae45502..c6fcdec4bb 100644 --- a/src/nvim/event/socket.h +++ b/src/nvim/event/socket.h @@ -4,9 +4,12 @@ #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/rstream.h" #include "nvim/event/wstream.h" +struct socket_watcher; + #define ADDRESS_MAX_SIZE 256 typedef struct socket_watcher SocketWatcher; diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c index bfb7a551b9..0a4918636a 100644 --- a/src/nvim/event/stream.c +++ b/src/nvim/event/stream.c @@ -3,9 +3,11 @@ #include <assert.h> #include <stdbool.h> -#include <stdio.h> +#include <stddef.h> #include <uv.h> +#include <uv/version.h> +#include "nvim/event/loop.h" #include "nvim/event/stream.h" #include "nvim/log.h" #include "nvim/macros.h" diff --git a/src/nvim/event/stream.h b/src/nvim/event/stream.h index f2858f0b6d..33d2d6e775 100644 --- a/src/nvim/event/stream.h +++ b/src/nvim/event/stream.h @@ -6,8 +6,11 @@ #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/rbuffer.h" +struct stream; + typedef struct stream Stream; /// Type of function called when the Stream buffer is filled with data /// diff --git a/src/nvim/event/time.h b/src/nvim/event/time.h index a6de89ad6e..e84488fdd6 100644 --- a/src/nvim/event/time.h +++ b/src/nvim/event/time.h @@ -1,9 +1,13 @@ #ifndef NVIM_EVENT_TIME_H #define NVIM_EVENT_TIME_H +#include <stdbool.h> #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" + +struct time_watcher; typedef struct time_watcher TimeWatcher; typedef void (*time_cb)(TimeWatcher *watcher, void *data); diff --git a/src/nvim/event/wstream.c b/src/nvim/event/wstream.c index d81ffa5c15..65391ba5cf 100644 --- a/src/nvim/event/wstream.c +++ b/src/nvim/event/wstream.c @@ -3,15 +3,13 @@ #include <assert.h> #include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/stream.h" #include "nvim/event/wstream.h" -#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/memory.h" -#include "nvim/vim.h" #define DEFAULT_MAXMEM 1024 * 1024 * 2000 diff --git a/src/nvim/event/wstream.h b/src/nvim/event/wstream.h index d599d29913..ef1311c619 100644 --- a/src/nvim/event/wstream.h +++ b/src/nvim/event/wstream.h @@ -2,12 +2,15 @@ #define NVIM_EVENT_WSTREAM_H #include <stdbool.h> +#include <stddef.h> #include <stdint.h> #include <uv.h> #include "nvim/event/loop.h" #include "nvim/event/stream.h" +struct wbuffer; + typedef struct wbuffer WBuffer; typedef void (*wbuffer_data_finalizer)(void *data); |