diff options
author | ZyX <kp-pav@yandex.ru> | 2016-12-25 20:54:06 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-01-03 06:39:23 +0300 |
commit | b3163d06b340b95ca85421cff8a64c5bc1935f5e (patch) | |
tree | 78e8d8660036225f4488a17b80d2d6d772d6abf9 /src/nvim/eval.c | |
parent | c5c75513b81398f05a4e63b2f7207ae74de25ecc (diff) | |
download | rneovim-b3163d06b340b95ca85421cff8a64c5bc1935f5e.tar.gz rneovim-b3163d06b340b95ca85421cff8a64c5bc1935f5e.tar.bz2 rneovim-b3163d06b340b95ca85421cff8a64c5bc1935f5e.zip |
eval/typval_encode: Refactor big-big macros into .c.h file
This makes gdb backtraces much more meaningful: specifically I now know at which
line it crashes in place of seeing that it crashes at
TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS macros invocation.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dbc279685a..8f66976f1c 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19151,9 +19151,17 @@ void free_tv(typval_T *varp) #define TYPVAL_ENCODE_CONV_RECURSE(ignored1, ignored2) -// nothing_convert_one_value() +#define TYPVAL_ENCODE_SCOPE static +#define TYPVAL_ENCODE_NAME nothing +#define TYPVAL_ENCODE_FIRST_ARG_TYPE const void *const +#define TYPVAL_ENCODE_FIRST_ARG_NAME ignored +// _nothing_convert_one_value() // encode_vim_to_nothing() -TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(static, nothing, void *, ignored) +#include "nvim/eval/typval_encode.c.h" +#undef TYPVAL_ENCODE_SCOPE +#undef TYPVAL_ENCODE_NAME +#undef TYPVAL_ENCODE_FIRST_ARG_TYPE +#undef TYPVAL_ENCODE_FIRST_ARG_NAME #undef TYPVAL_ENCODE_ALLOW_SPECIALS #undef TYPVAL_ENCODE_CONV_NIL @@ -19186,7 +19194,8 @@ TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(static, nothing, void *, ignored) void clear_tv(typval_T *varp) { if (varp != NULL && varp->v_type != VAR_UNKNOWN) { - encode_vim_to_nothing(varp, varp, "clear_tv argument"); + const int evn_ret = encode_vim_to_nothing(varp, varp, "clear_tv argument"); + assert(evn_ret == OK); } } |