Mercurial > vim
comparison src/ex_cmds.c @ 16768:695d9ef00b03 v8.1.1386
patch 8.1.1386: unessesary type casts for lalloc()
commit https://github.com/vim/vim/commit/18a4ba29aeccb9841d5bfdd2eaaffdfae2f15ced
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 19:39:03 2019 +0200
patch 8.1.1386: unessesary type casts for lalloc()
Problem: Unessesary type casts for lalloc().
Solution: Remove type casts. Change lalloc(size, TRUE) to alloc(size).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 19:45:05 +0200 |
parents | ef00b6bc186b |
children | fc58fee685e2 |
comparison
equal
deleted
inserted
replaced
16767:3959544fc067 | 16768:695d9ef00b03 |
---|---|
395 if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL) | 395 if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL) |
396 return; | 396 return; |
397 sortbuf1 = NULL; | 397 sortbuf1 = NULL; |
398 sortbuf2 = NULL; | 398 sortbuf2 = NULL; |
399 regmatch.regprog = NULL; | 399 regmatch.regprog = NULL; |
400 nrs = (sorti_T *)lalloc((long_u)(count * sizeof(sorti_T)), TRUE); | 400 nrs = (sorti_T *)alloc(count * sizeof(sorti_T)); |
401 if (nrs == NULL) | 401 if (nrs == NULL) |
402 goto sortend; | 402 goto sortend; |
403 | 403 |
404 sort_abort = sort_ic = sort_rx = sort_nr = 0; | 404 sort_abort = sort_ic = sort_rx = sort_nr = 0; |
405 #ifdef FEAT_FLOAT | 405 #ifdef FEAT_FLOAT |
791 } | 791 } |
792 | 792 |
793 /* len is actual number of white characters used */ | 793 /* len is actual number of white characters used */ |
794 len = num_spaces + num_tabs; | 794 len = num_spaces + num_tabs; |
795 old_len = (long)STRLEN(ptr); | 795 old_len = (long)STRLEN(ptr); |
796 new_line = lalloc(old_len - col + start_col + len + 1, | 796 new_line = alloc(old_len - col + start_col + len + 1); |
797 TRUE); | |
798 if (new_line == NULL) | 797 if (new_line == NULL) |
799 break; | 798 break; |
800 if (start_col > 0) | 799 if (start_col > 0) |
801 mch_memmove(new_line, ptr, (size_t)start_col); | 800 mch_memmove(new_line, ptr, (size_t)start_col); |
802 mch_memmove(new_line + start_col + len, | 801 mch_memmove(new_line + start_col + len, |
1743 len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */ | 1742 len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */ |
1744 if (itmp != NULL) | 1743 if (itmp != NULL) |
1745 len += (long_u)STRLEN(itmp) + 9; /* " { < " + " } " */ | 1744 len += (long_u)STRLEN(itmp) + 9; /* " { < " + " } " */ |
1746 if (otmp != NULL) | 1745 if (otmp != NULL) |
1747 len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* " " */ | 1746 len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* " " */ |
1748 buf = lalloc(len, TRUE); | 1747 buf = alloc(len); |
1749 if (buf == NULL) | 1748 if (buf == NULL) |
1750 return NULL; | 1749 return NULL; |
1751 | 1750 |
1752 #if defined(UNIX) | 1751 #if defined(UNIX) |
1753 /* | 1752 /* |
2534 long len; | 2533 long len; |
2535 | 2534 |
2536 if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1])) | 2535 if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1])) |
2537 { | 2536 { |
2538 len = atol((char *)virp->vir_line + off + 1); | 2537 len = atol((char *)virp->vir_line + off + 1); |
2539 retval = lalloc(len, TRUE); | 2538 retval = alloc(len); |
2540 if (retval == NULL) | 2539 if (retval == NULL) |
2541 { | 2540 { |
2542 /* Line too long? File messed up? Skip next line. */ | 2541 /* Line too long? File messed up? Skip next line. */ |
2543 (void)vim_fgets(virp->vir_line, 10, virp->vir_fd); | 2542 (void)vim_fgets(virp->vir_line, 10, virp->vir_fd); |
2544 return NULL; | 2543 return NULL; |