To: vim_dev@googlegroups.com Subject: Patch 7.4.2097 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2097 Problem: Warning from 64 bit compiler. Solution: use size_t instead of int. (Mike Williams) Files: src/message.c *** ../vim-7.4.2096/src/message.c 2016-07-20 00:10:44.484250033 +0200 --- src/message.c 2016-07-23 17:24:35.816025642 +0200 *************** *** 237,254 **** trunc_string( char_u *s, char_u *buf, ! int room, int buflen) { ! int half; ! int len; int e; int i; int n; ! room -= 3; half = room / 2; - len = 0; /* First part: Start of the string. */ for (e = 0; len < half && e < buflen; ++e) --- 237,255 ---- trunc_string( char_u *s, char_u *buf, ! int room_in, int buflen) { ! size_t room = room_in - 3; /* "..." takes 3 chars */ ! size_t half; ! size_t len = 0; int e; int i; int n; ! if (room_in < 3) ! room = 0; half = room / 2; /* First part: Start of the string. */ for (e = 0; len < half && e < buflen; ++e) *************** *** 320,326 **** if (s != buf) { len = STRLEN(s); ! if (len >= buflen) len = buflen - 1; len = len - e + 1; if (len < 1) --- 321,327 ---- if (s != buf) { len = STRLEN(s); ! if (len >= (size_t)buflen) len = buflen - 1; len = len - e + 1; if (len < 1) *************** *** 333,340 **** { /* set the middle and copy the last part */ mch_memmove(buf + e, "...", (size_t)3); ! len = (int)STRLEN(s + i) + 1; ! if (len >= buflen - e - 3) len = buflen - e - 3 - 1; mch_memmove(buf + e + 3, s + i, len); buf[e + 3 + len - 1] = NUL; --- 334,341 ---- { /* set the middle and copy the last part */ mch_memmove(buf + e, "...", (size_t)3); ! len = STRLEN(s + i) + 1; ! if (len >= (size_t)buflen - e - 3) len = buflen - e - 3 - 1; mch_memmove(buf + e + 3, s + i, len); buf[e + 3 + len - 1] = NUL; *** ../vim-7.4.2096/src/version.c 2016-07-23 15:47:29.046684257 +0200 --- src/version.c 2016-07-23 17:28:00.430120200 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2097, /**/ -- ARTHUR: Did you say shrubberies? ROGER: Yes. Shrubberies are my trade. I am a shrubber. My name is Roger the Shrubber. I arrange, design, and sell shrubberies. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///