Mercurial > vim
comparison src/eval.c @ 7598:1a528724f9d6 v7.4.1098
commit https://github.com/vim/vim/commit/b7604cc19fa1db6a8182546bf662aa13d4574d7a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 15 21:23:22 2016 +0100
patch 7.4.1098
Problem: Still using old style C function declarations.
Solution: Always define __ARGS() to include types. Turn a few functions
into ANSI style to find out if this causes problems for anyone.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 15 Jan 2016 21:30:05 +0100 |
parents | 87e607fb6853 |
children | fa59fafb6a94 |
comparison
equal
deleted
inserted
replaced
7597:3012eaddb6b2 | 7598:1a528724f9d6 |
---|---|
971 | 971 |
972 /* | 972 /* |
973 * Return the name of the executed function. | 973 * Return the name of the executed function. |
974 */ | 974 */ |
975 char_u * | 975 char_u * |
976 func_name(cookie) | 976 func_name(void *cookie) |
977 void *cookie; | |
978 { | 977 { |
979 return ((funccall_T *)cookie)->func->uf_name; | 978 return ((funccall_T *)cookie)->func->uf_name; |
980 } | 979 } |
981 | 980 |
982 /* | 981 /* |
991 | 990 |
992 /* | 991 /* |
993 * Return the address holding the debug tick for a funccall cookie. | 992 * Return the address holding the debug tick for a funccall cookie. |
994 */ | 993 */ |
995 int * | 994 int * |
996 func_dbg_tick(cookie) | 995 func_dbg_tick(void *cookie) |
997 void *cookie; | |
998 { | 996 { |
999 return &((funccall_T *)cookie)->dbg_tick; | 997 return &((funccall_T *)cookie)->dbg_tick; |
1000 } | 998 } |
1001 | 999 |
1002 /* | 1000 /* |
1003 * Return the nesting level for a funccall cookie. | 1001 * Return the nesting level for a funccall cookie. |
1004 */ | 1002 */ |
1005 int | 1003 int |
1006 func_level(cookie) | 1004 func_level(void *cookie) |
1007 void *cookie; | |
1008 { | 1005 { |
1009 return ((funccall_T *)cookie)->level; | 1006 return ((funccall_T *)cookie)->level; |
1010 } | 1007 } |
1011 | 1008 |
1012 /* pointer to funccal for currently active function */ | 1009 /* pointer to funccal for currently active function */ |
1029 /* | 1026 /* |
1030 * Set an internal variable to a string value. Creates the variable if it does | 1027 * Set an internal variable to a string value. Creates the variable if it does |
1031 * not already exist. | 1028 * not already exist. |
1032 */ | 1029 */ |
1033 void | 1030 void |
1034 set_internal_string_var(name, value) | 1031 set_internal_string_var(char_u *name, char_u *value) |
1035 char_u *name; | |
1036 char_u *value; | |
1037 { | 1032 { |
1038 char_u *val; | 1033 char_u *val; |
1039 typval_T *tvp; | 1034 typval_T *tvp; |
1040 | 1035 |
1041 val = vim_strsave(value); | 1036 val = vim_strsave(value); |
1055 static char_u *redir_endp = NULL; | 1050 static char_u *redir_endp = NULL; |
1056 static char_u *redir_varname = NULL; | 1051 static char_u *redir_varname = NULL; |
1057 | 1052 |
1058 /* | 1053 /* |
1059 * Start recording command output to a variable | 1054 * Start recording command output to a variable |
1055 * When "append" is TRUE append to an existing variable. | |
1060 * Returns OK if successfully completed the setup. FAIL otherwise. | 1056 * Returns OK if successfully completed the setup. FAIL otherwise. |
1061 */ | 1057 */ |
1062 int | 1058 int |
1063 var_redir_start(name, append) | 1059 var_redir_start(char_u *name, int append) |
1064 char_u *name; | |
1065 int append; /* append to an existing variable */ | |
1066 { | 1060 { |
1067 int save_emsg; | 1061 int save_emsg; |
1068 int err; | 1062 int err; |
1069 typval_T tv; | 1063 typval_T tv; |
1070 | 1064 |
1137 * :redir => foo | 1131 * :redir => foo |
1138 * :let foo | 1132 * :let foo |
1139 * :redir END | 1133 * :redir END |
1140 */ | 1134 */ |
1141 void | 1135 void |
1142 var_redir_str(value, value_len) | 1136 var_redir_str(char_u *value, int value_len) |
1143 char_u *value; | |
1144 int value_len; | |
1145 { | 1137 { |
1146 int len; | 1138 int len; |
1147 | 1139 |
1148 if (redir_lval == NULL) | 1140 if (redir_lval == NULL) |
1149 return; | 1141 return; |
1199 redir_varname = NULL; | 1191 redir_varname = NULL; |
1200 } | 1192 } |
1201 | 1193 |
1202 # if defined(FEAT_MBYTE) || defined(PROTO) | 1194 # if defined(FEAT_MBYTE) || defined(PROTO) |
1203 int | 1195 int |
1204 eval_charconvert(enc_from, enc_to, fname_from, fname_to) | 1196 eval_charconvert( |
1205 char_u *enc_from; | 1197 char_u *enc_from, |
1206 char_u *enc_to; | 1198 char_u *enc_to, |
1207 char_u *fname_from; | 1199 char_u *fname_from, |
1208 char_u *fname_to; | 1200 char_u *fname_to) |
1209 { | 1201 { |
1210 int err = FALSE; | 1202 int err = FALSE; |
1211 | 1203 |
1212 set_vim_var_string(VV_CC_FROM, enc_from, -1); | 1204 set_vim_var_string(VV_CC_FROM, enc_from, -1); |
1213 set_vim_var_string(VV_CC_TO, enc_to, -1); | 1205 set_vim_var_string(VV_CC_TO, enc_to, -1); |