From 7190dba017e3aac0409c73ff1c954d18858cb3c9 Mon Sep 17 00:00:00 2001 From: ii14 <59243201+ii14@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:39:50 +0200 Subject: refactor: remove use of reserved c++ keywords libnvim couldn't be easily used in C++ due to the use of reserved keywords. Additionally, add explicit casts to *alloc function calls used in inline functions, as C++ doesn't allow implicit casts from void pointers. --- src/nvim/channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 5743eaead5..ca6c75b411 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -121,7 +121,7 @@ EXTERN Callback on_print INIT(= CALLBACK_INIT); /// @returns Channel with the id or NULL if not found static inline Channel *find_channel(uint64_t id) { - return pmap_get(uint64_t)(&channels, id); + return (Channel *)pmap_get(uint64_t)(&channels, id); } static inline Stream *channel_instream(Channel *chan) -- cgit From 6a273af10517d1f7e4ea85635f1d25a9158adeb5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 13 May 2023 10:40:53 +0800 Subject: refactor: remove typval.h from most header files (#23601) Because typval_defs.h is enough for most of them. --- src/nvim/channel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index ca6c75b411..7400465af0 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -5,7 +5,6 @@ #include #include -#include "nvim/eval/typval.h" #include "nvim/eval/typval_defs.h" #include "nvim/event/libuv_process.h" #include "nvim/event/multiqueue.h" -- cgit From e2fdd53d8c015913e8be4ff708fc3488558c8906 Mon Sep 17 00:00:00 2001 From: bfredl Date: Sun, 14 May 2023 18:45:56 +0200 Subject: refactor(map): avoid duplicated khash_t types for values This reduces the total number of khash_t instantiations from 22 to 8. Make the khash internal functions take the size of values as a runtime parameter. This is abstracted with typesafe Map containers which are still specialized for both key, value type. Introduce `Set(key)` type for when there is no value. Refactor shada.c to use Map/Set instead of khash directly. This requires `map_ref` operation to be more flexible. Return pointers to both key and value, plus an indicator for new_item. As a bonus, `map_key` is now redundant. Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is humongous. Make `event_strings` actually work like an intern pool instead of wtf it was doing before. --- src/nvim/channel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 7400465af0..deb693373c 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -15,7 +15,6 @@ #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/map.h" -#include "nvim/map_defs.h" #include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/os/pty_process.h" #include "nvim/terminal.h" -- cgit From 5f03a1eaabfc8de2b3a9c666fcd604763f41e152 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 20 Oct 2023 15:10:33 +0200 Subject: build(lint): remove unnecessary clint.py rules Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. --- src/nvim/channel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index deb693373c..281e1aa2be 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -108,9 +108,9 @@ struct Channel { bool callback_scheduled; }; -EXTERN PMap(uint64_t) channels INIT(= MAP_INIT); +EXTERN PMap(uint64_t) channels INIT( = MAP_INIT); -EXTERN Callback on_print INIT(= CALLBACK_INIT); +EXTERN Callback on_print INIT( = CALLBACK_INIT); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "channel.h.generated.h" -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/channel.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 281e1aa2be..a042faeb82 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -1,5 +1,4 @@ -#ifndef NVIM_CHANNEL_H -#define NVIM_CHANNEL_H +#pragma once #include #include @@ -161,5 +160,3 @@ static inline Stream *channel_outstream(Channel *chan) } abort(); } - -#endif // NVIM_CHANNEL_H -- cgit From 6361806aa28edca55ad3316a58bc3e936df9c0eb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Nov 2023 22:58:52 +0800 Subject: refactor: move garray_T to garray_defs.h (#26227) --- src/nvim/channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index a042faeb82..69485da030 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -10,7 +10,7 @@ #include "nvim/event/process.h" #include "nvim/event/socket.h" #include "nvim/event/stream.h" -#include "nvim/garray.h" +#include "nvim/garray_defs.h" #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/map.h" -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 69485da030..53666b0501 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -17,7 +17,7 @@ #include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/os/pty_process.h" #include "nvim/terminal.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" #define CHAN_STDIO 1 #define CHAN_STDERR 2 -- cgit From 79b6ff28ad1204fbb4199b9092f5c578d88cb28e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 28 Nov 2023 20:31:00 +0100 Subject: refactor: fix headers with IWYU --- src/nvim/channel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/channel.h') diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 53666b0501..5c9d708ac2 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -11,9 +11,9 @@ #include "nvim/event/socket.h" #include "nvim/event/stream.h" #include "nvim/garray_defs.h" -#include "nvim/macros.h" +#include "nvim/macros_defs.h" #include "nvim/main.h" -#include "nvim/map.h" +#include "nvim/map_defs.h" #include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/os/pty_process.h" #include "nvim/terminal.h" -- cgit