option: use char* for get_option_value() param

'name' param is casted to char_u* within get_option_value().
Most calls to get_option_value() cast arg to 'name' from char to char_u.
Remove these pointless type casts.
This commit is contained in:
Jan Edmund Lazo 2021-02-07 17:57:34 -05:00
parent b1df53e868
commit d34846af74
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
4 changed files with 8 additions and 8 deletions

View File

@ -126,7 +126,7 @@ bool ctx_restore(Context *ctx, const int flags)
}
char_u *op_shada;
get_option_value((char_u *)"shada", NULL, &op_shada, OPT_GLOBAL);
get_option_value("shada", NULL, &op_shada, OPT_GLOBAL);
set_option_value("shada", 0L, "!,'100,%", OPT_GLOBAL);
if (flags & kCtxRegs) {

View File

@ -1848,7 +1848,7 @@ static char_u *ex_let_one(char_u *arg, typval_T *const tv,
s = tv_get_string_chk(tv); // != NULL if number or string.
}
if (s != NULL && op != NULL && *op != '=') {
opt_type = get_option_value(arg, &numval, (char_u **)&stringval,
opt_type = get_option_value((char *)arg, &numval, (char_u **)&stringval,
opt_flags);
if ((opt_type == 1 && *op == '.')
|| (opt_type == 0 && *op != '.')) {
@ -4537,7 +4537,7 @@ int get_option_tv(const char **const arg, typval_T *const rettv,
c = *option_end;
*option_end = NUL;
opt_type = get_option_value((char_u *)(*arg), &numval,
opt_type = get_option_value(*arg, &numval,
rettv == NULL ? NULL : &stringval, opt_flags);
if (opt_type == -3) { // invalid name

View File

@ -4531,7 +4531,7 @@ bool is_tty_option(const char *name)
#define TCO_BUFFER_SIZE 8
/// @param name TUI-related option
/// @param[out,allocated] value option string value
bool get_tty_option(char *name, char **value)
bool get_tty_option(const char *name, char **value)
{
if (strequal(name, "t_Co")) {
if (value) {
@ -4611,17 +4611,17 @@ static int findoption(const char *const arg)
/// hidden String option: -2.
/// unknown option: -3.
int get_option_value(
char_u *name,
const char *name,
long *numval,
char_u **stringval, ///< NULL when only checking existence
int opt_flags
)
{
if (get_tty_option((char *)name, (char **)stringval)) {
if (get_tty_option(name, (char **)stringval)) {
return 0;
}
int opt_idx = findoption((const char *)name);
int opt_idx = findoption(name);
if (opt_idx < 0) { // Unknown option.
return -3;
}

View File

@ -6624,7 +6624,7 @@ void ex_spelldump(exarg_T *eap)
if (no_spell_checking(curwin)) {
return;
}
get_option_value((char_u *)"spl", &dummy, &spl, OPT_LOCAL);
get_option_value("spl", &dummy, &spl, OPT_LOCAL);
// Create a new empty buffer in a new window.
do_cmdline_cmd("new");