0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-05-24 18:54:09 +02:00
parent d33a764123
commit 964b3746b9
63 changed files with 293 additions and 322 deletions

View File

@@ -1466,8 +1466,8 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
char_u *port_name = utf16_to_enc(wport_name, NULL);
if (printer_name != NULL && port_name != NULL)
prt_name = alloc((unsigned)(STRLEN(printer_name)
+ STRLEN(port_name) + STRLEN(text)));
prt_name = alloc(STRLEN(printer_name)
+ STRLEN(port_name) + STRLEN(text));
if (prt_name != NULL)
wsprintf((char *)prt_name, (const char *)text,
printer_name, port_name);
@@ -2111,7 +2111,7 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
char *err = _(e_invexprmsg);
size_t len = STRLEN(str) + STRLEN(err) + 5;
res = alloc((unsigned)len);
res = alloc(len);
if (res != NULL)
vim_snprintf((char *)res, len, "%s: \"%s\"", err, str);
reply.dwData = COPYDATA_ERROR_RESULT;
@@ -2340,7 +2340,7 @@ serverSetName(char_u *name)
char_u *p;
/* Leave enough space for a 9-digit suffix to ensure uniqueness! */
ok_name = alloc((unsigned)STRLEN(name) + 10);
ok_name = alloc(STRLEN(name) + 10);
STRCPY(ok_name, name);
p = ok_name + STRLEN(name);