refactor: remove redundant const char * casts

This commit is contained in:
ii14
2023-04-07 19:40:57 +02:00
committed by GitHub
parent 1d2a29f75b
commit 9408f2dcf7
56 changed files with 302 additions and 350 deletions

View File

@@ -1501,7 +1501,7 @@ bool check_abbr(int c, char *ptr, int col, int mincol)
char *q = mp->m_keys;
int match;
if (strchr((const char *)mp->m_keys, K_SPECIAL) != NULL) {
if (strchr(mp->m_keys, K_SPECIAL) != NULL) {
// Might have K_SPECIAL escaped mp->m_keys.
q = xstrdup(mp->m_keys);
vim_unescape_ks(q);
@@ -1811,8 +1811,7 @@ int makemap(FILE *fd, buf_T *buf)
did_cpo = true;
} else {
const char specials[] = { (char)(uint8_t)K_SPECIAL, NL, NUL };
if (strpbrk((const char *)mp->m_str, specials) != NULL
|| strpbrk((const char *)mp->m_keys, specials) != NULL) {
if (strpbrk(mp->m_str, specials) != NULL || strpbrk(mp->m_keys, specials) != NULL) {
did_cpo = true;
}
}
@@ -2091,7 +2090,7 @@ static Dictionary mapblock_fill_dict(const mapblock_T *const mp, const char *lhs
PUT(dict, "desc", STRING_OBJ(cstr_to_string(mp->m_desc)));
}
PUT(dict, "lhs", STRING_OBJ(cstr_as_string(lhs)));
PUT(dict, "lhsraw", STRING_OBJ(cstr_to_string((const char *)mp->m_keys)));
PUT(dict, "lhsraw", STRING_OBJ(cstr_to_string(mp->m_keys)));
if (lhsrawalt != NULL) {
// Also add the value for the simplified entry.
PUT(dict, "lhsrawalt", STRING_OBJ(cstr_to_string(lhsrawalt)));