Mercurial > vim
comparison src/insexpand.c @ 16764:ef00b6bc186b v8.1.1384
patch 8.1.1384: using "int" for alloc() often results in compiler warnings
commit https://github.com/vim/vim/commit/964b3746b9c81e65887e2ac9a335f181db2bb592
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 18:54:09 2019 +0200
patch 8.1.1384: using "int" for alloc() often results in compiler warnings
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 19:00:07 +0200 |
parents | 54ffc82f38a8 |
children | 695d9ef00b03 |
comparison
equal
deleted
inserted
replaced
16763:fccf84413b53 | 16764:ef00b6bc186b |
---|---|
471 // thesaurus, only use the minimum when comparing. | 471 // thesaurus, only use the minimum when comparing. |
472 min_len = actual_len < actual_compl_length | 472 min_len = actual_len < actual_compl_length |
473 ? actual_len : actual_compl_length; | 473 ? actual_len : actual_compl_length; |
474 | 474 |
475 // Allocate wide character array for the completion and fill it. | 475 // Allocate wide character array for the completion and fill it. |
476 wca = (int *)alloc((unsigned)(actual_len * sizeof(int))); | 476 wca = (int *)alloc(actual_len * sizeof(int)); |
477 if (wca != NULL) | 477 if (wca != NULL) |
478 { | 478 { |
479 p = str; | 479 p = str; |
480 for (i = 0; i < actual_len; ++i) | 480 for (i = 0; i < actual_len; ++i) |
481 if (has_mbyte) | 481 if (has_mbyte) |
1228 size_t len; | 1228 size_t len; |
1229 | 1229 |
1230 if (pat_esc == NULL) | 1230 if (pat_esc == NULL) |
1231 goto theend; | 1231 goto theend; |
1232 len = STRLEN(pat_esc) + 10; | 1232 len = STRLEN(pat_esc) + 10; |
1233 ptr = alloc((unsigned)len); | 1233 ptr = alloc(len); |
1234 if (ptr == NULL) | 1234 if (ptr == NULL) |
1235 { | 1235 { |
1236 vim_free(pat_esc); | 1236 vim_free(pat_esc); |
1237 goto theend; | 1237 goto theend; |
1238 } | 1238 } |