From 7224c889e0d5d70b99ae377036baa6377c33a568 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 11 Feb 2023 10:25:24 +0100 Subject: build: enable MSVC level 3 warnings (#21934) MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3 (production quality) and 4 (informational). Enabling level 3 warnings mostly revealed conversion problems, similar to GCC/clang -Wconversion flag. --- src/nvim/usercmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index b6bf6c1e33..0d9838abf2 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -12,7 +12,7 @@ typedef struct ucmd { char *uc_name; // The command name uint32_t uc_argt; // The argument type char *uc_rep; // The command's replacement string - long uc_def; // The default value for a range/count + int64_t uc_def; // The default value for a range/count int uc_compl; // completion type cmd_addr_T uc_addr_type; // The command's address type sctx_T uc_script_ctx; // SCTX where the command was defined -- 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/usercmd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index 0d9838abf2..34f1439b10 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -3,6 +3,7 @@ #include +#include "nvim/cmdexpand_defs.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/garray.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/usercmd.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index 34f1439b10..afda0b9d49 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -1,5 +1,4 @@ -#ifndef NVIM_USERCMD_H -#define NVIM_USERCMD_H +#pragma once #include @@ -33,4 +32,3 @@ extern garray_T ucmds; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "usercmd.h.generated.h" #endif -#endif // NVIM_USERCMD_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/usercmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index afda0b9d49..b1485ca707 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -5,7 +5,7 @@ #include "nvim/cmdexpand_defs.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" -#include "nvim/garray.h" +#include "nvim/garray_defs.h" #include "nvim/types.h" typedef struct ucmd { -- cgit From 574d25642fc9ca65b396633aeab6e2d32778b642 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 17:21:58 +0800 Subject: refactor: move Arena and ArenaMem to memory_defs.h (#26240) --- src/nvim/usercmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index b1485ca707..09b5dac958 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -2,9 +2,9 @@ #include -#include "nvim/cmdexpand_defs.h" +#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" -#include "nvim/ex_cmds_defs.h" +#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep #include "nvim/garray_defs.h" #include "nvim/types.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/usercmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index 09b5dac958..73bb5b9279 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -6,7 +6,7 @@ #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" // IWYU pragma: keep #include "nvim/garray_defs.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" typedef struct ucmd { char *uc_name; // The command name -- cgit From 718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 28 Nov 2023 07:47:36 +0800 Subject: refactor: fix runtime_defs.h (#26259) --- src/nvim/usercmd.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/nvim/usercmd.h') diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h index 73bb5b9279..bcabf9460b 100644 --- a/src/nvim/usercmd.h +++ b/src/nvim/usercmd.h @@ -1,28 +1,29 @@ #pragma once +#include // IWYU pragma: keep #include #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" -#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep +#include "nvim/ex_cmds_defs.h" #include "nvim/garray_defs.h" -#include "nvim/types_defs.h" +#include "nvim/types_defs.h" // IWYU pragma: keep typedef struct ucmd { - char *uc_name; // The command name - uint32_t uc_argt; // The argument type - char *uc_rep; // The command's replacement string - int64_t uc_def; // The default value for a range/count - int uc_compl; // completion type - cmd_addr_T uc_addr_type; // The command's address type - sctx_T uc_script_ctx; // SCTX where the command was defined - char *uc_compl_arg; // completion argument if any - LuaRef uc_compl_luaref; // Reference to Lua completion function - LuaRef uc_preview_luaref; // Reference to Lua preview function - LuaRef uc_luaref; // Reference to Lua function + char *uc_name; ///< The command name + uint32_t uc_argt; ///< The argument type + char *uc_rep; ///< The command's replacement string + int64_t uc_def; ///< The default value for a range/count + int uc_compl; ///< completion type + cmd_addr_T uc_addr_type; ///< The command's address type + sctx_T uc_script_ctx; ///< SCTX where the command was defined + char *uc_compl_arg; ///< completion argument if any + LuaRef uc_compl_luaref; ///< Reference to Lua completion function + LuaRef uc_preview_luaref; ///< Reference to Lua preview function + LuaRef uc_luaref; ///< Reference to Lua function } ucmd_T; -#define UC_BUFFER 1 // -buffer: local to current buffer +enum { UC_BUFFER = 1, }; ///< -buffer: local to current buffer extern garray_T ucmds; -- cgit