aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_eval.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-08-21 08:16:47 +0300
committerZyX <kp-pav@yandex.ru>2017-03-29 10:08:05 +0300
commit28dafe3ff0b0dc082fb62b2251fd64a167ce7188 (patch)
treeea9d18e94f1a3bc01ef9b18614c5d3caa4dea12c /src/nvim/ex_eval.c
parent5cdf7177ec71e4b9b3295ead93bedf7ff226a2b2 (diff)
downloadrneovim-28dafe3ff0b0dc082fb62b2251fd64a167ce7188.tar.gz
rneovim-28dafe3ff0b0dc082fb62b2251fd64a167ce7188.tar.bz2
rneovim-28dafe3ff0b0dc082fb62b2251fd64a167ce7188.zip
eval,*: Move get_tv_string to typval.c
Function was renamed and changed to return `const char *`.
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r--src/nvim/ex_eval.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index 7a34a181e2..3f71ae1795 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -1149,23 +1149,25 @@ void ex_endwhile(exarg_T *eap)
*/
void ex_throw(exarg_T *eap)
{
- char_u *arg = eap->arg;
- char_u *value;
+ const char *arg = (const char *)eap->arg;
+ char *value;
- if (*arg != NUL && *arg != '|' && *arg != '\n')
- value = eval_to_string_skip(arg, &eap->nextcmd, eap->skip);
- else {
+ if (*arg != NUL && *arg != '|' && *arg != '\n') {
+ value = eval_to_string_skip(arg, (const char **)&eap->nextcmd,
+ (bool)eap->skip);
+ } else {
EMSG(_(e_argreq));
value = NULL;
}
- /* On error or when an exception is thrown during argument evaluation, do
- * not throw. */
+ // On error or when an exception is thrown during argument evaluation, do
+ // not throw.
if (!eap->skip && value != NULL) {
- if (throw_exception(value, ET_USER, NULL) == FAIL)
+ if (throw_exception((char_u *)value, ET_USER, NULL) == FAIL) {
xfree(value);
- else
+ } else {
do_throw(eap->cstack);
+ }
}
}