comparison src/tag.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 695d9ef00b03
children ce04ebdf26b8
comparison
equal deleted inserted replaced
16781:db5dc8db015c 16782:fc58fee685e2
1428 } 1428 }
1429 1429
1430 if (name_only) 1430 if (name_only)
1431 mfp = vim_strsave(res_name); 1431 mfp = vim_strsave(res_name);
1432 else 1432 else
1433 mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); 1433 mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
1434 1434
1435 if (mfp == NULL) 1435 if (mfp == NULL)
1436 continue; 1436 continue;
1437 1437
1438 if (!name_only) 1438 if (!name_only)
2534 * detecting duplicates. 2534 * detecting duplicates.
2535 * The format is {tagname}@{lang}NUL{heuristic}NUL 2535 * The format is {tagname}@{lang}NUL{heuristic}NUL
2536 */ 2536 */
2537 *tagp.tagname_end = NUL; 2537 *tagp.tagname_end = NUL;
2538 len = (int)(tagp.tagname_end - tagp.tagname); 2538 len = (int)(tagp.tagname_end - tagp.tagname);
2539 mfp = (char_u *)alloc((int)sizeof(char_u) 2539 mfp = (char_u *)alloc(sizeof(char_u)
2540 + len + 10 + ML_EXTRA + 1); 2540 + len + 10 + ML_EXTRA + 1);
2541 if (mfp != NULL) 2541 if (mfp != NULL)
2542 { 2542 {
2543 int heuristic; 2543 int heuristic;
2544 2544
2583 get_it_again = FALSE; 2583 get_it_again = FALSE;
2584 } 2584 }
2585 else 2585 else
2586 { 2586 {
2587 len = (int)(tagp.tagname_end - tagp.tagname); 2587 len = (int)(tagp.tagname_end - tagp.tagname);
2588 mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); 2588 mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
2589 if (mfp != NULL) 2589 if (mfp != NULL)
2590 vim_strncpy(mfp, tagp.tagname, len); 2590 vim_strncpy(mfp, tagp.tagname, len);
2591 2591
2592 /* if wanted, re-read line to get long form too */ 2592 /* if wanted, re-read line to get long form too */
2593 if (State & INSERT) 2593 if (State & INSERT)
2618 len += (int)ebuf_len + 1; 2618 len += (int)ebuf_len + 1;
2619 } 2619 }
2620 else 2620 else
2621 ++len; 2621 ++len;
2622 #endif 2622 #endif
2623 mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); 2623 mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
2624 if (mfp != NULL) 2624 if (mfp != NULL)
2625 { 2625 {
2626 p = mfp; 2626 p = mfp;
2627 p[0] = mtt + 1; 2627 p[0] = mtt + 1;
2628 STRCPY(p + 1, tag_fname); 2628 STRCPY(p + 1, tag_fname);
3344 char_u *lbuf; 3344 char_u *lbuf;
3345 3345
3346 /* Make a copy of the line, it can become invalid when an autocommand calls 3346 /* Make a copy of the line, it can become invalid when an autocommand calls
3347 * back here recursively. */ 3347 * back here recursively. */
3348 len = matching_line_len(lbuf_arg) + 1; 3348 len = matching_line_len(lbuf_arg) + 1;
3349 lbuf = alloc((int)len); 3349 lbuf = alloc(len);
3350 if (lbuf != NULL) 3350 if (lbuf != NULL)
3351 mch_memmove(lbuf, lbuf_arg, len); 3351 mch_memmove(lbuf, lbuf_arg, len);
3352 3352
3353 pbuf = alloc(LSIZE); 3353 pbuf = alloc(LSIZE);
3354 3354