Mercurial > vim
comparison src/textprop.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 | 7903dce131d4 |
children | de63593896b3 |
comparison
equal
deleted
inserted
replaced
15181:90cac240c595 | 15182:4b2de998ebd6 |
---|---|
299 IEMSG(_("E967: text property info corrupted")); | 299 IEMSG(_("E967: text property info corrupted")); |
300 return 0; | 300 return 0; |
301 } | 301 } |
302 if (proplen > 0) | 302 if (proplen > 0) |
303 *props = text + textlen; | 303 *props = text + textlen; |
304 return proplen / sizeof(textprop_T); | 304 return (int)(proplen / sizeof(textprop_T)); |
305 } | 305 } |
306 | 306 |
307 static proptype_T * | 307 static proptype_T * |
308 find_type_by_id(hashtab_T *ht, int id) | 308 find_type_by_id(hashtab_T *ht, int id) |
309 { | 309 { |
391 if (newtext == NULL) | 391 if (newtext == NULL) |
392 return; | 392 return; |
393 buf->b_ml.ml_line_ptr = newtext; | 393 buf->b_ml.ml_line_ptr = newtext; |
394 buf->b_ml.ml_flags |= ML_LINE_DIRTY; | 394 buf->b_ml.ml_flags |= ML_LINE_DIRTY; |
395 } | 395 } |
396 buf->b_ml.ml_line_len = len; | 396 buf->b_ml.ml_line_len = (int)len; |
397 } | 397 } |
398 } | 398 } |
399 redraw_buf_later(buf, NOT_VALID); | 399 redraw_buf_later(buf, NOT_VALID); |
400 } | 400 } |
401 | 401 |
421 | 421 |
422 if (rettv_list_alloc(rettv) == OK) | 422 if (rettv_list_alloc(rettv) == OK) |
423 { | 423 { |
424 char_u *text = ml_get_buf(buf, lnum, FALSE); | 424 char_u *text = ml_get_buf(buf, lnum, FALSE); |
425 size_t textlen = STRLEN(text) + 1; | 425 size_t textlen = STRLEN(text) + 1; |
426 int count = (buf->b_ml.ml_line_len - textlen) | 426 int count = (int)((buf->b_ml.ml_line_len - textlen) |
427 / sizeof(textprop_T); | 427 / sizeof(textprop_T)); |
428 int i; | 428 int i; |
429 textprop_T prop; | 429 textprop_T prop; |
430 proptype_T *pt; | 430 proptype_T *pt; |
431 | 431 |
432 for (i = 0; i < count; ++i) | 432 for (i = 0; i < count; ++i) |
605 if (prop != NULL) | 605 if (prop != NULL) |
606 { | 606 { |
607 EMSG2(_("E969: Property type %s already defined"), name); | 607 EMSG2(_("E969: Property type %s already defined"), name); |
608 return; | 608 return; |
609 } | 609 } |
610 prop = (proptype_T *)alloc_clear(sizeof(proptype_T) + STRLEN(name)); | 610 prop = (proptype_T *)alloc_clear((int)(sizeof(proptype_T) + STRLEN(name))); |
611 if (prop == NULL) | 611 if (prop == NULL) |
612 return; | 612 return; |
613 STRCPY(prop->pt_name, name); | 613 STRCPY(prop->pt_name, name); |
614 prop->pt_id = ++proptype_id; | 614 prop->pt_id = ++proptype_id; |
615 htp = buf == NULL ? &global_proptypes : &buf->b_proptypes; | 615 htp = buf == NULL ? &global_proptypes : &buf->b_proptypes; |