Mercurial > vim
comparison src/evalfunc.c @ 19013:dd9ab0674eec v8.2.0067
patch 8.2.0067: ERROR_UNKNOWN clashes on some systems
Commit: https://github.com/vim/vim/commit/ef140544f6703a7a4c0f6a15f610508ed6b09e89
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 31 21:27:13 2019 +0100
patch 8.2.0067: ERROR_UNKNOWN clashes on some systems
Problem: ERROR_UNKNOWN clashes on some systems.
Solution: Rename ERROR_ to FCERR_. (Ola S?der, closes https://github.com/vim/vim/issues/5415)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 31 Dec 2019 21:30:04 +0100 |
parents | bf8eb950df61 |
children | f0312cf3c792 |
comparison
equal
deleted
inserted
replaced
19012:5eb079827641 | 19013:dd9ab0674eec |
---|---|
974 { | 974 { |
975 int i; | 975 int i; |
976 | 976 |
977 i = find_internal_func(name); | 977 i = find_internal_func(name); |
978 if (i < 0) | 978 if (i < 0) |
979 return ERROR_UNKNOWN; | 979 return FCERR_UNKNOWN; |
980 if (argcount < global_functions[i].f_min_argc) | 980 if (argcount < global_functions[i].f_min_argc) |
981 return ERROR_TOOFEW; | 981 return FCERR_TOOFEW; |
982 if (argcount > global_functions[i].f_max_argc) | 982 if (argcount > global_functions[i].f_max_argc) |
983 return ERROR_TOOMANY; | 983 return FCERR_TOOMANY; |
984 argvars[argcount].v_type = VAR_UNKNOWN; | 984 argvars[argcount].v_type = VAR_UNKNOWN; |
985 global_functions[i].f_func(argvars, rettv); | 985 global_functions[i].f_func(argvars, rettv); |
986 return ERROR_NONE; | 986 return FCERR_NONE; |
987 } | 987 } |
988 | 988 |
989 /* | 989 /* |
990 * Invoke a method for base->method(). | 990 * Invoke a method for base->method(). |
991 */ | 991 */ |
1001 int fi; | 1001 int fi; |
1002 typval_T argv[MAX_FUNC_ARGS + 1]; | 1002 typval_T argv[MAX_FUNC_ARGS + 1]; |
1003 | 1003 |
1004 fi = find_internal_func(name); | 1004 fi = find_internal_func(name); |
1005 if (fi < 0) | 1005 if (fi < 0) |
1006 return ERROR_UNKNOWN; | 1006 return FCERR_UNKNOWN; |
1007 if (global_functions[fi].f_argtype == 0) | 1007 if (global_functions[fi].f_argtype == 0) |
1008 return ERROR_NOTMETHOD; | 1008 return FCERR_NOTMETHOD; |
1009 if (argcount + 1 < global_functions[fi].f_min_argc) | 1009 if (argcount + 1 < global_functions[fi].f_min_argc) |
1010 return ERROR_TOOFEW; | 1010 return FCERR_TOOFEW; |
1011 if (argcount + 1 > global_functions[fi].f_max_argc) | 1011 if (argcount + 1 > global_functions[fi].f_max_argc) |
1012 return ERROR_TOOMANY; | 1012 return FCERR_TOOMANY; |
1013 | 1013 |
1014 if (global_functions[fi].f_argtype == FEARG_LAST) | 1014 if (global_functions[fi].f_argtype == FEARG_LAST) |
1015 { | 1015 { |
1016 // base value goes last | 1016 // base value goes last |
1017 for (i = 0; i < argcount; ++i) | 1017 for (i = 0; i < argcount; ++i) |
1053 argv[i + 1] = argvars[i]; | 1053 argv[i + 1] = argvars[i]; |
1054 } | 1054 } |
1055 argv[argcount + 1].v_type = VAR_UNKNOWN; | 1055 argv[argcount + 1].v_type = VAR_UNKNOWN; |
1056 | 1056 |
1057 global_functions[fi].f_func(argv, rettv); | 1057 global_functions[fi].f_func(argv, rettv); |
1058 return ERROR_NONE; | 1058 return FCERR_NONE; |
1059 } | 1059 } |
1060 | 1060 |
1061 /* | 1061 /* |
1062 * Return TRUE for a non-zero Number and a non-empty String. | 1062 * Return TRUE for a non-zero Number and a non-empty String. |
1063 */ | 1063 */ |