diff options
Diffstat (limited to 'src/nvim/eval')
-rw-r--r-- | src/nvim/eval/buffer.c | 3 | ||||
-rw-r--r-- | src/nvim/eval/funcs.c | 34 | ||||
-rw-r--r-- | src/nvim/eval/typval.c | 2 | ||||
-rw-r--r-- | src/nvim/eval/userfunc.c | 6 | ||||
-rw-r--r-- | src/nvim/eval/vars.c | 6 | ||||
-rw-r--r-- | src/nvim/eval/window.c | 6 |
6 files changed, 29 insertions, 28 deletions
diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c index 1f3b92804d..2ae2b94ce9 100644 --- a/src/nvim/eval/buffer.c +++ b/src/nvim/eval/buffer.c @@ -583,7 +583,8 @@ void f_getbufinfo(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) /// /// @return range (from start to end) of lines in rettv from the specified /// buffer. -static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retlist, typval_T *rettv) +static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, bool retlist, + typval_T *rettv) { rettv->v_type = (retlist ? VAR_LIST : VAR_STRING); rettv->vval.v_string = NULL; diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 30a86b1917..6fae90134a 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1668,7 +1668,7 @@ static void f_exepath(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) char *path = NULL; - (void)os_can_exe(tv_get_string(&argvars[0]), &path, true); + os_can_exe(tv_get_string(&argvars[0]), &path, true); #ifdef BACKSLASH_IN_FILENAME if (path != NULL) { @@ -2214,8 +2214,8 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) len = strlen(fname); if (*mods != NUL) { size_t usedlen = 0; - (void)modify_fname((char *)mods, false, &usedlen, - (char **)&fname, &fbuf, &len); + modify_fname((char *)mods, false, &usedlen, + (char **)&fname, &fbuf, &len); } } @@ -3634,7 +3634,7 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) }); // Ask for choice. - int mouse_used; + bool mouse_used; int selected = prompt_for_number(&mouse_used); if (mouse_used) { selected -= lines_left; @@ -4163,7 +4163,7 @@ static void f_jobstop(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) const char *error = NULL; if (data->is_rpc) { // Ignore return code, but show error later. - (void)channel_close(data->id, kChannelPartRpc, &error); + channel_close(data->id, kChannelPartRpc, &error); } process_stop(&data->stream.proc); rettv->vval.v_number = 1; @@ -5211,7 +5211,7 @@ static void f_printf(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) if (!did_emsg) { char *s = xmalloc((size_t)len + 1); rettv->vval.v_string = s; - (void)vim_vsnprintf_typval(s, (size_t)len + 1, fmt, dummy_ap, argvars + 1); + vim_vsnprintf_typval(s, (size_t)len + 1, fmt, dummy_ap, argvars + 1); } did_emsg |= saved_did_emsg; } @@ -5802,7 +5802,7 @@ static void f_getreginfo(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) if (list == NULL) { return; } - (void)tv_dict_add_list(dict, S_LEN("regcontents"), list); + tv_dict_add_list(dict, S_LEN("regcontents"), list); char buf[NUMBUFLEN + 2]; buf[0] = NUL; @@ -5821,15 +5821,15 @@ static void f_getreginfo(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) case kMTUnknown: abort(); } - (void)tv_dict_add_str(dict, S_LEN("regtype"), buf); + tv_dict_add_str(dict, S_LEN("regtype"), buf); buf[0] = (char)get_register_name(get_unname_register()); buf[1] = NUL; if (regname == '"') { - (void)tv_dict_add_str(dict, S_LEN("points_to"), buf); + tv_dict_add_str(dict, S_LEN("points_to"), buf); } else { - (void)tv_dict_add_bool(dict, S_LEN("isunnamed"), - regname == buf[0] ? kBoolVarTrue : kBoolVarFalse); + tv_dict_add_bool(dict, S_LEN("isunnamed"), + regname == buf[0] ? kBoolVarTrue : kBoolVarFalse); } } @@ -8082,7 +8082,7 @@ static void f_str2float(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) if (*p == '+' || *p == '-') { p = skipwhite(p + 1); } - (void)string2float(p, &rettv->vval.v_float); + string2float(p, &rettv->vval.v_float); if (isneg) { rettv->vval.v_float *= -1; } @@ -8397,7 +8397,7 @@ static void f_synconcealed(typval_T *argvars, typval_T *rettv, EvalFuncData fptr if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count && col >= 0 && (size_t)col <= strlen(ml_get(lnum)) && curwin->w_p_cole > 0) { - (void)syn_get_id(curwin, lnum, col, false, NULL, false); + syn_get_id(curwin, lnum, col, false, NULL, false); syntax_flags = get_syntax_info(&matchid); // get the conceal character @@ -8435,7 +8435,7 @@ static void f_synstack(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) && col >= 0 && (size_t)col <= strlen(ml_get(lnum))) { tv_list_alloc_ret(rettv, kListLenMayKnow); - (void)syn_get_id(curwin, lnum, col, false, NULL, true); + syn_get_id(curwin, lnum, col, false, NULL, true); int id; int i = 0; @@ -8509,8 +8509,8 @@ static void f_taglist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) if (argvars[1].v_type != VAR_UNKNOWN) { fname = tv_get_string(&argvars[1]); } - (void)get_tags(tv_list_alloc_ret(rettv, kListLenUnknown), - (char *)tag_pattern, (char *)fname); + get_tags(tv_list_alloc_ret(rettv, kListLenUnknown), + (char *)tag_pattern, (char *)fname); } /// "tempname()" function @@ -8629,7 +8629,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) curbuf->b_p_swf = false; apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, false, curbuf); - (void)setfname(curbuf, NameBuff, NULL, true); + setfname(curbuf, NameBuff, NULL, true); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, false, curbuf); // Save the job id and pid in b:terminal_job_{id,pid} diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 42b105b2a2..18168d77b7 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -2909,7 +2909,7 @@ static int tv_blob_index(const blob_T *blob, int len, varnumber_T idx, typval_T return OK; } -int tv_blob_slice_or_index(const blob_T *blob, int is_range, varnumber_T n1, varnumber_T n2, +int tv_blob_slice_or_index(const blob_T *blob, bool is_range, varnumber_T n1, varnumber_T n2, bool exclusive, typval_T *rettv) { int len = tv_blob_len(rettv->vval.v_blob); diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 5d8c173dd1..e74bf39476 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -1175,7 +1175,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett // A Lambda always has the command "return {expr}". It is much faster // to evaluate {expr} directly. ex_nesting_level++; - (void)eval1(&p, rettv, &EVALARG_EVALUATE); + eval1(&p, rettv, &EVALARG_EVALUATE); ex_nesting_level--; } else { // call do_cmdline() to execute the lines @@ -2069,7 +2069,7 @@ char *save_function_name(char **name, bool skip, int flags, funcdict_T *fudi) if (strncmp(p, "<lambda>", 8) == 0) { p += 8; - (void)getdigits(&p, false, 0); + getdigits(&p, false, 0); saved = xmemdupz(*name, (size_t)(p - *name)); if (fudi != NULL) { CLEAR_POINTER(fudi); @@ -3658,7 +3658,7 @@ bool free_unref_funccal(int copyID, int testing) if (did_free_funccal) { // When a funccal was freed some more items might be garbage // collected, so run again. - (void)garbage_collect(testing); + garbage_collect(testing); } return did_free; } diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index dd984e8819..d57874480d 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -378,7 +378,7 @@ void ex_let(exarg_T *eap) if (!eap->skip) { op[0] = '='; op[1] = NUL; - (void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, is_const, op); + ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, is_const, op); } tv_clear(&rettv); } @@ -415,7 +415,7 @@ void ex_let(exarg_T *eap) clear_evalarg(&evalarg, eap); if (!eap->skip && eval_res != FAIL) { - (void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, is_const, op); + ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, is_const, op); } if (eval_res != FAIL) { tv_clear(&rettv); @@ -1303,7 +1303,7 @@ void vars_clear(hashtab_T *ht) } /// Like vars_clear(), but only free the value if "free_val" is true. -void vars_clear_ext(hashtab_T *ht, int free_val) +void vars_clear_ext(hashtab_T *ht, bool free_val) { int todo; hashitem_T *hi; diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c index 230aec6abc..cb9e9293ae 100644 --- a/src/nvim/eval/window.c +++ b/src/nvim/eval/window.c @@ -675,13 +675,13 @@ static void win_move_into_split(win_T *wp, win_T *targetwin, int size, int flags // Remove the old window and frame from the tree of frames int dir; - (void)winframe_remove(wp, &dir, NULL); + winframe_remove(wp, &dir, NULL); win_remove(wp, NULL); last_status(false); // may need to remove last status line - (void)win_comp_pos(); // recompute window positions + win_comp_pos(); // recompute window positions // Split a window on the desired side and put the old window there - (void)win_split_ins(size, flags, wp, dir); + win_split_ins(size, flags, wp, dir); // If splitting horizontally, try to preserve height if (size == 0 && !(flags & WSP_VERT)) { |