diff src/textprop.c @ 16748:75703a39d875 v8.1.1376

patch 8.1.1376: warnings for size_t/int mixups commit https://github.com/vim/vim/commit/e2ad826f431b2f8dd1b235c219282cc3961f7188 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 24 13:22:22 2019 +0200 patch 8.1.1376: warnings for size_t/int mixups Problem: Warnings for size_t/int mixups. Solution: Change types, add type casts. (Mike Williams)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 May 2019 13:30:06 +0200
parents ba592f30c082
children 695d9ef00b03
line wrap: on
line diff
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -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);