Mercurial > vim
diff src/fold.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 | 3631d2deb36c |
children | e11682ba8c80 |
line wrap: on
line diff
--- a/src/fold.c +++ b/src/fold.c @@ -647,7 +647,7 @@ foldCreate(linenr_T start, linenr_T end) if (ga_grow(gap, 1) == OK) { fp = (fold_T *)gap->ga_data + i; - ga_init2(&fold_ga, (int)sizeof(fold_T), 10); + ga_init2(&fold_ga, sizeof(fold_T), 10); // Count number of folds that will be contained in the new fold. for (cont = 0; i + cont < gap->ga_len; ++cont) @@ -1018,7 +1018,7 @@ foldMoveTo( void foldInitWin(win_T *new_win) { - ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10); + ga_init2(&new_win->w_folds, sizeof(fold_T), 10); } // find_wl_entry() {{{2 @@ -2868,7 +2868,7 @@ foldInsert(garray_T *gap, int i) if (gap->ga_len > 0 && i < gap->ga_len) mch_memmove(fp + 1, fp, sizeof(fold_T) * (gap->ga_len - i)); ++gap->ga_len; - ga_init2(&fp->fd_nested, (int)sizeof(fold_T), 10); + ga_init2(&fp->fd_nested, sizeof(fold_T), 10); return OK; }