summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-12 22:59:11 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-12 22:59:11 +0200
commit71ccd03ee8a43b20000214a9c99dcc90f039edca (patch)
treeb5e89de8afbba2a8981d68b578514df046cb4aad /src/syntax.c
parent722e505d1a55dfde5ab62241d10da91d2e10c3c1 (diff)
downloadvim-git-71ccd03ee8a43b20000214a9c99dcc90f039edca.tar.gz
patch 8.2.0967: unnecessary type casts for vim_strnsave()v8.2.0967
Problem: Unnecessary type casts for vim_strnsave(). Solution: Remove the type casts.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 5c9dd0b02..6bbe4bacc 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4652,7 +4652,7 @@ get_syn_options(
arg = skiptowhite(arg);
if (gname_start == arg)
return NULL;
- gname = vim_strnsave(gname_start, (int)(arg - gname_start));
+ gname = vim_strnsave(gname_start, arg - gname_start);
if (gname == NULL)
return NULL;
if (STRCMP(gname, "NONE") == 0)
@@ -4662,7 +4662,8 @@ get_syn_options(
syn_id = syn_name2id(gname);
for (i = curwin->w_s->b_syn_patterns.ga_len; --i >= 0; )
if (SYN_ITEMS(curwin->w_s)[i].sp_syn.id == syn_id
- && SYN_ITEMS(curwin->w_s)[i].sp_type == SPTYPE_START)
+ && SYN_ITEMS(curwin->w_s)[i].sp_type
+ == SPTYPE_START)
{
*opt->sync_idx = i;
break;
@@ -5656,7 +5657,7 @@ get_syn_pattern(char_u *arg, synpat_T *ci)
return NULL;
}
// store the pattern and compiled regexp program
- if ((ci->sp_pattern = vim_strnsave(arg + 1, (int)(end - arg - 1))) == NULL)
+ if ((ci->sp_pattern = vim_strnsave(arg + 1, end - arg - 1)) == NULL)
return NULL;
// Make 'cpoptions' empty, to avoid the 'l' flag
@@ -5836,8 +5837,9 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED)
if (!eap->skip)
{
// store the pattern and compiled regexp program
- if ((curwin->w_s->b_syn_linecont_pat = vim_strnsave(next_arg + 1,
- (int)(arg_end - next_arg - 1))) == NULL)
+ if ((curwin->w_s->b_syn_linecont_pat =
+ vim_strnsave(next_arg + 1,
+ arg_end - next_arg - 1)) == NULL)
{
finished = TRUE;
break;
@@ -6272,7 +6274,7 @@ ex_syntax(exarg_T *eap)
// isolate subcommand name
for (subcmd_end = arg; ASCII_ISALPHA(*subcmd_end); ++subcmd_end)
;
- subcmd_name = vim_strnsave(arg, (int)(subcmd_end - arg));
+ subcmd_name = vim_strnsave(arg, subcmd_end - arg);
if (subcmd_name != NULL)
{
if (eap->skip) // skip error messages for all subcommands