vim-patch:8.2.4241: some type casts are redundant

Problem:    Some type casts are redundant.
Solution:   Remove the type casts. (closes vim/vim#9643)
420fabcd4f

This is not a literal port but an equivalent one.
This commit is contained in:
Dundar Göc
2022-01-28 22:54:03 +01:00
parent 46bd48f7e9
commit 2793fcae0a
16 changed files with 46 additions and 58 deletions

View File

@@ -1781,7 +1781,7 @@ static char *illegal_char(char *errbuf, size_t errbuflen, int c)
if (errbuf == NULL) {
return "";
}
vim_snprintf((char *)errbuf, errbuflen, _("E539: Illegal character <%s>"),
vim_snprintf(errbuf, errbuflen, _("E539: Illegal character <%s>"),
(char *)transchar(c));
return errbuf;
}
@@ -2284,12 +2284,12 @@ static char *set_string_option(const int opt_idx, const char *const value, const
*varp = s;
char *const saved_oldval = xstrdup(oldval);
char *const saved_oldval_l = (oldval_l != NULL) ? xstrdup((char *)oldval_l) : 0;
char *const saved_oldval_g = (oldval_g != NULL) ? xstrdup((char *)oldval_g) : 0;
char *const saved_oldval_l = (oldval_l != NULL) ? xstrdup(oldval_l) : 0;
char *const saved_oldval_g = (oldval_g != NULL) ? xstrdup(oldval_g) : 0;
char *const saved_newval = xstrdup(s);
int value_checked = false;
char *const r = did_set_string_option(opt_idx, (char_u **)varp, (int)true,
char *const r = did_set_string_option(opt_idx, (char_u **)varp, true,
(char_u *)oldval,
NULL, 0, opt_flags, &value_checked);
if (r == NULL) {
@@ -2777,7 +2777,7 @@ ambw_end:
if (!ascii_isdigit(*(s - 1))) {
if (errbuf != NULL) {
vim_snprintf((char *)errbuf, errbuflen,
vim_snprintf(errbuf, errbuflen,
_("E526: Missing number after <%s>"),
transchar_byte(*(s - 1)));
errmsg = errbuf;
@@ -2968,7 +2968,7 @@ ambw_end:
}
} else {
if (errbuf != NULL) {
vim_snprintf((char *)errbuf, errbuflen,
vim_snprintf(errbuf, errbuflen,
_("E535: Illegal character after <%c>"),
*--s);
errmsg = errbuf;
@@ -4433,7 +4433,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf,
// Don't change the value and return early if validation failed.
if (errmsg != NULL) {
return (char *)errmsg;
return errmsg;
}
*pp = value;
@@ -4557,7 +4557,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf,
// Check the (new) bounds for Rows and Columns here.
if (p_lines < min_rows() && full_screen) {
if (errbuf != NULL) {
vim_snprintf((char *)errbuf, errbuflen,
vim_snprintf(errbuf, errbuflen,
_("E593: Need at least %d lines"), min_rows());
errmsg = errbuf;
}
@@ -4565,7 +4565,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf,
}
if (p_columns < MIN_COLUMNS && full_screen) {
if (errbuf != NULL) {
vim_snprintf((char *)errbuf, errbuflen,
vim_snprintf(errbuf, errbuflen,
_("E594: Need at least %d columns"), MIN_COLUMNS);
errmsg = errbuf;
}
@@ -4681,7 +4681,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf,
}
check_redraw(options[opt_idx].flags);
return (char *)errmsg;
return errmsg;
}
/// Trigger the OptionSet autocommand.