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/lua/executor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index c6747833e5..7e16c0f45c 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -8,7 +8,7 @@ #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/assert.h" -#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.h" #include "nvim/lua/converter.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/lua/executor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 7e16c0f45c..f340d9d0d8 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -24,7 +24,7 @@ typedef struct { LuaRef empty_dict_ref; int ref_count; #if __has_feature(address_sanitizer) - PMap(handle_T) ref_markers; + PMap(int) ref_markers; #endif } nlua_ref_state_t; -- cgit From cf8b2c0e74fd5e723b0c15c2ce84e6900fd322d3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 30 Sep 2023 12:05:28 +0800 Subject: build(iwyu): add a few more _defs.h mappings (#25435) --- src/nvim/lua/executor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index f340d9d0d8..b132a0d147 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -13,6 +13,7 @@ #include "nvim/func_attr.h" #include "nvim/lua/converter.h" #include "nvim/macros.h" +#include "nvim/map.h" #include "nvim/types.h" #include "nvim/usercmd.h" -- cgit From 09a17f91d0d362c6e58bfdbe3ccdeacffb0b44b9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 2 Oct 2023 10:45:33 +0800 Subject: refactor: move cmdline completion types to cmdexpand_defs.h (#25465) --- src/nvim/lua/executor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index b132a0d147..f3e2b6d1d0 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -8,6 +8,7 @@ #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/assert.h" +#include "nvim/cmdexpand_defs.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.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/lua/executor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index f3e2b6d1d0..4b4d1dded8 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -45,7 +45,7 @@ typedef struct { # include "lua/executor.h.generated.h" #endif -EXTERN nlua_ref_state_t *nlua_global_refs INIT(= NULL); -EXTERN bool nlua_disable_preload INIT(= false); +EXTERN nlua_ref_state_t *nlua_global_refs INIT( = NULL); +EXTERN bool nlua_disable_preload INIT( = false); #endif // NVIM_LUA_EXECUTOR_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/lua/executor.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 4b4d1dded8..91775e0322 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -1,5 +1,4 @@ -#ifndef NVIM_LUA_EXECUTOR_H -#define NVIM_LUA_EXECUTOR_H +#pragma once #include #include @@ -47,5 +46,3 @@ typedef struct { EXTERN nlua_ref_state_t *nlua_global_refs INIT( = NULL); EXTERN bool nlua_disable_preload INIT( = false); - -#endif // NVIM_LUA_EXECUTOR_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/lua/executor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 91775e0322..6caad4bd7a 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -14,7 +14,7 @@ #include "nvim/lua/converter.h" #include "nvim/macros.h" #include "nvim/map.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" #include "nvim/usercmd.h" // Generated by msgpack-gen.lua -- 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/lua/executor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 6caad4bd7a..b38faddbb3 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -6,14 +6,14 @@ #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/assert.h" +#include "nvim/assert_defs.h" #include "nvim/cmdexpand_defs.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.h" #include "nvim/lua/converter.h" -#include "nvim/macros.h" -#include "nvim/map.h" +#include "nvim/macros_defs.h" +#include "nvim/map_defs.h" #include "nvim/types_defs.h" #include "nvim/usercmd.h" -- cgit