Patch 8.2.4043

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 8, 2022, 11:19:54 AM1/8/22
to vim...@googlegroups.com

Patch 8.2.4043
Problem: Using int for second argument of ga_init2().
Solution: Remove unnessary type cast (int) when using sizeof().
Files: 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/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/vim9execute.c,
src/viminfo.c, src/window.c, src/if_py_both.h


*** ../vim-8.2.4042/src/arglist.c 2022-01-01 14:19:44.028353885 +0000
--- src/arglist.c 2022-01-08 15:47:36.414198213 +0000
***************
*** 51,57 ****
void
alist_init(alist_T *al)
{
! ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
}

/*
--- 51,57 ----
void
alist_init(alist_T *al)
{
! ga_init2(&al->al_ga, sizeof(aentry_T), 5);
}

/*
***************
*** 275,281 ****
static int
get_arglist(garray_T *gap, char_u *str, int escaped)
{
! ga_init2(gap, (int)sizeof(char_u *), 20);
while (*str != NUL)
{
if (ga_grow(gap, 1) == FAIL)
--- 275,281 ----
static int
get_arglist(garray_T *gap, char_u *str, int escaped)
{
! ga_init2(gap, sizeof(char_u *), 20);
while (*str != NUL)
{
if (ga_grow(gap, 1) == FAIL)
*** ../vim-8.2.4042/src/channel.c 2022-01-05 20:24:34.268005660 +0000
--- src/channel.c 2022-01-08 15:47:49.586083629 +0000
***************
*** 2306,2312 ****
garray_T *gap = &chanpart->ch_block_ids;

if (gap->ga_growsize == 0)
! ga_init2(gap, (int)sizeof(int), 10);
if (ga_grow(gap, 1) == OK)
{
((int *)gap->ga_data)[gap->ga_len] = id;
--- 2306,2312 ----
garray_T *gap = &chanpart->ch_block_ids;

if (gap->ga_growsize == 0)
! ga_init2(gap, sizeof(int), 10);
if (ga_grow(gap, 1) == OK)
{
((int *)gap->ga_data)[gap->ga_len] = id;
*** ../vim-8.2.4042/src/cmdexpand.c 2022-01-01 14:19:44.032353878 +0000
--- src/cmdexpand.c 2022-01-08 15:48:19.389824094 +0000
***************
*** 2342,2348 ****
// 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);
hash_init(&found_ht);
for (s = path; ; s = e)
{
--- 2342,2348 ----
// 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, sizeof(char *), 10);
hash_init(&found_ht);
for (s = path; ; s = e)
{
***************
*** 2497,2503 ****
if (retstr == NULL)
return FAIL;

! ga_init2(&ga, (int)sizeof(char *), 3);
for (s = retstr; *s != NUL; s = e)
{
e = vim_strchr(s, '\n');
--- 2497,2503 ----
if (retstr == NULL)
return FAIL;

! ga_init2(&ga, sizeof(char *), 3);
for (s = retstr; *s != NUL; s = e)
{
e = vim_strchr(s, '\n');
***************
*** 2543,2549 ****
if (retlist == NULL)
return FAIL;

! ga_init2(&ga, (int)sizeof(char *), 3);
// Loop over the items in the list.
FOR_ALL_LIST_ITEMS(retlist, li)
{
--- 2543,2549 ----
if (retlist == NULL)
return FAIL;

! ga_init2(&ga, sizeof(char *), 3);
// Loop over the items in the list.
FOR_ALL_LIST_ITEMS(retlist, li)
{
*** ../vim-8.2.4042/src/dict.c 2022-01-04 21:30:43.533800364 +0000
--- src/dict.c 2022-01-08 15:48:24.109783000 +0000
***************
*** 759,765 ****

if ((d = tv->vval.v_dict) == NULL)
return NULL;
! ga_init2(&ga, (int)sizeof(char), 80);
ga_append(&ga, '{');

todo = (int)d->dv_hashtab.ht_used;
--- 759,765 ----

if ((d = tv->vval.v_dict) == NULL)
return NULL;
! ga_init2(&ga, sizeof(char), 80);
ga_append(&ga, '{');

todo = (int)d->dv_hashtab.ht_used;
*** ../vim-8.2.4042/src/digraph.c 2022-01-05 16:08:59.516426454 +0000
--- src/digraph.c 2022-01-08 15:48:39.077652649 +0000
***************
*** 2632,2638 ****
keymap_unload();

curbuf->b_kmap_state = 0;
! ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20);

// Set 'cpoptions' to "C" to avoid line continuation.
p_cpo = (char_u *)"C";
--- 2632,2638 ----
keymap_unload();

curbuf->b_kmap_state = 0;
! ga_init2(&curbuf->b_kmap_ga, sizeof(kmap_T), 20);

// Set 'cpoptions' to "C" to avoid line continuation.
p_cpo = (char_u *)"C";
*** ../vim-8.2.4042/src/eval.c 2022-01-08 12:41:12.200795557 +0000
--- src/eval.c 2022-01-08 15:48:52.605534827 +0000
***************
*** 487,493 ****

if (convert && tv->v_type == VAR_LIST)
{
! ga_init2(&ga, (int)sizeof(char), 80);
if (tv->vval.v_list != NULL)
{
list_join(&ga, tv->vval.v_list, (char_u *)"\n", TRUE, FALSE, 0);
--- 487,493 ----

if (convert && tv->v_type == VAR_LIST)
{
! 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);
*** ../vim-8.2.4042/src/evalfunc.c 2022-01-08 12:41:12.204795554 +0000
--- src/evalfunc.c 2022-01-08 15:49:11.681368716 +0000
***************
*** 3662,3668 ****

if (redir_execute)
save_ga = redir_execute_ga;
! ga_init2(&redir_execute_ga, (int)sizeof(char), 500);
redir_execute = TRUE;
redir_off = FALSE;
if (!echo_output)
--- 3662,3668 ----

if (redir_execute)
save_ga = redir_execute_ga;
! ga_init2(&redir_execute_ga, sizeof(char), 500);
redir_execute = TRUE;
redir_off = FALSE;
if (!echo_output)
*** ../vim-8.2.4042/src/evalvars.c 2022-01-08 15:44:18.047924769 +0000
--- src/evalvars.c 2022-01-08 15:49:26.773237296 +0000
***************
*** 4025,4031 ****
void
init_redir_ga(void)
{
! ga_init2(&redir_ga, (int)sizeof(char), 500);
}

/*
--- 4025,4031 ----
void
init_redir_ga(void)
{
! ga_init2(&redir_ga, sizeof(char), 500);
}

/*
*** ../vim-8.2.4042/src/evalwindow.c 2022-01-07 14:07:58.811008543 +0000
--- src/evalwindow.c 2022-01-08 15:49:49.161042312 +0000
***************
*** 1120,1126 ****
garray_T ga;
char_u buf[50];

! ga_init2(&ga, (int)sizeof(char), 70);

// Do this twice to handle some window layouts properly.
for (i = 0; i < 2; ++i)
--- 1120,1126 ----
garray_T ga;
char_u buf[50];

! ga_init2(&ga, sizeof(char), 70);

// Do this twice to handle some window layouts properly.
for (i = 0; i < 2; ++i)
*** ../vim-8.2.4042/src/ex_docmd.c 2022-01-08 12:41:12.204795554 +0000
--- src/ex_docmd.c 2022-01-08 15:49:53.677002976 +0000
***************
*** 691,697 ****
#ifdef FEAT_EVAL
CLEAR_FIELD(cstack);
cstack.cs_idx = -1;
! ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);

real_cookie = getline_cookie(fgetline, cookie);

--- 691,697 ----
#ifdef FEAT_EVAL
CLEAR_FIELD(cstack);
cstack.cs_idx = -1;
! ga_init2(&lines_ga, sizeof(wcmd_T), 10);

real_cookie = getline_cookie(fgetline, cookie);

*** ../vim-8.2.4042/src/fileio.c 2022-01-05 17:49:10.873225135 +0000
--- src/fileio.c 2022-01-08 15:50:10.464856809 +0000
***************
*** 4774,4780 ****
struct dirent *dp;
# endif

! ga_init2(gap, (int)sizeof(void *), 20);

# ifdef FEAT_EVAL
# define FREE_ITEM(item) do { \
--- 4774,4780 ----
struct dirent *dp;
# endif

! ga_init2(gap, sizeof(void *), 20);

# ifdef FEAT_EVAL
# define FREE_ITEM(item) do { \
*** ../vim-8.2.4042/src/filepath.c 2022-01-04 21:30:43.537800355 +0000
--- src/filepath.c 2022-01-08 15:50:24.840731647 +0000
***************
*** 1388,1394 ****
}
if (file != NULL && !error)
{
! ga_init2(&ga, (int)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");
--- 1388,1394 ----
}
if (file != NULL && !error)
{
! 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,3914 ****
/*
* The matching file names are stored in a growarray. Init it empty.
*/
! ga_init2(&ga, (int)sizeof(char_u *), 30);

