eval,*: Move get_tv_string to typval.c

Function was renamed and changed to return `const char *`.
This commit is contained in:
ZyX
2016-08-21 08:16:47 +03:00
parent 5cdf7177ec
commit 28dafe3ff0
28 changed files with 1072 additions and 992 deletions

View File

@@ -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);
}
}
}