Mercurial > vim
comparison src/syntax.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 | 99b6e6bf48bf |
children | 9064044fd4f6 |
comparison
equal
deleted
inserted
replaced
20750:020a100bfa92 | 20751:d9a2e5dcfd9f |
---|---|
5095 // must be a pattern or matchgroup then | 5095 // must be a pattern or matchgroup then |
5096 key_end = rest; | 5096 key_end = rest; |
5097 while (*key_end && !VIM_ISWHITE(*key_end) && *key_end != '=') | 5097 while (*key_end && !VIM_ISWHITE(*key_end) && *key_end != '=') |
5098 ++key_end; | 5098 ++key_end; |
5099 vim_free(key); | 5099 vim_free(key); |
5100 key = vim_strnsave_up(rest, (int)(key_end - rest)); | 5100 key = vim_strnsave_up(rest, key_end - rest); |
5101 if (key == NULL) // out of memory | 5101 if (key == NULL) // out of memory |
5102 { | 5102 { |
5103 rest = NULL; | 5103 rest = NULL; |
5104 break; | 5104 break; |
5105 } | 5105 } |
5760 while (!ends_excmd2(eap->cmd, arg_start)) | 5760 while (!ends_excmd2(eap->cmd, arg_start)) |
5761 { | 5761 { |
5762 arg_end = skiptowhite(arg_start); | 5762 arg_end = skiptowhite(arg_start); |
5763 next_arg = skipwhite(arg_end); | 5763 next_arg = skipwhite(arg_end); |
5764 vim_free(key); | 5764 vim_free(key); |
5765 key = vim_strnsave_up(arg_start, (int)(arg_end - arg_start)); | 5765 key = vim_strnsave_up(arg_start, arg_end - arg_start); |
5766 if (STRCMP(key, "CCOMMENT") == 0) | 5766 if (STRCMP(key, "CCOMMENT") == 0) |
5767 { | 5767 { |
5768 if (!eap->skip) | 5768 if (!eap->skip) |
5769 curwin->w_s->b_syn_sync_flags |= SF_CCOMMENT; | 5769 curwin->w_s->b_syn_sync_flags |= SF_CCOMMENT; |
5770 if (!ends_excmd2(eap->cmd, next_arg)) | 5770 if (!ends_excmd2(eap->cmd, next_arg)) |