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/eval/typval_encode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval/typval_encode.h') diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h index 2f19144da3..171b0417d0 100644 --- a/src/nvim/eval/typval_encode.h +++ b/src/nvim/eval/typval_encode.h @@ -11,7 +11,7 @@ #include #include "klib/kvec.h" -#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/func_attr.h" /// Type of the stack entry -- cgit From 2f17ef1fc4b96cf1106fd95ba090d34a2e4b977b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 22 Jun 2023 04:09:14 -0700 Subject: fix(messages): use "Vimscript" instead of "VimL" #24111 followup to #24109 fix #16150 --- src/nvim/eval/typval_encode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval/typval_encode.h') diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h index 171b0417d0..cf01926030 100644 --- a/src/nvim/eval/typval_encode.h +++ b/src/nvim/eval/typval_encode.h @@ -30,7 +30,7 @@ typedef enum { kMPConvPartialEnd, ///< Already converted everything. } MPConvPartialStage; -/// Structure representing current VimL to messagepack conversion state +/// Structure representing current Vimscript to messagepack conversion state typedef struct { MPConvStackValType type; ///< Type of the stack entry. typval_T *tv; ///< Currently converted typval_T. @@ -60,7 +60,7 @@ typedef struct { } data; ///< Data to convert. } MPConvStackVal; -/// Stack used to convert VimL values to messagepack. +/// Stack used to convert Vimscript values to messagepack. typedef kvec_withinit_t(MPConvStackVal, 8) MPConvStack; // Defines for MPConvStack -- 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/eval/typval_encode.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/eval/typval_encode.h') diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h index cf01926030..743acd8800 100644 --- a/src/nvim/eval/typval_encode.h +++ b/src/nvim/eval/typval_encode.h @@ -2,8 +2,7 @@ /// /// Contains common definitions for eval/typval_encode.c.h. Most of time should /// not be included directly. -#ifndef NVIM_EVAL_TYPVAL_ENCODE_H -#define NVIM_EVAL_TYPVAL_ENCODE_H +#pragma once #include #include @@ -140,5 +139,3 @@ static inline size_t tv_strlen(const typval_T *const tv) /// Name of the dummy const dict_T *const variable #define TYPVAL_ENCODE_NODICT_VAR \ _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _nodict_var) - -#endif // NVIM_EVAL_TYPVAL_ENCODE_H -- cgit From 488038580934f301c1528a14548ec0cabd16c2cd Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 14:06:04 +0100 Subject: build: adjust clang-tidy warning exclusion logic Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible. --- src/nvim/eval/typval_encode.h | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'src/nvim/eval/typval_encode.h') diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h index 743acd8800..a6e0bd4b2b 100644 --- a/src/nvim/eval/typval_encode.h +++ b/src/nvim/eval/typval_encode.h @@ -62,14 +62,6 @@ typedef struct { /// Stack used to convert Vimscript values to messagepack. typedef kvec_withinit_t(MPConvStackVal, 8) MPConvStack; -// Defines for MPConvStack -#define _mp_size kv_size -#define _mp_init kvi_init -#define _mp_destroy kvi_destroy -#define _mp_push kvi_push -#define _mp_pop kv_pop -#define _mp_last kv_last - static inline size_t tv_strlen(const typval_T *tv) REAL_FATTR_ALWAYS_INLINE REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_NONNULL_ALL; @@ -95,21 +87,21 @@ static inline size_t tv_strlen(const typval_T *const tv) /// copyID (variable) it is set to copyID. /// @param[in] copyID CopyID used by the caller. /// @param conv_type Type of the conversion, @see MPConvStackValType. -#define _TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val, copyID_attr, copyID, \ - conv_type) \ +#define TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val, copyID_attr, copyID, \ + conv_type) \ do { \ - const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(TYPVAL_ENCODE_FIRST_ARG_NAME, \ - (val), &(val)->copyID_attr, mpstack, \ - copyID, conv_type, objname); \ + const int te_csr_ret = TYPVAL_ENCODE_CHECK_SELF_REFERENCE(TYPVAL_ENCODE_FIRST_ARG_NAME, \ + (val), &(val)->copyID_attr, mpstack, \ + copyID, conv_type, objname); \ if (te_csr_ret != NOTDONE) { \ return te_csr_ret; \ } \ } while (0) -#define _TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf) \ +#define TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf) \ pref##name##suf -#define _TYPVAL_ENCODE_FUNC_NAME_INNER(pref, name, suf) \ - _TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf) +#define TYPVAL_ENCODE_FUNC_NAME_INNER(pref, name, suf) \ + TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf) /// Construct function name, possibly using macros /// @@ -121,21 +113,21 @@ static inline size_t tv_strlen(const typval_T *const tv) /// @param[in] suf Suffix. /// /// @return Concat: pref + #TYPVAL_ENCODE_NAME + suf. -#define _TYPVAL_ENCODE_FUNC_NAME(pref, suf) \ - _TYPVAL_ENCODE_FUNC_NAME_INNER(pref, TYPVAL_ENCODE_NAME, suf) +#define TYPVAL_ENCODE_FUNC_NAME(pref, suf) \ + TYPVAL_ENCODE_FUNC_NAME_INNER(pref, TYPVAL_ENCODE_NAME, suf) /// Self reference checker function name -#define _TYPVAL_ENCODE_CHECK_SELF_REFERENCE \ - _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _check_self_reference) +#define TYPVAL_ENCODE_CHECK_SELF_REFERENCE \ + TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _check_self_reference) /// Entry point function name -#define _TYPVAL_ENCODE_ENCODE \ - _TYPVAL_ENCODE_FUNC_NAME(encode_vim_to_, ) +#define TYPVAL_ENCODE_ENCODE \ + TYPVAL_ENCODE_FUNC_NAME(encode_vim_to_, ) /// Name of the …convert_one_value function -#define _TYPVAL_ENCODE_CONVERT_ONE_VALUE \ - _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _convert_one_value) +#define TYPVAL_ENCODE_CONVERT_ONE_VALUE \ + TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _convert_one_value) /// Name of the dummy const dict_T *const variable #define TYPVAL_ENCODE_NODICT_VAR \ - _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _nodict_var) + TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _nodict_var) -- cgit