]> granicus.if.org Git - vim/commitdiff
patch 8.2.4043: using int for second argument of ga_init2() v8.2.4043
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 16:19:22 +0000 (16:19 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 16:19:22 +0000 (16:19 +0000)
Problem:    Using int for second argument of ga_init2().
Solution:   Remove unnessary type cast (int) when using sizeof().

36 files changed:
src/arglist.c
src/channel.c
src/cmdexpand.c
src/dict.c
src/digraph.c
src/eval.c
src/evalfunc.c
src/evalvars.c
src/evalwindow.c
src/ex_docmd.c
src/fileio.c
src/filepath.c
src/findfile.c
src/fold.c
src/hardcopy.c
src/help.c
src/if_py_both.h
src/job.c
src/list.c
src/menu.c
src/os_win32.c
src/register.c
src/scriptfile.c
src/spellfile.c
src/spellsuggest.c
src/strings.c
src/syntax.c
src/tag.c
src/terminal.c
src/undo.c
src/usercmd.c
src/userfunc.c
src/version.c
src/vim9execute.c
src/viminfo.c
src/window.c

index 3ca5e4ccce07d9ed1e937d1bb02432131b9782ff..fbd99af0d3d44393b7ad6c8fb799dd3fbdf29366 100644 (file)
@@ -51,7 +51,7 @@ alist_clear(alist_T *al)
     void
 alist_init(alist_T *al)
 {
-    ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
+    ga_init2(&al->al_ga, sizeof(aentry_T), 5);
 }
 
 /*
@@ -275,7 +275,7 @@ do_one_arg(char_u *str)
     static int
 get_arglist(garray_T *gap, char_u *str, int escaped)
 {
-    ga_init2(gap, (int)sizeof(char_u *), 20);
+    ga_init2(gap, sizeof(char_u *), 20);
     while (*str != NUL)
     {
        if (ga_grow(gap, 1) == FAIL)
index 4ab05499a5691b82f1fe73e116c56c024d7f207d..0b8bfb3ba3b71f47c13194d0c632a77c9fc40481 100644 (file)
@@ -2306,7 +2306,7 @@ channel_add_block_id(chanpart_T *chanpart, int id)
     garray_T *gap = &chanpart->ch_block_ids;
 
     if (gap->ga_growsize == 0)
-       ga_init2(gap, (int)sizeof(int), 10);
+       ga_init2(gap, sizeof(int), 10);
     if (ga_grow(gap, 1) == OK)
     {
        ((int *)gap->ga_data)[gap->ga_len] = id;
index e496bc3675703242bdba7824b3c542952bb91772..464dc96c1993a711c48d18382f675b4ec3e6eec0 100644 (file)
@@ -2342,7 +2342,7 @@ expand_shellcmd(
     // Go over all directories in $PATH.  Expand matches in that directory and
     // collect them in "ga".  When "." is not in $PATH also expand for the
     // current directory, to find "subdir/cmd".
-    ga_init2(&ga, (int)sizeof(char *), 10);
+    ga_init2(&ga, sizeof(char *), 10);
     hash_init(&found_ht);
     for (s = path; ; s = e)
     {
@@ -2497,7 +2497,7 @@ ExpandUserDefined(
     if (retstr == NULL)
        return FAIL;
 
-    ga_init2(&ga, (int)sizeof(char *), 3);
+    ga_init2(&ga, sizeof(char *), 3);
     for (s = retstr; *s != NUL; s = e)
     {
        e = vim_strchr(s, '\n');
@@ -2543,7 +2543,7 @@ ExpandUserList(
     if (retlist == NULL)
        return FAIL;
 
-    ga_init2(&ga, (int)sizeof(char *), 3);
+    ga_init2(&ga, sizeof(char *), 3);
     // Loop over the items in the list.
     FOR_ALL_LIST_ITEMS(retlist, li)
     {
index 64c9d5f9e179ea6dbd4ab83a18bd5e5aa4e1cdaa..9c6b7d4532f8e802116c6ee26503209a9602f19c 100644 (file)
@@ -759,7 +759,7 @@ dict2string(typval_T *tv, int copyID, int restore_copyID)
 
     if ((d = tv->vval.v_dict) == NULL)
        return NULL;
-    ga_init2(&ga, (int)sizeof(char), 80);
+    ga_init2(&ga, sizeof(char), 80);
     ga_append(&ga, '{');
 
     todo = (int)d->dv_hashtab.ht_used;
index 4c45e08900dce69e00730634a14c83f6626a7c73..f46e43f23e025d7e22e24ddf1949ef048b411c10 100644 (file)
@@ -2632,7 +2632,7 @@ ex_loadkeymap(exarg_T *eap)
     keymap_unload();
 
     curbuf->b_kmap_state = 0;
-    ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20);
+    ga_init2(&curbuf->b_kmap_ga, sizeof(kmap_T), 20);
 
     // Set 'cpoptions' to "C" to avoid line continuation.
     p_cpo = (char_u *)"C";
index ec896814d46eee96c6ebaca9c6ac9f23dab92822..390bb58110e10ee11afb14229fbd18aaea333cc7 100644 (file)
@@ -487,7 +487,7 @@ typval2string(typval_T *tv, int convert)
 
     if (convert && tv->v_type == VAR_LIST)
     {
-       ga_init2(&ga, (int)sizeof(char), 80);
+       ga_init2(&ga, sizeof(char), 80);
        if (tv->vval.v_list != NULL)
        {
            list_join(&ga, tv->vval.v_list, (char_u *)"\n", TRUE, FALSE, 0);
index bb50d5568f3318ad616f0074d83aa6a60623ed95..949bab8d6b61f14dcbeb6197a2b8de9566d66472 100644 (file)
@@ -3662,7 +3662,7 @@ execute_common(typval_T *argvars, typval_T *rettv, int arg_off)
 
     if (redir_execute)
        save_ga = redir_execute_ga;
-    ga_init2(&redir_execute_ga, (int)sizeof(char), 500);
+    ga_init2(&redir_execute_ga, sizeof(char), 500);
     redir_execute = TRUE;
     redir_off = FALSE;
     if (!echo_output)
index 3be9993fdce0886df637a9fbc5b02d5828b1a0f1..d93fed5b0e96b5081dcddc05ff9cb8c48c6a3edf 100644 (file)
@@ -4025,7 +4025,7 @@ clear_redir_lval(void)
     void
 init_redir_ga(void)
 {
-    ga_init2(&redir_ga, (int)sizeof(char), 500);
+    ga_init2(&redir_ga, sizeof(char), 500);
 }
 
 /*
index 2a97adcf26773e835b5831ee9272dd142237f0b8..d632debe6d263b9efdabab202ccfd09bbaba0cb8 100644 (file)
@@ -1120,7 +1120,7 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
     garray_T   ga;
     char_u     buf[50];
 
-    ga_init2(&ga, (int)sizeof(char), 70);
+    ga_init2(&ga, sizeof(char), 70);
 
     // Do this twice to handle some window layouts properly.
     for (i = 0; i < 2; ++i)
index be95992f74d76751d1010489d9d96872682abbfc..71343590d0537a4a460f4136b310dd28fe85dca5 100644 (file)
@@ -691,7 +691,7 @@ do_cmdline(
 #ifdef FEAT_EVAL
     CLEAR_FIELD(cstack);
     cstack.cs_idx = -1;
-    ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
+    ga_init2(&lines_ga, sizeof(wcmd_T), 10);
 
     real_cookie = getline_cookie(fgetline, cookie);
 
index c33625ad66e4a942d05a9722f0277f4f7bf1d037..1fcf0d983a968728464d5235d783f2f1f79c2bba 100644 (file)
@@ -4774,7 +4774,7 @@ readdir_core(
     struct dirent      *dp;
 # endif
 
-    ga_init2(gap, (int)sizeof(void *), 20);
+    ga_init2(gap, sizeof(void *), 20);
 
 # ifdef FEAT_EVAL
 #  define FREE_ITEM(item)   do { \
index e44fcd0200ccb9f7e2d44df257cf8dc8b87f60f7..eb5b8e050295b63e0adda74cdc6f535f2b980be8 100644 (file)
@@ -1388,7 +1388,7 @@ f_globpath(typval_T *argvars, typval_T *rettv)
     }
     if (file != NULL && !error)
     {
-       ga_init2(&ga, (int)sizeof(char_u *), 10);
+       ga_init2(&ga, sizeof(char_u *), 10);
        globpath(tv_get_string(&argvars[0]), file, &ga, flags);
        if (rettv->v_type == VAR_STRING)
            rettv->vval.v_string = ga_concat_strings(&ga, "\n");
@@ -3908,7 +3908,7 @@ gen_expand_wildcards(
     /*
      * The matching file names are stored in a growarray.  Init it empty.
      */
-    ga_init2(&ga, (int)sizeof(char_u *), 30);
+    ga_init2(&ga, sizeof(char_u *), 30);
 
     for (i = 0; i < num_pat; ++i)
     {
index 230f4870d45bcd5e2b3ff3ebb868b8037035e77f..110e06b1d6e560505ff4b865af4c986adff2ceef 100644 (file)
@@ -2430,7 +2430,7 @@ uniquefy_paths(garray_T *gap, char_u *pattern)
     char_u     *short_name;
 
     remove_duplicates(gap);
-    ga_init2(&path_ga, (int)sizeof(char_u *), 1);
+    ga_init2(&path_ga, sizeof(char_u *), 1);
 
     /*
      * We need to prepend a '*' at the beginning of file_pattern so that the
@@ -2611,7 +2611,7 @@ expand_in_path(
        return 0;
     mch_dirname(curdir, MAXPATHL);
 
-    ga_init2(&path_ga, (int)sizeof(char_u *), 1);
+    ga_init2(&path_ga, sizeof(char_u *), 1);
     expand_path_option(curdir, &path_ga);
     vim_free(curdir);
     if (path_ga.ga_len == 0)
index 5011887fb6e16a7ea18d6a538868fb5fc9ecc91f..f314d7a349e8d13c198261bb26aedd060590f41d 100644 (file)
@@ -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;
 }
 
index 33c72b7112057fc35d646842135177d08e5f6f70..c99dc5fa35444adbd0209be738698bcab58ff38e 100644 (file)
@@ -1650,7 +1650,7 @@ prt_flush_buffer(void)
            prt_write_string("s\n");
 
        ga_clear(&prt_ps_buffer);
-       ga_init2(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz);
+       ga_init2(&prt_ps_buffer, sizeof(char), prt_bufsiz);
     }
 }
 
@@ -2649,7 +2649,7 @@ mch_print_init(
     prt_bufsiz = psettings->chars_per_line;
     if (prt_out_mbyte)
        prt_bufsiz *= 2;
-    ga_init2(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz);
+    ga_init2(&prt_ps_buffer, sizeof(char), prt_bufsiz);
 
     prt_page_num = 0;
 
index fca7cfc48b4ea6c71c9486d0a94c121d08341c0a..16fbafc061dc59b4b03929197d6f478ee2768cc3 100644 (file)
@@ -999,7 +999,7 @@ helptags_one(
 
     // If using the "++t" argument or generating tags for "$VIMRUNTIME/doc"
     // add the "help-tags" tag.
-    ga_init2(&ga, (int)sizeof(char_u *), 100);
+    ga_init2(&ga, sizeof(char_u *), 100);
     if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc",
                                                dir, FALSE, TRUE) == FPC_SAME)
     {
index 5364f6b2f5a81816280dcf1df2a4fcf6a792d891..8e349c55f8220c008723a88a2a72b2360bf66c1d 100644 (file)
@@ -3264,7 +3264,7 @@ FunctionRepr(FunctionObject *self)
     typval_T tv;
     char_u numbuf[NUMBUFLEN];
 
-    ga_init2(&repr_ga, (int)sizeof(char), 70);
+    ga_init2(&repr_ga, sizeof(char), 70);
     ga_concat(&repr_ga, (char_u *)"<vim.Function '");
     if (self->name)
        ga_concat(&repr_ga, self->name);
index 4055415b11e2b38f6a4283739911aaad9949997e..0ed33a78e51f1d07b79384965843e77f6e346846 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -1296,7 +1296,7 @@ job_start(
 
     job->jv_status = JOB_FAILED;
 #ifndef USE_ARGV
-    ga_init2(&ga, (int)sizeof(char*), 20);
+    ga_init2(&ga, sizeof(char*), 20);
 #endif
 
     if (opt_arg != NULL)
@@ -1435,7 +1435,7 @@ job_start(
     {
        garray_T    ga;
 
-       ga_init2(&ga, (int)sizeof(char), 200);
+       ga_init2(&ga, sizeof(char), 200);
        for (i = 0; i < argc; ++i)
        {
            if (i > 0)
index 8658701b45029122c3812d2e402e39232d5e8345..dca5ff0172420bc6751d3cefc94aeb6a9e734f02 100644 (file)
@@ -1299,7 +1299,7 @@ list2string(typval_T *tv, int copyID, int restore_copyID)
 
     if (tv->vval.v_list == NULL)
        return NULL;
-    ga_init2(&ga, (int)sizeof(char), 80);
+    ga_init2(&ga, sizeof(char), 80);
     ga_append(&ga, '[');
     CHECK_LIST_MATERIALIZE(tv->vval.v_list);
     if (list_join(&ga, tv->vval.v_list, (char_u *)", ",
@@ -1412,7 +1412,7 @@ list_join(
 
     if (l->lv_len < 1)
        return OK; // nothing to do
-    ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len);
+    ga_init2(&join_ga, sizeof(join_T), l->lv_len);
     retval = list_join_inner(gap, l, sep, echo_style, restore_copyID,
                                                            copyID, &join_ga);
 
@@ -1461,7 +1461,7 @@ f_join(typval_T *argvars, typval_T *rettv)
 
     if (sep != NULL)
     {
-       ga_init2(&ga, (int)sizeof(char), 80);
+       ga_init2(&ga, sizeof(char), 80);
        list_join(&ga, argvars[0].vval.v_list, sep, TRUE, FALSE, 0);
        ga_append(&ga, NUL);
        rettv->vval.v_string = (char_u *)ga.ga_data;
index 614196aa0b2131052ce75dac705c682fe11ecaac..880a93a6db7bf396eea8ed6c4ddd03646887416d 100644 (file)
@@ -2664,7 +2664,7 @@ ex_menutranslate(exarg_T *eap UNUSED)
     char_u             *from, *from_noamp, *to;
 
     if (menutrans_ga.ga_itemsize == 0)
-       ga_init2(&menutrans_ga, (int)sizeof(menutrans_T), 5);
+       ga_init2(&menutrans_ga, sizeof(menutrans_T), 5);
 
     /*
      * ":menutrans clear": clear all translations.
index fb1b29d71a8e86ec4b88643adbe9a7c7bcb27a89..55df5064d8400dde43d93fd1aee381c9f7c9f58d 100644 (file)
@@ -5280,7 +5280,7 @@ mch_job_start(char *cmd, job_T *job, jobopt_T *options)
     ofd[1] = INVALID_HANDLE_VALUE;
     efd[0] = INVALID_HANDLE_VALUE;
     efd[1] = INVALID_HANDLE_VALUE;
-    ga_init2(&ga, (int)sizeof(wchar_t), 500);
+    ga_init2(&ga, sizeof(wchar_t), 500);
 
     jo = CreateJobObject(NULL, NULL);
     if (jo == NULL)
index 08a73fe9b75b3951a85d317c0fb31abb52b93c77..d604bae6b0debf1729c625e4ddc2412429f0bb02 100644 (file)
@@ -527,7 +527,7 @@ execreg_line_continuation(char_u **lines, long *idx)
     int                j;
     char_u     *str;
 
-    ga_init2(&ga, (int)sizeof(char_u), 400);
+    ga_init2(&ga, sizeof(char_u), 400);
 
     // search backwards to find the first line of this command.
     // Any line not starting with \ or "\ is the start of the
index 8fb3cae015a75df6028c574e6ff2d2a22bccd106..c10a82f2cbf8f62b6aa66a99c5a451fc4161d0e1 100644 (file)
@@ -835,7 +835,7 @@ ExpandRTDir(
     *num_file = 0;
     *file = NULL;
     pat_len = (int)STRLEN(pat);
-    ga_init2(&ga, (int)sizeof(char *), 10);
+    ga_init2(&ga, sizeof(char *), 10);
 
     for (i = 0; dirnames[i] != NULL; ++i)
     {
@@ -929,7 +929,7 @@ ExpandPackAddDir(
     *num_file = 0;
     *file = NULL;
     pat_len = (int)STRLEN(pat);
-    ga_init2(&ga, (int)sizeof(char *), 10);
+    ga_init2(&ga, sizeof(char *), 10);
 
     s = alloc(pat_len + 26);
     if (s == NULL)
@@ -1833,7 +1833,7 @@ getsourceline(
        {
            garray_T    ga;
 
-           ga_init2(&ga, (int)sizeof(char_u), 400);
+           ga_init2(&ga, sizeof(char_u), 400);
            ga_concat(&ga, line);
            if (*p == '\\')
                ga_concat(&ga, p + 1);
index c00930dfeda186ec6a46e85ef0f7144d95976d78..af6c6ef2f9c7fd6eafc89b06329ec55061f25ae6 100644 (file)
@@ -5905,12 +5905,12 @@ mkspell(
     spin.si_ascii = ascii;
     spin.si_followup = TRUE;
     spin.si_rem_accents = TRUE;
-    ga_init2(&spin.si_rep, (int)sizeof(fromto_T), 20);
-    ga_init2(&spin.si_repsal, (int)sizeof(fromto_T), 20);
-    ga_init2(&spin.si_sal, (int)sizeof(fromto_T), 20);
-    ga_init2(&spin.si_map, (int)sizeof(char_u), 100);
-    ga_init2(&spin.si_comppat, (int)sizeof(char_u *), 20);
-    ga_init2(&spin.si_prefcond, (int)sizeof(char_u *), 50);
+    ga_init2(&spin.si_rep, sizeof(fromto_T), 20);
+    ga_init2(&spin.si_repsal, sizeof(fromto_T), 20);
+    ga_init2(&spin.si_sal, sizeof(fromto_T), 20);
+    ga_init2(&spin.si_map, sizeof(char_u), 100);
+    ga_init2(&spin.si_comppat, sizeof(char_u *), 20);
+    ga_init2(&spin.si_prefcond, sizeof(char_u *), 50);
     hash_init(&spin.si_commonwords);
     spin.si_newcompID = 127;   // start compound ID at first maximum
 
index e9f2cd570a247f8fe9cdfa2d12fa35de81751611..b2b402919fb44f671a069e71cd096b39e613192d 100644 (file)
@@ -774,8 +774,8 @@ spell_find_suggest(
 
     // Set the info in "*su".
     CLEAR_POINTER(su);
-    ga_init2(&su->su_ga, (int)sizeof(suggest_T), 10);
-    ga_init2(&su->su_sga, (int)sizeof(suggest_T), 10);
+    ga_init2(&su->su_ga, sizeof(suggest_T), 10);
+    ga_init2(&su->su_sga, sizeof(suggest_T), 10);
     if (*badptr == NUL)
        return;
     hash_init(&su->su_banned);
@@ -2943,7 +2943,7 @@ score_combine(suginfo_T *su)
     check_suggestions(su, &su->su_sga);
     (void)cleanup_suggestions(&su->su_sga, su->su_maxscore, su->su_maxcount);
 
-    ga_init2(&ga, (int)sizeof(suginfo_T), 1);
+    ga_init2(&ga, sizeof(suginfo_T), 1);
     if (ga_grow(&ga, su->su_ga.ga_len + su->su_sga.ga_len) == FAIL)
        return;
 
index 5c55c1ecbf36d2955840993092d7ebafb3c29f14..f6affd6fe068adac713357873be7cc716e19bdf0 100644 (file)
@@ -893,7 +893,7 @@ string_filter_map(
     // set_vim_var_nr() doesn't set the type
     set_vim_var_type(VV_KEY, VAR_NUMBER);
 
-    ga_init2(&ga, (int)sizeof(char), 80);
+    ga_init2(&ga, sizeof(char), 80);
     for (p = str; *p != NUL; p += len)
     {
        typval_T newtv;
@@ -1673,7 +1673,7 @@ f_tr(typval_T *argvars, typval_T *rettv)
     rettv->vval.v_string = NULL;
     if (fromstr == NULL || tostr == NULL)
            return;             // type error; errmsg already given
-    ga_init2(&ga, (int)sizeof(char), 80);
+    ga_init2(&ga, sizeof(char), 80);
 
     if (!has_mbyte)
        // not multi-byte: fromstr and tostr must be the same length
index f4d7f1d421f2cec84c4f2f63a6eff4101f51878d..d2e15a36c7b78cab23574843078c87d8d2d6c03f 100644 (file)
@@ -1414,7 +1414,7 @@ store_current_state(void)
        {
            // Need to clear it, might be something remaining from when the
            // length was less than SST_FIX_STATES.
-           ga_init2(&sp->sst_union.sst_ga, (int)sizeof(bufstate_T), 1);
+           ga_init2(&sp->sst_union.sst_ga, sizeof(bufstate_T), 1);
            if (ga_grow(&sp->sst_union.sst_ga, current_state.ga_len) == FAIL)
                sp->sst_stacksize = 0;
            else
@@ -1833,7 +1833,7 @@ syn_current_attr(
 
     // Init the list of zero-width matches with a nextlist.  This is used to
     // avoid matching the same item in the same position twice.
-    ga_init2(&zero_width_next_ga, (int)sizeof(int), 10);
+    ga_init2(&zero_width_next_ga, sizeof(int), 10);
 
     // use syntax iskeyword option
     save_chartab(buf_chartab);
index bf816e16a8f9775f596ead65c81d0227be83edeb..346e63c213d6d7dd0c21969170e0f243b2c3bbbb 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -1752,7 +1752,7 @@ find_tags(
 #endif
     for (mtt = 0; mtt < MT_COUNT; ++mtt)
     {
-       ga_init2(&ga_match[mtt], (int)sizeof(char_u *), 100);
+       ga_init2(&ga_match[mtt], sizeof(char_u *), 100);
        hash_init(&ht_match[mtt]);
     }
 
@@ -2952,7 +2952,7 @@ get_tagfname(
        if (first)
        {
            ga_clear_strings(&tag_fnames);
-           ga_init2(&tag_fnames, (int)sizeof(char_u *), 10);
+           ga_init2(&tag_fnames, sizeof(char_u *), 10);
            do_in_runtimepath((char_u *)
 #ifdef FEAT_MULTI_LANG
 # ifdef VMS
index ab66ace444e49c8c03e40f41851922b5c54ed30f..281c673e8bf36255e84cdc0dc3724215569bdc9d 100644 (file)
@@ -6674,8 +6674,8 @@ conpty_term_and_job_init(
     HANDLE         i_ours = NULL;
     HANDLE         o_ours = NULL;
 
-    ga_init2(&ga_cmd, (int)sizeof(char*), 20);
-    ga_init2(&ga_env, (int)sizeof(char*), 20);
+    ga_init2(&ga_cmd, sizeof(char*), 20);
+    ga_init2(&ga_env, sizeof(char*), 20);
 
     if (argvar->v_type == VAR_STRING)
     {
@@ -7022,8 +7022,8 @@ winpty_term_and_job_init(
     garray_T       ga_cmd, ga_env;
     char_u         *cmd = NULL;
 
-    ga_init2(&ga_cmd, (int)sizeof(char*), 20);
-    ga_init2(&ga_env, (int)sizeof(char*), 20);
+    ga_init2(&ga_cmd, sizeof(char*), 20);
+    ga_init2(&ga_env, sizeof(char*), 20);
 
     if (argvar->v_type == VAR_STRING)
     {
index ec972f0b64359d08eee3c27615e8be0372362ba5..4d186d45325949f2cb942ac7e7bc4ab1f6345561 100644 (file)
@@ -3081,7 +3081,7 @@ ex_undolist(exarg_T *eap UNUSED)
      */
     mark = ++lastmark;
     nomark = ++lastmark;
-    ga_init2(&ga, (int)sizeof(char *), 20);
+    ga_init2(&ga, sizeof(char *), 20);
 
     uhp = curbuf->b_u_oldhead;
     while (uhp != NULL)
index 40790a1f56319c95260cb4d54f96dbcf8d0c527a..2830a50386ae7c106eed8e0477cafe2a61e00798 100644 (file)
@@ -917,7 +917,7 @@ uc_add_command(
     {
        gap = &curbuf->b_ucmds;
        if (gap->ga_itemsize == 0)
-           ga_init2(gap, (int)sizeof(ucmd_T), 4);
+           ga_init2(gap, sizeof(ucmd_T), 4);
     }
     else
        gap = &ucmds;
index 020d1bcfcb1942715f07c29ef5f2b8214ce65749..b772913f1591646712403eb1bd1f789d13b6a6ad 100644 (file)
@@ -222,11 +222,11 @@ get_function_args(
     char_u     *whitep = *argp;
 
     if (newargs != NULL)
-       ga_init2(newargs, (int)sizeof(char_u *), 3);
+       ga_init2(newargs, sizeof(char_u *), 3);
     if (argtypes != NULL)
-       ga_init2(argtypes, (int)sizeof(char_u *), 3);
+       ga_init2(argtypes, sizeof(char_u *), 3);
     if (!skip && default_args != NULL)
-       ga_init2(default_args, (int)sizeof(char_u *), 3);
+       ga_init2(default_args, sizeof(char_u *), 3);
 
     if (varargs != NULL)
        *varargs = FALSE;
@@ -1149,7 +1149,7 @@ lambda_function_body(
        eap.cookie = evalarg->eval_cookie;
     }
 
-    ga_init2(&newlines, (int)sizeof(char_u *), 10);
+    ga_init2(&newlines, sizeof(char_u *), 10);
     if (get_function_body(&eap, &newlines, NULL,
                                             &evalarg->eval_tofree_ga) == FAIL)
        goto erret;
@@ -1436,7 +1436,7 @@ get_lambda_tv(
        if (pt == NULL)
            goto errret;
 
-       ga_init2(&newlines, (int)sizeof(char_u *), 1);
+       ga_init2(&newlines, sizeof(char_u *), 1);
        if (ga_grow(&newlines, 1) == FAIL)
            goto errret;
 
@@ -1760,7 +1760,7 @@ get_func_tv(
            // Prepare for calling test_garbagecollect_now(), need to know
            // what variables are used on the call stack.
            if (funcargs.ga_itemsize == 0)
-               ga_init2(&funcargs, (int)sizeof(typval_T *), 50);
+               ga_init2(&funcargs, sizeof(typval_T *), 50);
            for (i = 0; i < argcount; ++i)
                if (ga_grow(&funcargs, 1) == OK)
                    ((typval_T **)funcargs.ga_data)[funcargs.ga_len++] =
@@ -4173,7 +4173,7 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
        goto ret_free;
     }
 
-    ga_init2(&newlines, (int)sizeof(char_u *), 10);
+    ga_init2(&newlines, sizeof(char_u *), 10);
 
     if (!eap->skip && name_arg == NULL)
     {
index 579718e7b02372e72621de6095872ede7bd3b9c2..cdfadebdad77c66f50cfcfca28d4ea879c7f95b1 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4043,
 /**/
     4042,
 /**/
index 5fab27dc435a6606d9f3316e13cda328ad831e3d..311baca016ac6ed112364d37bfd2b63d9fe8f1fb 100644 (file)
@@ -174,7 +174,7 @@ static garray_T dict_stack = GA_EMPTY;
 dict_stack_save(typval_T *tv)
 {
     if (dict_stack.ga_growsize == 0)
-       ga_init2(&dict_stack, (int)sizeof(typval_T), 10);
+       ga_init2(&dict_stack, sizeof(typval_T), 10);
     if (ga_grow(&dict_stack, 1) == FAIL)
        return FAIL;
     ((typval_T *)dict_stack.ga_data)[dict_stack.ga_len] = *tv;
index ac0d3856e7f9f7df1af60d4a6c53704b9dfd3800..3620b58de57b505df07fceda1054220a4b3f3836 100644 (file)
@@ -2912,7 +2912,7 @@ do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
        return;
     vir.vir_fd = fp_in;
     vir.vir_conv.vc_type = CONV_NONE;
-    ga_init2(&vir.vir_barlines, (int)sizeof(char_u *), 100);
+    ga_init2(&vir.vir_barlines, sizeof(char_u *), 100);
     vir.vir_version = -1;
 
     if (fp_in != NULL)
index 4a17c6241e2a6fb868522b1be40511ae06e6f60a..6d5d0a4b8a834405645d4dd1aa80fc88bea70add 100644 (file)
@@ -5413,7 +5413,7 @@ win_size_save(garray_T *gap)
 {
     win_T      *wp;
 
-    ga_init2(gap, (int)sizeof(int), 1);
+    ga_init2(gap, sizeof(int), 1);
     if (ga_grow(gap, win_count() * 2 + 1) == OK)
     {
        // first entry is value of 'lines'