comparison src/if_xcmdsrv.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 536dd2bc5ac9
children ce04ebdf26b8
comparison
equal deleted inserted replaced
16763:fccf84413b53 16764:ef00b6bc186b
439 * Send the command to target interpreter by appending it to the 439 * Send the command to target interpreter by appending it to the
440 * comm window in the communication window. 440 * comm window in the communication window.
441 * Length must be computed exactly! 441 * Length must be computed exactly!
442 */ 442 */
443 length = STRLEN(name) + STRLEN(p_enc) + STRLEN(cmd) + 14; 443 length = STRLEN(name) + STRLEN(p_enc) + STRLEN(cmd) + 14;
444 property = (char_u *)alloc((unsigned)length + 30); 444 property = (char_u *)alloc(length + 30);
445 445
446 sprintf((char *)property, "%c%c%c-n %s%c-E %s%c-s %s", 446 sprintf((char *)property, "%c%c%c-n %s%c-E %s%c-s %s",
447 0, asExpr ? 'c' : 'k', 0, name, 0, p_enc, 0, cmd); 447 0, asExpr ? 'c' : 'k', 0, name, 0, p_enc, 0, cmd);
448 if (name == loosename) 448 if (name == loosename)
449 vim_free(loosename); 449 vim_free(loosename);
748 } 748 }
749 if (!WindowValid(dpy, win)) 749 if (!WindowValid(dpy, win))
750 return -1; 750 return -1;
751 751
752 length = STRLEN(p_enc) + STRLEN(str) + 14; 752 length = STRLEN(p_enc) + STRLEN(str) + 14;
753 if ((property = (char_u *)alloc((unsigned)length + 30)) != NULL) 753 if ((property = (char_u *)alloc(length + 30)) != NULL)
754 { 754 {
755 sprintf((char *)property, "%cn%c-E %s%c-n %s%c-w %x", 755 sprintf((char *)property, "%cn%c-E %s%c-n %s%c-w %x",
756 0, 0, p_enc, 0, str, 0, (unsigned int)commWindow); 756 0, 0, p_enc, 0, str, 0, (unsigned int)commWindow);
757 /* Add length of what "%x" resulted in. */ 757 /* Add length of what "%x" resulted in. */
758 length += STRLEN(property + length); 758 length += STRLEN(property + length);