comparison src/findfile.c @ 16782:fc58fee685e2 v8.1.1393

patch 8.1.1393: unnecessary type casts commit https://github.com/vim/vim/commit/51e14387f120392b74b84408cafec33942337a05 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 25 20:21:28 2019 +0200 patch 8.1.1393: unnecessary type casts Problem: Unnecessary type casts. Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 May 2019 20:30:06 +0200
parents ef00b6bc186b
children ce04ebdf26b8
comparison
equal deleted inserted replaced
16781:db5dc8db015c 16782:fc58fee685e2
586 len = (int)STRLEN(search_ctx->ffsc_fix_path); 586 len = (int)STRLEN(search_ctx->ffsc_fix_path);
587 587
588 if (search_ctx->ffsc_wc_path != NULL) 588 if (search_ctx->ffsc_wc_path != NULL)
589 { 589 {
590 wc_path = vim_strsave(search_ctx->ffsc_wc_path); 590 wc_path = vim_strsave(search_ctx->ffsc_wc_path);
591 temp = alloc((int)(STRLEN(search_ctx->ffsc_wc_path) 591 temp = alloc(STRLEN(search_ctx->ffsc_wc_path)
592 + STRLEN(search_ctx->ffsc_fix_path + len) 592 + STRLEN(search_ctx->ffsc_fix_path + len)
593 + 1)); 593 + 1);
594 if (temp == NULL || wc_path == NULL) 594 if (temp == NULL || wc_path == NULL)
595 { 595 {
596 vim_free(buf); 596 vim_free(buf);
597 vim_free(temp); 597 vim_free(temp);
598 vim_free(wc_path); 598 vim_free(wc_path);
720 720
721 /* 721 /*
722 * filepath is used as buffer for various actions and as the storage to 722 * filepath is used as buffer for various actions and as the storage to
723 * return a found filename. 723 * return a found filename.
724 */ 724 */
725 if ((file_path = alloc((int)MAXPATHL)) == NULL) 725 if ((file_path = alloc(MAXPATHL)) == NULL)
726 return NULL; 726 return NULL;
727 727
728 #ifdef FEAT_PATH_EXTRA 728 #ifdef FEAT_PATH_EXTRA
729 // store the end of the start dir -- needed for upward search 729 // store the end of the start dir -- needed for upward search
730 if (search_ctx->ffsc_start_dir != NULL) 730 if (search_ctx->ffsc_start_dir != NULL)
1864 vim_findfile_cleanup(fdip_search_ctx); 1864 vim_findfile_cleanup(fdip_search_ctx);
1865 fdip_search_ctx = NULL; 1865 fdip_search_ctx = NULL;
1866 break; 1866 break;
1867 } 1867 }
1868 1868
1869 if ((buf = alloc((int)(MAXPATHL))) == NULL) 1869 if ((buf = alloc(MAXPATHL)) == NULL)
1870 break; 1870 break;
1871 1871
1872 // copy next path 1872 // copy next path
1873 buf[0] = 0; 1873 buf[0] = 0;
1874 copy_option_part(&dir, buf, MAXPATHL, " ,"); 1874 copy_option_part(&dir, buf, MAXPATHL, " ,");
2272 ? p_path : curbuf->b_p_path; 2272 ? p_path : curbuf->b_p_path;
2273 char_u *buf; 2273 char_u *buf;
2274 char_u *p; 2274 char_u *p;
2275 int len; 2275 int len;
2276 2276
2277 if ((buf = alloc((int)MAXPATHL)) == NULL) 2277 if ((buf = alloc(MAXPATHL)) == NULL)
2278 return; 2278 return;
2279 2279
2280 while (*path_option != NUL) 2280 while (*path_option != NUL)
2281 { 2281 {
2282 copy_option_part(&path_option, buf, MAXPATHL, " ,"); 2282 copy_option_part(&path_option, buf, MAXPATHL, " ,");
2422 regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); 2422 regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
2423 vim_free(pat); 2423 vim_free(pat);
2424 if (regmatch.regprog == NULL) 2424 if (regmatch.regprog == NULL)
2425 return; 2425 return;
2426 2426
2427 if ((curdir = alloc((int)(MAXPATHL))) == NULL) 2427 if ((curdir = alloc(MAXPATHL)) == NULL)
2428 goto theend; 2428 goto theend;
2429 mch_dirname(curdir, MAXPATHL); 2429 mch_dirname(curdir, MAXPATHL);
2430 expand_path_option(curdir, &path_ga); 2430 expand_path_option(curdir, &path_ga);
2431 2431
2432 in_curdir = (char_u **)alloc_clear(gap->ga_len * sizeof(char_u *)); 2432 in_curdir = (char_u **)alloc_clear(gap->ga_len * sizeof(char_u *));
2530 { 2530 {
2531 STRCPY(fnames[i], short_name); 2531 STRCPY(fnames[i], short_name);
2532 continue; 2532 continue;
2533 } 2533 }
2534 2534
2535 rel_path = alloc((int)(STRLEN(short_name) + STRLEN(PATHSEPSTR) + 2)); 2535 rel_path = alloc(STRLEN(short_name) + STRLEN(PATHSEPSTR) + 2);
2536 if (rel_path == NULL) 2536 if (rel_path == NULL)
2537 goto theend; 2537 goto theend;
2538 STRCPY(rel_path, "."); 2538 STRCPY(rel_path, ".");
2539 add_pathsep(rel_path); 2539 add_pathsep(rel_path);
2540 STRCAT(rel_path, short_name); 2540 STRCAT(rel_path, short_name);