for (i = 0; i < num_pat; ++i)
{
--- 3908,3914 ----
/*
* The matching file names are stored in a growarray. Init it empty.
*/
! ga_init2(&ga, sizeof(char_u *), 30);

for (i = 0; i < num_pat; ++i)
{
*** ../vim-8.2.4042/src/findfile.c 2022-01-05 17:49:10.873225135 +0000
--- src/findfile.c 2022-01-08 15:50:40.220597737 +0000
***************
*** 2430,2436 ****
char_u *short_name;

remove_duplicates(gap);
! ga_init2(&path_ga, (int)sizeof(char_u *), 1);

/*
* We need to prepend a '*' at the beginning of file_pattern so that the
--- 2430,2436 ----
char_u *short_name;

remove_duplicates(gap);
! ga_init2(&path_ga, sizeof(char_u *), 1);

/*
* We need to prepend a '*' at the beginning of file_pattern so that the
***************
*** 2611,2617 ****
return 0;
mch_dirname(curdir, MAXPATHL);

! ga_init2(&path_ga, (int)sizeof(char_u *), 1);
expand_path_option(curdir, &path_ga);
vim_free(curdir);
if (path_ga.ga_len == 0)
--- 2611,2617 ----
return 0;
mch_dirname(curdir, MAXPATHL);

! ga_init2(&path_ga, sizeof(char_u *), 1);
expand_path_option(curdir, &path_ga);
vim_free(curdir);
if (path_ga.ga_len == 0)
*** ../vim-8.2.4042/src/fold.c 2022-01-02 20:20:41.377033186 +0000
--- src/fold.c 2022-01-08 15:51:03.560394536 +0000
***************
*** 647,653 ****
if (ga_grow(gap, 1) == OK)
{
fp = (fold_T *)gap->ga_data + i;
! ga_init2(&fold_ga, (int)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)
--- 647,653 ----
if (ga_grow(gap, 1) == OK)
{
fp = (fold_T *)gap->ga_data + i;
! 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,1024 ****
void
foldInitWin(win_T *new_win)
{
! ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10);
}

// find_wl_entry() {{{2
--- 1018,1024 ----
void
foldInitWin(win_T *new_win)
{
! ga_init2(&new_win->w_folds, sizeof(fold_T), 10);
}

// find_wl_entry() {{{2
***************
*** 2868,2874 ****
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);
return OK;
}

--- 2868,2874 ----
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, sizeof(fold_T), 10);
return OK;
}

*** ../vim-8.2.4042/src/hardcopy.c 2022-01-04 21:30:43.537800355 +0000
--- src/hardcopy.c 2022-01-08 15:51:21.348239667 +0000
***************
*** 1650,1656 ****
prt_write_string("s\n");

ga_clear(&prt_ps_buffer);
! ga_init2(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz);
}
}

--- 1650,1656 ----
prt_write_string("s\n");

ga_clear(&prt_ps_buffer);
! ga_init2(&prt_ps_buffer, sizeof(char), prt_bufsiz);
}
}

***************
*** 2649,2655 ****
prt_bufsiz = psettings->chars_per_line;
if (prt_out_mbyte)
prt_bufsiz *= 2;
! ga_init2(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz);

prt_page_num = 0;

--- 2649,2655 ----
prt_bufsiz = psettings->chars_per_line;
if (prt_out_mbyte)
prt_bufsiz *= 2;
! ga_init2(&prt_ps_buffer, sizeof(char), prt_bufsiz);

prt_page_num = 0;

*** ../vim-8.2.4042/src/help.c 2022-01-05 20:24:34.272005652 +0000
--- src/help.c 2022-01-08 15:51:25.496203550 +0000
***************
*** 999,1005 ****

// If using the "++t" argument or generating tags for "$VIMRUNTIME/doc"
// add the "help-tags" tag.
! ga_init2(&ga, (int)sizeof(char_u *), 100);
if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc",
dir, FALSE, TRUE) == FPC_SAME)
{
--- 999,1005 ----

// If using the "++t" argument or generating tags for "$VIMRUNTIME/doc"
// add the "help-tags" tag.
! ga_init2(&ga, sizeof(char_u *), 100);
if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc",
dir, FALSE, TRUE) == FPC_SAME)
{
*** ../vim-8.2.4042/src/job.c 2022-01-05 20:24:34.276005641 +0000
--- src/job.c 2022-01-08 15:51:54.451951479 +0000
***************
*** 1296,1302 ****

job->jv_status = JOB_FAILED;
#ifndef USE_ARGV
! ga_init2(&ga, (int)sizeof(char*), 20);
#endif

if (opt_arg != NULL)
--- 1296,1302 ----

job->jv_status = JOB_FAILED;
#ifndef USE_ARGV
! ga_init2(&ga, sizeof(char*), 20);
#endif

if (opt_arg != NULL)
***************
*** 1435,1441 ****
{
garray_T ga;

! ga_init2(&ga, (int)sizeof(char), 200);
for (i = 0; i < argc; ++i)
{
if (i > 0)
--- 1435,1441 ----
{
garray_T ga;

! ga_init2(&ga, sizeof(char), 200);
for (i = 0; i < argc; ++i)
{
if (i > 0)
*** ../vim-8.2.4042/src/list.c 2022-01-05 20:24:34.276005641 +0000
--- src/list.c 2022-01-08 15:52:19.103736895 +0000
***************
*** 1299,1305 ****

if (tv->vval.v_list == NULL)
return NULL;
! ga_init2(&ga, (int)sizeof(char), 80);
ga_append(&ga, '[');
CHECK_LIST_MATERIALIZE(tv->vval.v_list);
if (list_join(&ga, tv->vval.v_list, (char_u *)", ",
--- 1299,1305 ----

if (tv->vval.v_list == NULL)
return NULL;
! 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,1418 ****

if (l->lv_len < 1)
return OK; // nothing to do
! ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len);
retval = list_join_inner(gap, l, sep, echo_style, restore_copyID,
copyID, &join_ga);

--- 1412,1418 ----

if (l->lv_len < 1)
return OK; // nothing to do
! 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,1467 ****

if (sep != NULL)
{
! ga_init2(&ga, (int)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;
--- 1461,1467 ----

if (sep != NULL)
{
! 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;
*** ../vim-8.2.4042/src/menu.c 2022-01-05 16:08:59.520426444 +0000
--- src/menu.c 2022-01-08 15:52:39.103562822 +0000
***************
*** 2664,2670 ****
char_u *from, *from_noamp, *to;

if (menutrans_ga.ga_itemsize == 0)
! ga_init2(&menutrans_ga, (int)sizeof(menutrans_T), 5);

/*
* ":menutrans clear": clear all translations.
--- 2664,2670 ----
char_u *from, *from_noamp, *to;

if (menutrans_ga.ga_itemsize == 0)
! ga_init2(&menutrans_ga, sizeof(menutrans_T), 5);

/*
* ":menutrans clear": clear all translations.
*** ../vim-8.2.4042/src/os_win32.c 2022-01-02 19:25:22.850078488 +0000
--- src/os_win32.c 2022-01-08 15:52:56.719409483 +0000
***************
*** 5280,5286 ****
ofd[1] = INVALID_HANDLE_VALUE;
efd[0] = INVALID_HANDLE_VALUE;
efd[1] = INVALID_HANDLE_VALUE;
! ga_init2(&ga, (int)sizeof(wchar_t), 500);

jo = CreateJobObject(NULL, NULL);
if (jo == NULL)
--- 5280,5286 ----
ofd[1] = INVALID_HANDLE_VALUE;
efd[0] = INVALID_HANDLE_VALUE;
efd[1] = INVALID_HANDLE_VALUE;
! ga_init2(&ga, sizeof(wchar_t), 500);

jo = CreateJobObject(NULL, NULL);
if (jo == NULL)
*** ../vim-8.2.4042/src/register.c 2022-01-08 12:41:12.208795550 +0000
--- src/register.c 2022-01-08 15:53:14.015258946 +0000
***************
*** 527,533 ****
int j;
char_u *str;

! ga_init2(&ga, (int)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
--- 527,533 ----
int j;
char_u *str;

! 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
*** ../vim-8.2.4042/src/scriptfile.c 2022-01-08 12:41:12.208795550 +0000
--- src/scriptfile.c 2022-01-08 15:53:47.702965779 +0000
***************
*** 835,841 ****
*num_file = 0;
*file = NULL;
pat_len = (int)STRLEN(pat);
! ga_init2(&ga, (int)sizeof(char *), 10);

for (i = 0; dirnames[i] != NULL; ++i)
{
--- 835,841 ----
*num_file = 0;
*file = NULL;
pat_len = (int)STRLEN(pat);
! ga_init2(&ga, sizeof(char *), 10);

for (i = 0; dirnames[i] != NULL; ++i)
{
***************
*** 929,935 ****
*num_file = 0;
*file = NULL;
pat_len = (int)STRLEN(pat);
! ga_init2(&ga, (int)sizeof(char *), 10);

s = alloc(pat_len + 26);
if (s == NULL)
--- 929,935 ----
*num_file = 0;
*file = NULL;
pat_len = (int)STRLEN(pat);
! ga_init2(&ga, sizeof(char *), 10);

s = alloc(pat_len + 26);
if (s == NULL)
***************
*** 1833,1839 ****
{
garray_T ga;

! ga_init2(&ga, (int)sizeof(char_u), 400);
ga_concat(&ga, line);
if (*p == '\\')
ga_concat(&ga, p + 1);
--- 1833,1839 ----
{
garray_T ga;

! ga_init2(&ga, sizeof(char_u), 400);
ga_concat(&ga, line);
if (*p == '\\')
ga_concat(&ga, p + 1);
*** ../vim-8.2.4042/src/spellfile.c 2022-01-05 17:49:10.881225127 +0000
--- src/spellfile.c 2022-01-08 15:54:16.210717668 +0000
***************
*** 5905,5916 ****
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);
hash_init(&spin.si_commonwords);
spin.si_newcompID = 127; // start compound ID at first maximum

--- 5905,5916 ----
spin.si_ascii = ascii;
spin.si_followup = TRUE;
spin.si_rem_accents = TRUE;
! 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

*** ../vim-8.2.4042/src/spellsuggest.c 2022-01-01 14:19:44.052353829 +0000
--- src/spellsuggest.c 2022-01-08 15:54:48.354437931 +0000
***************
*** 774,781 ****

// 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);
if (*badptr == NUL)
return;
hash_init(&su->su_banned);
--- 774,781 ----

// Set the info in "*su".
CLEAR_POINTER(su);
! 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,2949 ****
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);
if (ga_grow(&ga, su->su_ga.ga_len + su->su_sga.ga_len) == FAIL)
return;

--- 2943,2949 ----
check_suggestions(su, &su->su_sga);
(void)cleanup_suggestions(&su->su_sga, su->su_maxscore, su->su_maxcount);

! ga_init2(&ga, sizeof(suginfo_T), 1);
if (ga_grow(&ga, su->su_ga.ga_len + su->su_sga.ga_len) == FAIL)
return;

*** ../vim-8.2.4042/src/strings.c 2022-01-05 17:49:10.881225127 +0000
--- src/strings.c 2022-01-08 15:55:03.390307074 +0000
***************
*** 893,899 ****
// set_vim_var_nr() doesn't set the type
set_vim_var_type(VV_KEY, VAR_NUMBER);

! ga_init2(&ga, (int)sizeof(char), 80);
for (p = str; *p != NUL; p += len)
{
typval_T newtv;
--- 893,899 ----
// set_vim_var_nr() doesn't set the type
set_vim_var_type(VV_KEY, VAR_NUMBER);

! ga_init2(&ga, sizeof(char), 80);
for (p = str; *p != NUL; p += len)
{
typval_T newtv;
***************
*** 1673,1679 ****
rettv->vval.v_string = NULL;
if (fromstr == NULL || tostr == NULL)
return; // type error; errmsg already given
! ga_init2(&ga, (int)sizeof(char), 80);

if (!has_mbyte)
// not multi-byte: fromstr and tostr must be the same length
--- 1673,1679 ----
rettv->vval.v_string = NULL;
if (fromstr == NULL || tostr == NULL)
return; // type error; errmsg already given
! ga_init2(&ga, sizeof(char), 80);

if (!has_mbyte)
// not multi-byte: fromstr and tostr must be the same length
*** ../vim-8.2.4042/src/syntax.c 2022-01-05 20:24:34.280005633 +0000
--- src/syntax.c 2022-01-08 15:55:17.778181894 +0000
***************
*** 1414,1420 ****
{
// 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);
if (ga_grow(&sp->sst_union.sst_ga, current_state.ga_len) == FAIL)
sp->sst_stacksize = 0;
else
--- 1414,1420 ----
{
// 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, sizeof(bufstate_T), 1);
if (ga_grow(&sp->sst_union.sst_ga, current_state.ga_len) == FAIL)
sp->sst_stacksize = 0;
else
***************
*** 1833,1839 ****

// 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);

// use syntax iskeyword option
save_chartab(buf_chartab);
--- 1833,1839 ----

// 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, sizeof(int), 10);

// use syntax iskeyword option
save_chartab(buf_chartab);
*** ../vim-8.2.4042/src/tag.c 2022-01-08 12:41:12.208795550 +0000
--- src/tag.c 2022-01-08 15:55:33.362046237 +0000
***************
*** 1752,1758 ****
#endif
for (mtt = 0; mtt < MT_COUNT; ++mtt)
{
! ga_init2(&ga_match[mtt], (int)sizeof(char_u *), 100);
hash_init(&ht_match[mtt]);
}

--- 1752,1758 ----
#endif
for (mtt = 0; mtt < MT_COUNT; ++mtt)
{
! ga_init2(&ga_match[mtt], sizeof(char_u *), 100);
hash_init(&ht_match[mtt]);
}

***************
*** 2952,2958 ****
if (first)
{
ga_clear_strings(&tag_fnames);
! ga_init2(&tag_fnames, (int)sizeof(char_u *), 10);
do_in_runtimepath((char_u *)
#ifdef FEAT_MULTI_LANG
# ifdef VMS
--- 2952,2958 ----
if (first)
{
ga_clear_strings(&tag_fnames);
! ga_init2(&tag_fnames, sizeof(char_u *), 10);
do_in_runtimepath((char_u *)
#ifdef FEAT_MULTI_LANG
# ifdef VMS
*** ../vim-8.2.4042/src/terminal.c 2022-01-05 20:24:34.280005633 +0000
--- src/terminal.c 2022-01-08 15:56:04.141778205 +0000
***************
*** 6674,6681 ****
HANDLE i_ours = NULL;
HANDLE o_ours = NULL;

! ga_init2(&ga_cmd, (int)sizeof(char*), 20);
! ga_init2(&ga_env, (int)sizeof(char*), 20);

if (argvar->v_type == VAR_STRING)
{
--- 6674,6681 ----
HANDLE i_ours = NULL;
HANDLE o_ours = NULL;

! ga_init2(&ga_cmd, sizeof(char*), 20);
! ga_init2(&ga_env, sizeof(char*), 20);

if (argvar->v_type == VAR_STRING)
{
***************
*** 7022,7029 ****
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);

if (argvar->v_type == VAR_STRING)
{
--- 7022,7029 ----
garray_T ga_cmd, ga_env;
char_u *cmd = NULL;

! ga_init2(&ga_cmd, sizeof(char*), 20);
! ga_init2(&ga_env, sizeof(char*), 20);

if (argvar->v_type == VAR_STRING)
{
*** ../vim-8.2.4042/src/undo.c 2022-01-05 20:24:34.280005633 +0000
--- src/undo.c 2022-01-08 15:56:13.589695935 +0000
***************
*** 3081,3087 ****
*/
mark = ++lastmark;
nomark = ++lastmark;
! ga_init2(&ga, (int)sizeof(char *), 20);

uhp = curbuf->b_u_oldhead;
while (uhp != NULL)
--- 3081,3087 ----
*/
mark = ++lastmark;
nomark = ++lastmark;
! ga_init2(&ga, sizeof(char *), 20);

uhp = curbuf->b_u_oldhead;
while (uhp != NULL)
*** ../vim-8.2.4042/src/usercmd.c 2022-01-08 15:39:35.414385257 +0000
--- src/usercmd.c 2022-01-08 15:56:23.165612528 +0000
***************
*** 917,923 ****
{
gap = &curbuf->b_ucmds;
if (gap->ga_itemsize == 0)
! ga_init2(gap, (int)sizeof(ucmd_T), 4);
}
else
gap = &ucmds;
--- 917,923 ----
{
gap = &curbuf->b_ucmds;
if (gap->ga_itemsize == 0)
! ga_init2(gap, sizeof(ucmd_T), 4);
}
else
gap = &ucmds;
*** ../vim-8.2.4042/src/userfunc.c 2022-01-08 15:39:35.410385289 +0000
--- src/userfunc.c 2022-01-08 15:57:09.625207913 +0000
***************
*** 222,232 ****
char_u *whitep = *argp;

if (newargs != NULL)
! ga_init2(newargs, (int)sizeof(char_u *), 3);
if (argtypes != NULL)
! ga_init2(argtypes, (int)sizeof(char_u *), 3);
if (!skip && default_args != NULL)
! ga_init2(default_args, (int)sizeof(char_u *), 3);

if (varargs != NULL)
*varargs = FALSE;
--- 222,232 ----
char_u *whitep = *argp;

if (newargs != NULL)
! ga_init2(newargs, sizeof(char_u *), 3);
if (argtypes != NULL)
! ga_init2(argtypes, sizeof(char_u *), 3);
if (!skip && default_args != NULL)
! ga_init2(default_args, sizeof(char_u *), 3);

if (varargs != NULL)
*varargs = FALSE;
***************
*** 1149,1155 ****
eap.cookie = evalarg->eval_cookie;
}

! ga_init2(&newlines, (int)sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL,
&evalarg->eval_tofree_ga) == FAIL)
goto erret;
--- 1149,1155 ----
eap.cookie = evalarg->eval_cookie;
}

