mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
refactor: add const and remove unnecessary casts (#22841)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user