comparison src/cmdexpand.c @ 27028:c9474ae175f4 v8.2.4043

patch 8.2.4043: using int for second argument of ga_init2() Commit: https://github.com/vim/vim/commit/04935fb17e5f0f66b82cf4546b9752d3d1fa650e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 8 16:19:22 2022 +0000 patch 8.2.4043: using int for second argument of ga_init2() Problem: Using int for second argument of ga_init2(). Solution: Remove unnessary type cast (int) when using sizeof().
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 17:30:04 +0100
parents 06a137af96f8
children 4c7bb6fd383f
comparison
equal deleted inserted replaced
27027:167e35b85720 27028:c9474ae175f4
2340 } 2340 }
2341 2341
2342 // Go over all directories in $PATH. Expand matches in that directory and 2342 // Go over all directories in $PATH. Expand matches in that directory and
2343 // collect them in "ga". When "." is not in $PATH also expand for the 2343 // collect them in "ga". When "." is not in $PATH also expand for the
2344 // current directory, to find "subdir/cmd". 2344 // current directory, to find "subdir/cmd".
2345 ga_init2(&ga, (int)sizeof(char *), 10); 2345 ga_init2(&ga, sizeof(char *), 10);
2346 hash_init(&found_ht); 2346 hash_init(&found_ht);
2347 for (s = path; ; s = e) 2347 for (s = path; ; s = e)
2348 { 2348 {
2349 # if defined(MSWIN) 2349 # if defined(MSWIN)
2350 e = vim_strchr(s, ';'); 2350 e = vim_strchr(s, ';');
2495 2495
2496 retstr = call_user_expand_func(call_func_retstr, xp, num_file, file); 2496 retstr = call_user_expand_func(call_func_retstr, xp, num_file, file);
2497 if (retstr == NULL) 2497 if (retstr == NULL)
2498 return FAIL; 2498 return FAIL;
2499 2499
2500 ga_init2(&ga, (int)sizeof(char *), 3); 2500 ga_init2(&ga, sizeof(char *), 3);
2501 for (s = retstr; *s != NUL; s = e) 2501 for (s = retstr; *s != NUL; s = e)
2502 { 2502 {
2503 e = vim_strchr(s, '\n'); 2503 e = vim_strchr(s, '\n');
2504 if (e == NULL) 2504 if (e == NULL)
2505 e = s + STRLEN(s); 2505 e = s + STRLEN(s);
2541 2541
2542 retlist = call_user_expand_func(call_func_retlist, xp, num_file, file); 2542 retlist = call_user_expand_func(call_func_retlist, xp, num_file, file);
2543 if (retlist == NULL) 2543 if (retlist == NULL)
2544 return FAIL; 2544 return FAIL;
2545 2545
2546 ga_init2(&ga, (int)sizeof(char *), 3); 2546 ga_init2(&ga, sizeof(char *), 3);
2547 // Loop over the items in the list. 2547 // Loop over the items in the list.
2548 FOR_ALL_LIST_ITEMS(retlist, li) 2548 FOR_ALL_LIST_ITEMS(retlist, li)
2549 { 2549 {
2550 if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL) 2550 if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL)
2551 continue; // Skip non-string items and empty strings 2551 continue; // Skip non-string items and empty strings