From 784e498c4a9c1f03266ced5ec3f55c3a6c94b80d Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:47:44 +0200 Subject: refactor: clang-tidy fixes to silence clangd warning (#20683) * refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings --- src/nvim/eval/encode.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/eval/encode.h') diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index 8755ff48ac..9d311fe356 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -15,9 +15,9 @@ /// @param[in] objname Object name, used for error message. /// /// @return OK in case of success, FAIL otherwise. -int encode_vim_to_msgpack(msgpack_packer *const packer, - typval_T *const tv, - const char *const objname); +int encode_vim_to_msgpack(msgpack_packer *packer, + typval_T *tv, + const char *objname); /// Convert VimL value to :echo output /// @@ -26,9 +26,9 @@ int encode_vim_to_msgpack(msgpack_packer *const packer, /// @param[in] objname Object name, used for error message. /// /// @return OK in case of success, FAIL otherwise. -int encode_vim_to_echo(garray_T *const packer, - typval_T *const tv, - const char *const objname); +int encode_vim_to_echo(garray_T *packer, + typval_T *tv, + const char *objname); /// Structure defining state for read_from_list() typedef struct { -- cgit From abf758a2977c4e6cab4dfa217f56da853d85851c Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 21 Oct 2022 16:43:03 +0200 Subject: refactor: fix uncrustify lint errors --- src/nvim/eval/encode.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/nvim/eval/encode.h') diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index 9d311fe356..c0c98e0990 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -15,9 +15,7 @@ /// @param[in] objname Object name, used for error message. /// /// @return OK in case of success, FAIL otherwise. -int encode_vim_to_msgpack(msgpack_packer *packer, - typval_T *tv, - const char *objname); +int encode_vim_to_msgpack(msgpack_packer *packer, typval_T *tv, const char *objname); /// Convert VimL value to :echo output /// @@ -26,9 +24,7 @@ int encode_vim_to_msgpack(msgpack_packer *packer, /// @param[in] objname Object name, used for error message. /// /// @return OK in case of success, FAIL otherwise. -int encode_vim_to_echo(garray_T *packer, - typval_T *tv, - const char *objname); +int encode_vim_to_echo(garray_T *packer, typval_T *tv, const char *objname); /// Structure defining state for read_from_list() typedef struct { -- cgit From 66360675cf4d091b7460e4a8e1435c13216c1929 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 11 Sep 2022 17:12:44 +0200 Subject: 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. --- src/nvim/eval/encode.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval/encode.h') diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index c0c98e0990..5c217abb5a 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -2,11 +2,14 @@ #define NVIM_EVAL_ENCODE_H #include +#include #include #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/garray.h" -#include "nvim/vim.h" // For STRLEN +#include "nvim/vim.h" /// Convert VimL value to msgpack string /// -- cgit From bd22585061b66d7f71d4832b4a81e950b3c9d19d Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Fri, 26 Aug 2022 23:11:25 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/eval/encode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval/encode.h') diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index 5c217abb5a..e66dab1cff 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -47,7 +47,7 @@ static inline ListReaderState encode_init_lrstate(const list_T *const list) .offset = 0, .li_length = (TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string == NULL ? 0 - : STRLEN(TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string)), + : strlen(TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string)), }; } -- cgit From 3269902a13df3bccf8705db73488c0a47f495514 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 15 Jan 2023 14:16:33 +0100 Subject: refactor: fix IWYU mapping file and use IWYU (#21802) Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly. --- src/nvim/eval/encode.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/eval/encode.h') diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index e66dab1cff..41e7614fc0 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "nvim/eval.h" #include "nvim/eval/typval.h" -- cgit