Refactor vim_tempname

- temp_count is uint32_t now instead of long because it supposed to be
  at most 999999999 (comment on line 5227) temporary files. The most
  probably it was a long for compatibility with systems where int is
  16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
This commit is contained in:
Pavel Platto
2014-06-19 23:46:51 +03:00
committed by Nicolas Hillegeer
parent edd7a8c5dd
commit 29e0cd1571
12 changed files with 26 additions and 43 deletions

View File

@@ -14030,7 +14030,7 @@ static void f_system(typval_T *argvars, typval_T *rettv)
* Write the string to a temp file, to be used for input of the shell
* command.
*/
if ((infile = vim_tempname('i')) == NULL) {
if ((infile = vim_tempname()) == NULL) {
EMSG(_(e_notmp));
goto done;
}
@@ -14231,22 +14231,8 @@ static void f_taglist(typval_T *argvars, typval_T *rettv)
*/
static void f_tempname(typval_T *argvars, typval_T *rettv)
{
static int x = 'A';
rettv->v_type = VAR_STRING;
rettv->vval.v_string = vim_tempname(x);
/* Advance 'x' to use A-Z and 0-9, so that there are at least 34 different
* names. Skip 'I' and 'O', they are used for shell redirection. */
do {
if (x == 'Z')
x = '0';
else if (x == '9')
x = 'A';
else {
++x;
}
} while (x == 'I' || x == 'O');
rettv->vval.v_string = vim_tempname();
}
/*