]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1376: warnings for size_t/int mixups v8.1.1376
authorBram Moolenaar <Bram@vim.org>
Fri, 24 May 2019 11:22:22 +0000 (13:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 24 May 2019 11:22:22 +0000 (13:22 +0200)
Problem:    Warnings for size_t/int mixups.
Solution:   Change types, add type casts. (Mike Williams)

src/search.c
src/textprop.c
src/version.c

index 2bcbf0ae498f6fdf06157bd69ded59225a12589b..e57c101d72b9bf65bea00ace174b78988b6431c7 100644 (file)
@@ -4990,7 +4990,7 @@ search_stat(
     if (cur > 0)
     {
        char    t[SEARCH_STAT_BUF_LEN] = "";
-       int     len;
+       size_t  len;
 
 #ifdef FEAT_RIGHTLEFT
        if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
index 15ae4945b98df781d1db25c84729af0301f3898e..66ad694454b3e73e0cb276794cebe9d43c2d170d 100644 (file)
@@ -1203,7 +1203,7 @@ join_prop_lines(
     size_t     oldproplen;
     char_u     *props;
     int                i;
-    int                len;
+    size_t     len;
     char_u     *line;
     size_t     l;
 
@@ -1218,8 +1218,8 @@ join_prop_lines(
     // get existing properties of the joined line
     oldproplen = get_text_props(curbuf, lnum, &props, FALSE);
 
-    len = (int)STRLEN(newp) + 1;
-    line = alloc(len + (oldproplen + proplen) * (int)sizeof(textprop_T));
+    len = STRLEN(newp) + 1;
+    line = alloc((int)(len + (oldproplen + proplen) * sizeof(textprop_T)));
     if (line == NULL)
        return;
     mch_memmove(line, newp, len);
@@ -1236,7 +1236,7 @@ join_prop_lines(
            vim_free(prop_lines[i]);
        }
 
-    ml_replace_len(lnum, line, len, TRUE, FALSE);
+    ml_replace_len(lnum, line, (colnr_T)len, TRUE, FALSE);
     vim_free(newp);
     vim_free(prop_lines);
     vim_free(prop_lengths);
index 0fd12fe432b62543a6ca1c4fa5bd0cf2a099d0e6..26c407195c3e1a164d42503bc0e8a0c82eeb1d02 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1376,
 /**/
     1375,
 /**/