From 964b3746b9c81e65887e2ac9a335f181db2bb592 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 24 May 2019 18:54:09 +0200 Subject: 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. --- src/os_mswin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/os_mswin.c') diff --git a/src/os_mswin.c b/src/os_mswin.c index fc6806d88..67989fe28 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -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); -- cgit v1.2.1