vim-patch:8.0.0075

Problem:    Using number for exception type lacks type checking.
Solution:   Use an enum.

8a5883b748
This commit is contained in:
Jurica Bradaric
2017-07-25 18:53:47 +02:00
parent 5a0acd09c1
commit 09470eb673
4 changed files with 23 additions and 27 deletions

View File

@@ -374,10 +374,9 @@ int do_intthrow(struct condstack *cstack)
return TRUE;
}
/*
* Get an exception message that is to be stored in current_exception->value.
*/
char_u *get_exception_string(void *value, int type, char_u *cmdname, int *should_free)
// Get an exception message that is to be stored in current_exception->value.
char_u *get_exception_string(void *value, except_type_T type, char_u *cmdname,
int *should_free)
{
char_u *ret, *mesg;
char_u *p, *val;
@@ -435,13 +434,11 @@ char_u *get_exception_string(void *value, int type, char_u *cmdname, int *should
}
/*
* Throw a new exception. Return FAIL when out of memory or it was tried to
* throw an illegal user exception. "value" is the exception string for a
* user or interrupt exception, or points to a message list in case of an
* error exception.
*/
static int throw_exception(void *value, int type, char_u *cmdname)
// Throw a new exception. Return FAIL when out of memory or it was tried to
// throw an illegal user exception. "value" is the exception string for a
// user or interrupt exception, or points to a message list in case of an
// error exception.
static int throw_exception(void *value, except_type_T type, char_u *cmdname)
{
except_T *excp;
int should_free;