! ga_init2(&newlines, sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL,
&evalarg->eval_tofree_ga) == FAIL)
goto erret;
***************
*** 1436,1442 ****
if (pt == NULL)
goto errret;

! ga_init2(&newlines, (int)sizeof(char_u *), 1);
if (ga_grow(&newlines, 1) == FAIL)
goto errret;

--- 1436,1442 ----
if (pt == NULL)
goto errret;

! ga_init2(&newlines, sizeof(char_u *), 1);
if (ga_grow(&newlines, 1) == FAIL)
goto errret;

***************
*** 1760,1766 ****
// 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);
for (i = 0; i < argcount; ++i)
if (ga_grow(&funcargs, 1) == OK)
((typval_T **)funcargs.ga_data)[funcargs.ga_len++] =
--- 1760,1766 ----
// 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, 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,4179 ****
goto ret_free;
}

! ga_init2(&newlines, (int)sizeof(char_u *), 10);

if (!eap->skip && name_arg == NULL)
{
--- 4173,4179 ----
goto ret_free;
}

! ga_init2(&newlines, sizeof(char_u *), 10);

if (!eap->skip && name_arg == NULL)
{
*** ../vim-8.2.4042/src/vim9execute.c 2022-01-08 16:02:56.134191299 +0000
--- src/vim9execute.c 2022-01-08 16:02:20.870498285 +0000
***************
*** 174,180 ****
dict_stack_save(typval_T *tv)
{
if (dict_stack.ga_growsize == 0)
! ga_init2(&dict_stack, (int)sizeof(typval_T), 10);
if (ga_grow(&dict_stack, 1) == FAIL)
return FAIL;
((typval_T *)dict_stack.ga_data)[dict_stack.ga_len] = *tv;
--- 174,180 ----
dict_stack_save(typval_T *tv)
{
if (dict_stack.ga_growsize == 0)
! 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;
*** ../vim-8.2.4042/src/viminfo.c 2022-01-08 15:39:35.414385257 +0000
--- src/viminfo.c 2022-01-08 15:57:56.468800014 +0000
***************
*** 2912,2918 ****
return;
vir.vir_fd = fp_in;
vir.vir_conv.vc_type = CONV_NONE;
! ga_init2(&vir.vir_barlines, (int)sizeof(char_u *), 100);
vir.vir_version = -1;

if (fp_in != NULL)
--- 2912,2918 ----
return;
vir.vir_fd = fp_in;
vir.vir_conv.vc_type = CONV_NONE;
! ga_init2(&vir.vir_barlines, sizeof(char_u *), 100);
vir.vir_version = -1;

if (fp_in != NULL)
*** ../vim-8.2.4042/src/window.c 2022-01-05 17:49:10.885225126 +0000
--- src/window.c 2022-01-08 15:58:08.592694459 +0000
***************
*** 5413,5419 ****
{
win_T *wp;

! ga_init2(gap, (int)sizeof(int), 1);
if (ga_grow(gap, win_count() * 2 + 1) == OK)
{
// first entry is value of 'lines'
--- 5413,5419 ----
{
win_T *wp;

! ga_init2(gap, sizeof(int), 1);
if (ga_grow(gap, win_count() * 2 + 1) == OK)
{
// first entry is value of 'lines'
*** ../vim-8.2.4042/src/if_py_both.h 2022-01-06 13:24:45.793265684 +0000
--- src/if_py_both.h 2022-01-08 15:58:26.640537342 +0000
***************
*** 3264,3270 ****
typval_T tv;
char_u numbuf[NUMBUFLEN];

! ga_init2(&repr_ga, (int)sizeof(char), 70);
ga_concat(&repr_ga, (char_u *)"<vim.Function '");
if (self->name)
ga_concat(&repr_ga, self->name);
--- 3264,3270 ----
typval_T tv;
char_u numbuf[NUMBUFLEN];

! ga_init2(&repr_ga, sizeof(char), 70);
ga_concat(&repr_ga, (char_u *)"<vim.Function '");
if (self->name)
ga_concat(&repr_ga, self->name);
*** ../vim-8.2.4042/src/version.c 2022-01-08 16:02:56.134191299 +0000
--- src/version.c 2022-01-08 16:06:41.132232531 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4043,
/**/

--
hundred-and-one symptoms of being an internet addict:
265. Your reason for not staying in touch with family is that
they do not have e-mail addresses.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages