Mercurial > vim
comparison src/list.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 | ac75c145f0a9 |
children | 4c1bdee75bed |
comparison
equal
deleted
inserted
replaced
27027:167e35b85720 | 27028:c9474ae175f4 |
---|---|
1297 { | 1297 { |
1298 garray_T ga; | 1298 garray_T ga; |
1299 | 1299 |
1300 if (tv->vval.v_list == NULL) | 1300 if (tv->vval.v_list == NULL) |
1301 return NULL; | 1301 return NULL; |
1302 ga_init2(&ga, (int)sizeof(char), 80); | 1302 ga_init2(&ga, sizeof(char), 80); |
1303 ga_append(&ga, '['); | 1303 ga_append(&ga, '['); |
1304 CHECK_LIST_MATERIALIZE(tv->vval.v_list); | 1304 CHECK_LIST_MATERIALIZE(tv->vval.v_list); |
1305 if (list_join(&ga, tv->vval.v_list, (char_u *)", ", | 1305 if (list_join(&ga, tv->vval.v_list, (char_u *)", ", |
1306 FALSE, restore_copyID, copyID) == FAIL) | 1306 FALSE, restore_copyID, copyID) == FAIL) |
1307 { | 1307 { |
1410 join_T *p; | 1410 join_T *p; |
1411 int i; | 1411 int i; |
1412 | 1412 |
1413 if (l->lv_len < 1) | 1413 if (l->lv_len < 1) |
1414 return OK; // nothing to do | 1414 return OK; // nothing to do |
1415 ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len); | 1415 ga_init2(&join_ga, sizeof(join_T), l->lv_len); |
1416 retval = list_join_inner(gap, l, sep, echo_style, restore_copyID, | 1416 retval = list_join_inner(gap, l, sep, echo_style, restore_copyID, |
1417 copyID, &join_ga); | 1417 copyID, &join_ga); |
1418 | 1418 |
1419 // Dispose each item in join_ga. | 1419 // Dispose each item in join_ga. |
1420 if (join_ga.ga_data != NULL) | 1420 if (join_ga.ga_data != NULL) |
1459 else | 1459 else |
1460 sep = tv_get_string_chk(&argvars[1]); | 1460 sep = tv_get_string_chk(&argvars[1]); |
1461 | 1461 |
1462 if (sep != NULL) | 1462 if (sep != NULL) |
1463 { | 1463 { |
1464 ga_init2(&ga, (int)sizeof(char), 80); | 1464 ga_init2(&ga, sizeof(char), 80); |
1465 list_join(&ga, argvars[0].vval.v_list, sep, TRUE, FALSE, 0); | 1465 list_join(&ga, argvars[0].vval.v_list, sep, TRUE, FALSE, 0); |
1466 ga_append(&ga, NUL); | 1466 ga_append(&ga, NUL); |
1467 rettv->vval.v_string = (char_u *)ga.ga_data; | 1467 rettv->vval.v_string = (char_u *)ga.ga_data; |
1468 } | 1468 } |
1469 else | 1469 else |