From 0f29deec80e09b05eae97ea16edd458b440b7c0e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 20 Nov 2019 21:32:11 -0500 Subject: vim-patch:8.1.1235: compiler warnings for using STRLEN() value Problem: Compiler warnings for using STRLEN() value. Solution: Cast to int. (Christian Brabandt, Mike Williams) https://github.com/vim/vim/commit/c0af78fa0869d39314336faef36239f62f09e148 --- src/nvim/tag.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 9e8c05fb1e..10efa65ddb 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1194,12 +1194,10 @@ static int find_tagfunc_tags( taglist = rettv.vval.v_list; TV_LIST_ITER_CONST(taglist, li, { - char_u *mfp; char_u *res_name; char_u *res_fname; char_u *res_cmd; char_u *res_kind; - int len; int has_extra = 0; int name_only = flags & TAG_NAMES; @@ -1208,7 +1206,7 @@ static int find_tagfunc_tags( break; } - len = 2; + size_t len = 2; res_name = NULL; res_fname = NULL; res_cmd = NULL; @@ -1254,15 +1252,7 @@ static int find_tagfunc_tags( break; } - if (name_only) { - mfp = vim_strsave(res_name); - } else { - mfp = (char_u *)xmalloc((int)sizeof(char_u) + len + 1); - } - - if (mfp == NULL) { - continue; - } + char_u *const mfp = name_only ? vim_strsave(res_name) : xmalloc(len + 2); if (!name_only) { char_u *p = mfp; -- cgit