diff src/memline.c @ 15182:4b2de998ebd6 v8.1.0601

patch 8.1.0601: a few compiler warnings commit https://github.com/vim/vim/commit/4efe73b478d3ba689078da502fd96f45204ff1f5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 16 14:37:39 2018 +0100 patch 8.1.0601: a few compiler warnings Problem: A few compiler warnings. Solution: Add type casts. (Mike Williams)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Dec 2018 14:45:06 +0100
parents 7713ceb8c593
children 19e79a1ed6b6
line wrap: on
line diff
--- a/src/memline.c
+++ b/src/memline.c
@@ -3146,7 +3146,7 @@ ml_replace(linenr_T lnum, char_u *line, 
     colnr_T len = -1;
 
     if (line != NULL)
-	len = STRLEN(line);
+	len = (colnr_T)STRLEN(line);
     return ml_replace_len(lnum, line, len, copy);
 }
 
@@ -3196,14 +3196,14 @@ ml_replace_len(linenr_T lnum, char_u *li
 	    size_t textproplen = curbuf->b_ml.ml_line_len - oldtextlen;
 
 	    // Need to copy over text properties, stored after the text.
-	    newline = alloc(len + 1 + textproplen);
+	    newline = alloc(len + 1 + (int)textproplen);
 	    if (newline != NULL)
 	    {
 		mch_memmove(newline, line, len + 1);
 		mch_memmove(newline + len + 1, curbuf->b_ml.ml_line_ptr + oldtextlen, textproplen);
 		vim_free(line);
 		line = newline;
-		len += textproplen;
+		len += (colnr_T)textproplen;
 	    }
 	}
     }