Mercurial > vim
comparison src/ex_eval.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 | dd725a8ab112 |
children | ce04ebdf26b8 |
comparison
equal
deleted
inserted
replaced
16763:fccf84413b53 | 16764:ef00b6bc186b |
---|---|
249 { | 249 { |
250 plist = msg_list; | 250 plist = msg_list; |
251 while (*plist != NULL) | 251 while (*plist != NULL) |
252 plist = &(*plist)->next; | 252 plist = &(*plist)->next; |
253 | 253 |
254 elem = (struct msglist *)alloc((unsigned)sizeof(struct msglist)); | 254 elem = (struct msglist *)alloc(sizeof(struct msglist)); |
255 if (elem == NULL) | 255 if (elem == NULL) |
256 { | 256 { |
257 suppress_errthrow = TRUE; | 257 suppress_errthrow = TRUE; |
258 emsg(_(e_outofmem)); | 258 emsg(_(e_outofmem)); |
259 } | 259 } |
517 emsg(_("E608: Cannot :throw exceptions with 'Vim' prefix")); | 517 emsg(_("E608: Cannot :throw exceptions with 'Vim' prefix")); |
518 goto fail; | 518 goto fail; |
519 } | 519 } |
520 } | 520 } |
521 | 521 |
522 excp = (except_T *)alloc((unsigned)sizeof(except_T)); | 522 excp = (except_T *)alloc(sizeof(except_T)); |
523 if (excp == NULL) | 523 if (excp == NULL) |
524 goto nomem; | 524 goto nomem; |
525 | 525 |
526 if (type == ET_ERROR) | 526 if (type == ET_ERROR) |
527 /* Store the original message and prefix the exception value with | 527 /* Store the original message and prefix the exception value with |
1439 */ | 1439 */ |
1440 if (emsg_silent) | 1440 if (emsg_silent) |
1441 { | 1441 { |
1442 eslist_T *elem; | 1442 eslist_T *elem; |
1443 | 1443 |
1444 elem = (eslist_T *)alloc((unsigned)sizeof(struct eslist_elem)); | 1444 elem = (eslist_T *)alloc(sizeof(struct eslist_elem)); |
1445 if (elem == NULL) | 1445 if (elem == NULL) |
1446 emsg(_(e_outofmem)); | 1446 emsg(_(e_outofmem)); |
1447 else | 1447 else |
1448 { | 1448 { |
1449 elem->saved_emsg_silent = emsg_silent; | 1449 elem->saved_emsg_silent = emsg_silent; |