Mercurial > vim
comparison src/spellfile.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 | ce04ebdf26b8 |
comparison
equal
deleted
inserted
replaced
16767:3959544fc067 | 16768:695d9ef00b03 |
---|---|
890 /* <prefcondcnt> <prefcond> ... */ | 890 /* <prefcondcnt> <prefcond> ... */ |
891 cnt = get2c(fd); /* <prefcondcnt> */ | 891 cnt = get2c(fd); /* <prefcondcnt> */ |
892 if (cnt <= 0) | 892 if (cnt <= 0) |
893 return SP_FORMERROR; | 893 return SP_FORMERROR; |
894 | 894 |
895 lp->sl_prefprog = (regprog_T **)alloc_clear( | 895 lp->sl_prefprog = (regprog_T **)alloc_clear(sizeof(regprog_T *) * cnt); |
896 (unsigned)sizeof(regprog_T *) * cnt); | |
897 if (lp->sl_prefprog == NULL) | 896 if (lp->sl_prefprog == NULL) |
898 return SP_OTHERERROR; | 897 return SP_OTHERERROR; |
899 lp->sl_prefixcnt = cnt; | 898 lp->sl_prefixcnt = cnt; |
900 | 899 |
901 for (i = 0; i < cnt; ++i) | 900 for (i = 0; i < cnt; ++i) |
1578 /* Invalid length, multiply with sizeof(int) would overflow. */ | 1577 /* Invalid length, multiply with sizeof(int) would overflow. */ |
1579 return SP_FORMERROR; | 1578 return SP_FORMERROR; |
1580 if (len > 0) | 1579 if (len > 0) |
1581 { | 1580 { |
1582 /* Allocate the byte array. */ | 1581 /* Allocate the byte array. */ |
1583 bp = lalloc((long_u)len, TRUE); | 1582 bp = alloc(len); |
1584 if (bp == NULL) | 1583 if (bp == NULL) |
1585 return SP_OTHERERROR; | 1584 return SP_OTHERERROR; |
1586 *bytsp = bp; | 1585 *bytsp = bp; |
1587 | 1586 |
1588 /* Allocate the index array. */ | 1587 /* Allocate the index array. */ |
1589 ip = (idx_T *)lalloc_clear((long_u)(len * sizeof(int)), TRUE); | 1588 ip = (idx_T *)lalloc_clear(len * sizeof(int), TRUE); |
1590 if (ip == NULL) | 1589 if (ip == NULL) |
1591 return SP_OTHERERROR; | 1590 return SP_OTHERERROR; |
1592 *idxsp = ip; | 1591 *idxsp = ip; |
1593 | 1592 |
1594 /* Recursively read the tree and store it in the array. */ | 1593 /* Recursively read the tree and store it in the array. */ |
4270 { | 4269 { |
4271 if (len >= SBLOCKSIZE) | 4270 if (len >= SBLOCKSIZE) |
4272 bl = NULL; | 4271 bl = NULL; |
4273 else | 4272 else |
4274 /* Allocate a block of memory. It is not freed until much later. */ | 4273 /* Allocate a block of memory. It is not freed until much later. */ |
4275 bl = (sblock_T *)alloc_clear( | 4274 bl = (sblock_T *)alloc_clear(sizeof(sblock_T) + SBLOCKSIZE); |
4276 (unsigned)(sizeof(sblock_T) + SBLOCKSIZE)); | |
4277 if (bl == NULL) | 4275 if (bl == NULL) |
4278 { | 4276 { |
4279 if (!spin->si_did_emsg) | 4277 if (!spin->si_did_emsg) |
4280 { | 4278 { |
4281 emsg(_("E845: Insufficient memory, word list will be incomplete")); | 4279 emsg(_("E845: Insufficient memory, word list will be incomplete")); |