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

@@ -98,7 +98,7 @@ static int match_add(win_T *wp, const char *const grp, const char *const pat, in
if ((hlg_id = syn_check_group(grp, strlen(grp))) == 0) {
return -1;
}
if (pat != NULL && (regprog = vim_regcomp((char *)pat, RE_MAGIC)) == NULL) {
if (pat != NULL && (regprog = vim_regcomp(pat, RE_MAGIC)) == NULL) {
semsg(_(e_invarg2), pat);
return -1;
}
@@ -1232,7 +1232,7 @@ void ex_match(exarg_T *eap)
if (!eap->skip) {
if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) {
xfree(g);
eap->errmsg = ex_errmsg(e_trailing_arg, (const char *)end);
eap->errmsg = ex_errmsg(e_trailing_arg, end);
return;
}
if (*end != *p) {
@@ -1243,8 +1243,7 @@ void ex_match(exarg_T *eap)
c = (uint8_t)(*end);
*end = NUL;
match_add(curwin, (const char *)g, (const char *)p + 1, 10, id,
NULL, NULL);
match_add(curwin, g, p + 1, 10, id, NULL, NULL);
xfree(g);
*end = (char)c;
}