patch 9.1.0448: compiler warning in eval.c
Commit:
https://github.com/vim/vim/commit/8904d672befb496cf224f01bc042683bb6120e81
Author: Yegappan Lakshmanan <[email protected]>
Date: Wed May 29 07:51:50 2024 +0200
patch 9.1.0448: compiler warning in eval.c
Problem: compiler warning in eval.c (after v9.1.0429)
Solution: refactor code (Yegappan Lakshmanan)
fixes: #14847
closes: #14867
Signed-off-by: Yegappan Lakshmanan <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/eval.c b/src/eval.c
index 858361073..b08f29657 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -5761,22 +5761,31 @@ func_tv2string(typval_T *tv, char_u **tofree, int
echo_style)
if (echo_style)
{
- r = tv->vval.v_string == NULL ? (char_u *)"function()"
- : make_ufunc_name_readable(tv->vval.v_string,
- buf, MAX_FUNC_NAME_LEN);
- if (r == buf && tv->vval.v_string != NULL)
+ if (tv->vval.v_string == NULL)
{
- r = vim_strsave(buf);
- *tofree = r;
+ r = (char_u *)"function()";
+ *tofree = NULL;
}
else
- *tofree = NULL;
+ {
+ r = make_ufunc_name_readable(tv->vval.v_string, buf,
+ MAX_FUNC_NAME_LEN);
+ if (r == buf)
+ {
+ r = vim_strsave(buf);
+ *tofree = r;
+ }
+ else
+ *tofree = NULL;
+ }
}
else
{
- *tofree = string_quote(tv->vval.v_string == NULL ? NULL
- : make_ufunc_name_readable(tv->vval.v_string,
- buf, MAX_FUNC_NAME_LEN), TRUE);
+ if (tv->vval.v_string == NULL)
+ *tofree = string_quote(NULL, TRUE);
+ else
+ *tofree = string_quote(make_ufunc_name_readable(tv->vval.v_string,
+ buf, MAX_FUNC_NAME_LEN), TRUE);
r = *tofree;
}
diff --git a/src/version.c b/src/version.c
index 92088fc95..8a1cab3f2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 448,
/**/
447,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1sCCM0-00DhK9-Dv%40256bit.org.