summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
commit964b3746b9c81e65887e2ac9a335f181db2bb592 (patch)
tree9afaaac41a1c4f71b359fd6706b88df00e22e7a1 /src/spell.c
parentd33a764123a8aedb20cd84aeff3b94810ee67c4c (diff)
downloadvim-git-964b3746b9c81e65887e2ac9a335f181db2bb592.tar.gz
patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384
Problem: Using "int" for alloc() often results in compiler warnings. Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim only works with 32 bit ints anyway.
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/spell.c b/src/spell.c
index fbe20802c..fa5be8be1 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -2083,7 +2083,7 @@ count_common_word(
hi = hash_lookup(&lp->sl_wordcount, p, hash);
if (HASHITEM_EMPTY(hi))
{
- wc = (wordcount_T *)alloc((unsigned)(sizeof(wordcount_T) + STRLEN(p)));
+ wc = (wordcount_T *)alloc(sizeof(wordcount_T) + STRLEN(p));
if (wc == NULL)
return;
STRCPY(wc->wc_word, p);
@@ -3432,8 +3432,7 @@ spell_suggest(int count)
}
/* Replace the word. */
- p = alloc((unsigned)STRLEN(line) - stp->st_orglen
- + stp->st_wordlen + 1);
+ p = alloc(STRLEN(line) - stp->st_orglen + stp->st_wordlen + 1);
if (p != NULL)
{
c = (int)(sug.su_badptr - line);
@@ -3552,7 +3551,7 @@ ex_spellrepall(exarg_T *eap UNUSED)
}
addlen = (int)(STRLEN(repl_to) - STRLEN(repl_from));
- frompat = alloc((unsigned)STRLEN(repl_from) + 7);
+ frompat = alloc(STRLEN(repl_from) + 7);
if (frompat == NULL)
return;
sprintf((char *)frompat, "\\V\\<%s\\>", repl_from);
@@ -3573,7 +3572,7 @@ ex_spellrepall(exarg_T *eap UNUSED)
if (addlen <= 0 || STRNCMP(line + curwin->w_cursor.col,
repl_to, STRLEN(repl_to)) != 0)
{
- p = alloc((unsigned)STRLEN(line) + addlen + 1);
+ p = alloc(STRLEN(line) + addlen + 1);
if (p == NULL)
break;
mch_memmove(p, line, curwin->w_cursor.col);
@@ -6224,8 +6223,7 @@ add_sound_suggest(
hi = hash_lookup(&slang->sl_sounddone, goodword, hash);
if (HASHITEM_EMPTY(hi))
{
- sft = (sftword_T *)alloc((unsigned)(sizeof(sftword_T)
- + STRLEN(goodword)));
+ sft = (sftword_T *)alloc(sizeof(sftword_T) + STRLEN(goodword));
if (sft != NULL)
{
sft->sft_score = score;