comparison 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
comparison
equal deleted inserted replaced
16747:ee8eb8c733ac 16748:75703a39d875
1201 { 1201 {
1202 size_t proplen = 0; 1202 size_t proplen = 0;
1203 size_t oldproplen; 1203 size_t oldproplen;
1204 char_u *props; 1204 char_u *props;
1205 int i; 1205 int i;
1206 int len; 1206 size_t len;
1207 char_u *line; 1207 char_u *line;
1208 size_t l; 1208 size_t l;
1209 1209
1210 for (i = 0; i < count - 1; ++i) 1210 for (i = 0; i < count - 1; ++i)
1211 proplen += prop_lengths[i]; 1211 proplen += prop_lengths[i];
1216 } 1216 }
1217 1217
1218 // get existing properties of the joined line 1218 // get existing properties of the joined line
1219 oldproplen = get_text_props(curbuf, lnum, &props, FALSE); 1219 oldproplen = get_text_props(curbuf, lnum, &props, FALSE);
1220 1220
1221 len = (int)STRLEN(newp) + 1; 1221 len = STRLEN(newp) + 1;
1222 line = alloc(len + (oldproplen + proplen) * (int)sizeof(textprop_T)); 1222 line = alloc((int)(len + (oldproplen + proplen) * sizeof(textprop_T)));
1223 if (line == NULL) 1223 if (line == NULL)
1224 return; 1224 return;
1225 mch_memmove(line, newp, len); 1225 mch_memmove(line, newp, len);
1226 l = oldproplen * sizeof(textprop_T); 1226 l = oldproplen * sizeof(textprop_T);
1227 mch_memmove(line + len, props, l); 1227 mch_memmove(line + len, props, l);
1234 mch_memmove(line + len, prop_lines[i], l); 1234 mch_memmove(line + len, prop_lines[i], l);
1235 len += l; 1235 len += l;
1236 vim_free(prop_lines[i]); 1236 vim_free(prop_lines[i]);
1237 } 1237 }
1238 1238
1239 ml_replace_len(lnum, line, len, TRUE, FALSE); 1239 ml_replace_len(lnum, line, (colnr_T)len, TRUE, FALSE);
1240 vim_free(newp); 1240 vim_free(newp);
1241 vim_free(prop_lines); 1241 vim_free(prop_lines);
1242 vim_free(prop_lengths); 1242 vim_free(prop_lengths);
1243 } 1243 }
1244 1244