Mercurial > vim
comparison src/evalfunc.c @ 20751:d9a2e5dcfd9f v8.2.0928
patch 8.2.0928: many type casts are used for vim_strnsave()
Commit: https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 7 20:49:05 2020 +0200
patch 8.2.0928: many type casts are used for vim_strnsave()
Problem: Many type casts are used for vim_strnsave().
Solution: Make the length argument size_t instead of int. (Ken Takata,
closes #5633) Remove some type casts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Jun 2020 21:00:03 +0200 |
parents | a672feb8fc4f |
children | 821925509d8c |
comparison
equal
deleted
inserted
replaced
20750:020a100bfa92 | 20751:d9a2e5dcfd9f |
---|---|
5519 listitem_T *li3 = li2->li_next; | 5519 listitem_T *li3 = li2->li_next; |
5520 listitem_T *li4 = li3->li_next; | 5520 listitem_T *li4 = li3->li_next; |
5521 | 5521 |
5522 vim_free(li1->li_tv.vval.v_string); | 5522 vim_free(li1->li_tv.vval.v_string); |
5523 li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], | 5523 li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], |
5524 (int)(regmatch.endp[0] - regmatch.startp[0])); | 5524 regmatch.endp[0] - regmatch.startp[0]); |
5525 li3->li_tv.vval.v_number = | 5525 li3->li_tv.vval.v_number = |
5526 (varnumber_T)(regmatch.startp[0] - expr); | 5526 (varnumber_T)(regmatch.startp[0] - expr); |
5527 li4->li_tv.vval.v_number = | 5527 li4->li_tv.vval.v_number = |
5528 (varnumber_T)(regmatch.endp[0] - expr); | 5528 (varnumber_T)(regmatch.endp[0] - expr); |
5529 if (l != NULL) | 5529 if (l != NULL) |
5554 // return matched string | 5554 // return matched string |
5555 if (l != NULL) | 5555 if (l != NULL) |
5556 copy_tv(&li->li_tv, rettv); | 5556 copy_tv(&li->li_tv, rettv); |
5557 else | 5557 else |
5558 rettv->vval.v_string = vim_strnsave(regmatch.startp[0], | 5558 rettv->vval.v_string = vim_strnsave(regmatch.startp[0], |
5559 (int)(regmatch.endp[0] - regmatch.startp[0])); | 5559 regmatch.endp[0] - regmatch.startp[0]); |
5560 } | 5560 } |
5561 else if (l != NULL) | 5561 else if (l != NULL) |
5562 rettv->vval.v_number = idx; | 5562 rettv->vval.v_number = idx; |
5563 else | 5563 else |
5564 { | 5564 { |
8859 if (*p == NUL) | 8859 if (*p == NUL) |
8860 break; | 8860 break; |
8861 } | 8861 } |
8862 } | 8862 } |
8863 } | 8863 } |
8864 rettv->vval.v_string = vim_strnsave(head, (int)(tail - head)); | 8864 rettv->vval.v_string = vim_strnsave(head, tail - head); |
8865 } | 8865 } |
8866 | 8866 |
8867 #ifdef FEAT_FLOAT | 8867 #ifdef FEAT_FLOAT |
8868 /* | 8868 /* |
8869 * "trunc({float})" function | 8869 * "trunc({float})" function |