refactor: add const and remove unnecessary casts (#22841)

This commit is contained in:
ii14
2023-04-01 02:49:51 +02:00
committed by GitHub
parent 83bfd94d1d
commit d5f6176e6d
21 changed files with 71 additions and 73 deletions

View File

@@ -4670,7 +4670,7 @@ static void find_some_match(typval_T *const argvars, typval_T *const rettv,
}
}
regmatch.regprog = vim_regcomp((char *)pat, RE_MAGIC + RE_STRING);
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
if (regmatch.regprog != NULL) {
regmatch.rm_ic = p_ic;
@@ -7895,7 +7895,7 @@ static void f_split(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
}
regmatch_T regmatch = {
.regprog = vim_regcomp((char *)pat, RE_MAGIC + RE_STRING),
.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING),
.startp = { NULL },
.endp = { NULL },
.rm_ic = false,
@@ -7906,7 +7906,7 @@ static void f_split(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
if (*str == NUL) {
match = false; // Empty item at the end.
} else {
match = vim_regexec_nl(&regmatch, (char *)str, col);
match = vim_regexec_nl(&regmatch, str, col);
}
const char *end;
if (match) {