mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #2118 from rev112/fix_redundant_cast
Remove redundant casts
This commit is contained in:
commit
c015eabe13
@ -725,7 +725,7 @@ do_bufdel (
|
||||
*/
|
||||
if (bnr == curbuf->b_fnum)
|
||||
do_current = bnr;
|
||||
else if (do_buffer(command, DOBUF_FIRST, FORWARD, (int)bnr,
|
||||
else if (do_buffer(command, DOBUF_FIRST, FORWARD, bnr,
|
||||
forceit) == OK)
|
||||
++deleted;
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ static int win_nolbr_chartabsize(win_T *wp, char_u *s, colnr_T col, int *headp)
|
||||
|
||||
if ((*s == TAB) && (!wp->w_p_list || lcs_tab1)) {
|
||||
n = wp->w_buffer->b_p_ts;
|
||||
return (int)(n - (col % n));
|
||||
return n - (col % n);
|
||||
}
|
||||
n = ptr2cells(s);
|
||||
|
||||
|
@ -545,7 +545,7 @@ edit (
|
||||
mincol = curwin->w_wcol;
|
||||
validate_cursor_col();
|
||||
|
||||
if ((int)curwin->w_wcol < mincol - curbuf->b_p_ts
|
||||
if (curwin->w_wcol < mincol - curbuf->b_p_ts
|
||||
&& curwin->w_wrow == curwin->w_winrow
|
||||
+ curwin->w_height - 1 - p_so
|
||||
&& (curwin->w_cursor.lnum != curwin->w_topline
|
||||
@ -4893,7 +4893,7 @@ insertchar (
|
||||
return;
|
||||
|
||||
/* Check whether this character should end a comment. */
|
||||
if (did_ai && (int)c == end_comment_pending) {
|
||||
if (did_ai && c == end_comment_pending) {
|
||||
char_u *line;
|
||||
char_u lead_end[COM_MAX_LEN]; /* end-comment string */
|
||||
int middle_len, end_len;
|
||||
|
@ -5136,7 +5136,7 @@ void fix_help_buffer(void)
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
char_u *buff_list[1] = {NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &fcount,
|
||||
&fnames, EW_FILE|EW_SILENT) == OK
|
||||
&& fcount > 0) {
|
||||
@ -5308,7 +5308,7 @@ void ex_helptags(exarg_T *eap)
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
char_u *buff_list[1] = {NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &filecount, &files,
|
||||
EW_FILE|EW_SILENT) == FAIL
|
||||
|| filecount == 0) {
|
||||
@ -5411,7 +5411,7 @@ helptags_one (
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
char_u *buff_list[1] = {NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &filecount, &files,
|
||||
EW_FILE|EW_SILENT) == FAIL
|
||||
|| filecount == 0) {
|
||||
|
@ -387,7 +387,7 @@ int dbg_check_skipped(exarg_T *eap)
|
||||
debug_breakpoint_name = debug_skipped_name;
|
||||
/* eap->skip is TRUE */
|
||||
eap->skip = FALSE;
|
||||
(void)dbg_check_breakpoint(eap);
|
||||
dbg_check_breakpoint(eap);
|
||||
eap->skip = TRUE;
|
||||
got_int |= prev_got_int;
|
||||
return TRUE;
|
||||
|
@ -3155,7 +3155,7 @@ get_address (
|
||||
case '?': /* '/' or '?' - search */
|
||||
c = *cmd++;
|
||||
if (skip) { /* skip "/pat/" */
|
||||
cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
|
||||
cmd = skip_regexp(cmd, c, p_magic, NULL);
|
||||
if (*cmd == c)
|
||||
++cmd;
|
||||
} else {
|
||||
@ -5881,13 +5881,13 @@ static void ex_resize(exarg_T *eap)
|
||||
n += curwin->w_width;
|
||||
else if (n == 0 && eap->arg[0] == NUL) /* default is very wide */
|
||||
n = 9999;
|
||||
win_setwidth_win((int)n, wp);
|
||||
win_setwidth_win(n, wp);
|
||||
} else {
|
||||
if (*eap->arg == '-' || *eap->arg == '+')
|
||||
n += curwin->w_height;
|
||||
else if (n == 0 && eap->arg[0] == NUL) /* default is very wide */
|
||||
n = 9999;
|
||||
win_setheight_win((int)n, wp);
|
||||
win_setheight_win(n, wp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6363,7 +6363,7 @@ static void ex_sleep(exarg_T *eap)
|
||||
if (cursor_valid()) {
|
||||
n = curwin->w_winrow + curwin->w_wrow - msg_scrolled;
|
||||
if (n >= 0)
|
||||
ui_cursor_goto((int)n, curwin->w_wincol + curwin->w_wcol);
|
||||
ui_cursor_goto(n, curwin->w_wincol + curwin->w_wcol);
|
||||
}
|
||||
|
||||
len = eap->line2;
|
||||
|
@ -1815,7 +1815,7 @@ void leave_cleanup(cleanup_T *csp)
|
||||
if (aborting() || need_rethrow) {
|
||||
if (pending & CSTP_THROW)
|
||||
/* Cancel the pending exception (includes report). */
|
||||
discard_exception((except_T *)csp->exception, FALSE);
|
||||
discard_exception(csp->exception, FALSE);
|
||||
else
|
||||
report_discard_pending(pending, NULL);
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ retry:
|
||||
* conv_rest[]. */
|
||||
if (tail != NULL) {
|
||||
conv_restlen = (int)((ptr + size) - tail);
|
||||
memmove(conv_rest, (char_u *)tail, conv_restlen);
|
||||
memmove(conv_rest, tail, conv_restlen);
|
||||
size -= conv_restlen;
|
||||
}
|
||||
|
||||
@ -3882,7 +3882,7 @@ static void msg_add_eol(void)
|
||||
static int check_mtime(buf_T *buf, FileInfo *file_info)
|
||||
{
|
||||
if (buf->b_mtime_read != 0
|
||||
&& time_differs((long)file_info->stat.st_mtim.tv_sec,
|
||||
&& time_differs(file_info->stat.st_mtim.tv_sec,
|
||||
buf->b_mtime_read)) {
|
||||
msg_scroll = TRUE; /* don't overwrite messages here */
|
||||
msg_silent = 0; /* must give this prompt */
|
||||
@ -4772,7 +4772,7 @@ buf_check_timestamp (
|
||||
if (!(buf->b_flags & BF_NOTEDITED)
|
||||
&& buf->b_mtime != 0
|
||||
&& (!(file_info_ok = os_fileinfo((char *)buf->b_ffname, &file_info))
|
||||
|| time_differs((long)file_info.stat.st_mtim.tv_sec, buf->b_mtime)
|
||||
|| time_differs(file_info.stat.st_mtim.tv_sec, buf->b_mtime)
|
||||
|| (int)file_info.stat.st_mode != buf->b_orig_mode
|
||||
)) {
|
||||
retval = 1;
|
||||
@ -5084,7 +5084,7 @@ void buf_reload(buf_T *buf, int orig_mode)
|
||||
void buf_store_file_info(buf_T *buf, FileInfo *file_info)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
buf->b_mtime = (long)file_info->stat.st_mtim.tv_sec;
|
||||
buf->b_mtime = file_info->stat.st_mtim.tv_sec;
|
||||
buf->b_orig_size = os_fileinfo_size(file_info);
|
||||
buf->b_orig_mode = (int)file_info->stat.st_mode;
|
||||
}
|
||||
|
@ -1988,7 +1988,7 @@ static void prt_page_margins(double width, double height, double *left, double *
|
||||
static void prt_font_metrics(int font_scale)
|
||||
{
|
||||
prt_line_height = (double)font_scale;
|
||||
prt_char_width = (double)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx);
|
||||
prt_char_width = PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx);
|
||||
}
|
||||
|
||||
|
||||
@ -2027,10 +2027,10 @@ static int prt_get_lpp(void)
|
||||
* font height (based on its bounding box) and the line height, handling the
|
||||
* case where the font height can exceed the line height.
|
||||
*/
|
||||
prt_bgcol_offset = (double)PRT_PS_FONT_TO_USER(prt_line_height,
|
||||
prt_bgcol_offset = PRT_PS_FONT_TO_USER(prt_line_height,
|
||||
prt_ps_font->bbox_min_y);
|
||||
if ((prt_ps_font->bbox_max_y - prt_ps_font->bbox_min_y) < 1000.0) {
|
||||
prt_bgcol_offset -= (double)PRT_PS_FONT_TO_USER(prt_line_height,
|
||||
prt_bgcol_offset -= PRT_PS_FONT_TO_USER(prt_line_height,
|
||||
(1000.0 - (prt_ps_font->bbox_max_y -
|
||||
prt_ps_font->bbox_min_y)) / 2);
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ err_closing:
|
||||
#endif
|
||||
/* expand the cscope exec for env var's */
|
||||
prog = xmalloc(MAXPATHL + 1);
|
||||
expand_env((char_u *)p_csprg, (char_u *)prog, MAXPATHL);
|
||||
expand_env(p_csprg, (char_u *)prog, MAXPATHL);
|
||||
|
||||
/* alloc space to hold the cscope command */
|
||||
len = (int)(strlen(prog) + strlen(csinfo[i].fname) + 32);
|
||||
|
@ -3956,8 +3956,8 @@ static int check_col(int col)
|
||||
{
|
||||
if (col < 0)
|
||||
return 0;
|
||||
if (col >= (int)screen_Columns)
|
||||
return (int)screen_Columns - 1;
|
||||
if (col >= screen_Columns)
|
||||
return screen_Columns - 1;
|
||||
return col;
|
||||
}
|
||||
|
||||
@ -3966,7 +3966,7 @@ static int check_row(int row)
|
||||
{
|
||||
if (row < 0)
|
||||
return 0;
|
||||
if (row >= (int)screen_Rows)
|
||||
return (int)screen_Rows - 1;
|
||||
if (row >= screen_Rows)
|
||||
return screen_Rows - 1;
|
||||
return row;
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ static void set_b0_fname(ZERO_BL *b0p, buf_T *buf)
|
||||
}
|
||||
FileInfo file_info;
|
||||
if (os_fileinfo((char *)buf->b_ffname, &file_info)) {
|
||||
long_to_char((long)file_info.stat.st_mtim.tv_sec, b0p->b0_mtime);
|
||||
long_to_char(file_info.stat.st_mtim.tv_sec, b0p->b0_mtime);
|
||||
long_to_char((long)os_fileinfo_inode(&file_info), b0p->b0_ino);
|
||||
buf_store_file_info(buf, &file_info);
|
||||
buf->b_mtime_read = buf->b_mtime;
|
||||
|
@ -1261,7 +1261,7 @@ plines_win_nofill (
|
||||
|
||||
lines = plines_win_nofold(wp, lnum);
|
||||
if (winheight > 0 && lines > wp->w_height)
|
||||
return (int)wp->w_height;
|
||||
return wp->w_height;
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
@ -1727,7 +1727,7 @@ static void op_colon(oparg_T *oap)
|
||||
stuffcharReadbuff('$');
|
||||
else if (oap->start.lnum == curwin->w_cursor.lnum) {
|
||||
stuffReadbuff((char_u *)".+");
|
||||
stuffnumReadbuff((long)oap->line_count - 1);
|
||||
stuffnumReadbuff(oap->line_count - 1);
|
||||
} else
|
||||
stuffnumReadbuff((long)oap->end.lnum);
|
||||
}
|
||||
@ -3192,7 +3192,7 @@ static void nv_help(cmdarg_T *cap)
|
||||
static void nv_addsub(cmdarg_T *cap)
|
||||
{
|
||||
if (!checkclearopq(cap->oap)
|
||||
&& do_addsub((int)cap->cmdchar, cap->count1))
|
||||
&& do_addsub(cap->cmdchar, cap->count1))
|
||||
prep_redo_cmd(cap);
|
||||
}
|
||||
|
||||
@ -4038,7 +4038,7 @@ static void nv_colon(cmdarg_T *cap)
|
||||
stuffcharReadbuff('.');
|
||||
if (cap->count0 > 1) {
|
||||
stuffReadbuff((char_u *)",.+");
|
||||
stuffnumReadbuff((long)cap->count0 - 1L);
|
||||
stuffnumReadbuff(cap->count0 - 1L);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4758,7 +4758,7 @@ static void nv_dollar(cmdarg_T *cap)
|
||||
if (!virtual_active() || gchar_cursor() != NUL
|
||||
|| cap->oap->op_type == OP_NOP)
|
||||
curwin->w_curswant = MAXCOL; /* so we stay at the end */
|
||||
if (cursor_down((long)(cap->count1 - 1),
|
||||
if (cursor_down(cap->count1 - 1,
|
||||
cap->oap->op_type == OP_NOP) == false)
|
||||
clearopbeep(cap->oap);
|
||||
else if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
|
||||
@ -6180,7 +6180,7 @@ static void nv_g_cmd(cmdarg_T *cap)
|
||||
cap->oap->motion_type = MCHAR;
|
||||
cap->oap->inclusive = true;
|
||||
curwin->w_curswant = MAXCOL;
|
||||
if (cursor_down((long)(cap->count1 - 1),
|
||||
if (cursor_down(cap->count1 - 1,
|
||||
cap->oap->op_type == OP_NOP) == false)
|
||||
clearopbeep(cap->oap);
|
||||
else {
|
||||
|
@ -1494,7 +1494,7 @@ int op_delete(oparg_T *oap)
|
||||
if (oap->line_count > 1) {
|
||||
lnum = curwin->w_cursor.lnum;
|
||||
++curwin->w_cursor.lnum;
|
||||
del_lines((long)(oap->line_count - 1), TRUE);
|
||||
del_lines(oap->line_count - 1, TRUE);
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
}
|
||||
if (u_save_cursor() == FAIL)
|
||||
@ -1607,7 +1607,7 @@ int op_delete(oparg_T *oap)
|
||||
|
||||
curpos = curwin->w_cursor; /* remember curwin->w_cursor */
|
||||
++curwin->w_cursor.lnum;
|
||||
del_lines((long)(oap->line_count - 2), FALSE);
|
||||
del_lines(oap->line_count - 2, FALSE);
|
||||
|
||||
if (delete_last_line)
|
||||
oap->end.lnum = curbuf->b_ml.ml_line_count;
|
||||
|
@ -396,7 +396,7 @@ static vimoption_T
|
||||
{(char_u *)FALSE, (char_u *)FALSE}
|
||||
SCRIPTID_INIT},
|
||||
{"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM|P_CURSWANT,
|
||||
(char_u *)VAR_WIN, PV_ARAB,
|
||||
VAR_WIN, PV_ARAB,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"arabicshape", "arshape", P_BOOL|P_VI_DEF|P_VIM|P_RCLR,
|
||||
(char_u *)&p_arshape, PV_NONE,
|
||||
@ -476,11 +476,11 @@ static vimoption_T
|
||||
{(char_u *)" \t!@*-+;:,./?", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"breakindent", "bri", P_BOOL|P_VI_DEF|P_VIM|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_BRI,
|
||||
VAR_WIN, PV_BRI,
|
||||
{(char_u *)FALSE, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"breakindentopt", "briopt", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_COMMA|P_NODUP,
|
||||
(char_u *)VAR_WIN, PV_BRIOPT,
|
||||
VAR_WIN, PV_BRIOPT,
|
||||
{(char_u *)"", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"browsedir", "bsdir",P_STRING|P_VI_DEF,
|
||||
@ -541,7 +541,7 @@ static vimoption_T
|
||||
(char_u *)&p_cwh, PV_NONE,
|
||||
{(char_u *)7L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"colorcolumn", "cc", P_STRING|P_VI_DEF|P_COMMA|P_NODUP|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_CC,
|
||||
VAR_WIN, PV_CC,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
|
||||
(char_u *)&Columns, PV_NONE,
|
||||
@ -566,11 +566,11 @@ static vimoption_T
|
||||
{(char_u *)".,w,b,u,t,i", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"concealcursor","cocu", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
|
||||
(char_u *)VAR_WIN, PV_COCU,
|
||||
VAR_WIN, PV_COCU,
|
||||
{(char_u *)"", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"conceallevel","cole", P_NUM|P_RWIN|P_VI_DEF,
|
||||
(char_u *)VAR_WIN, PV_COLE,
|
||||
VAR_WIN, PV_COLE,
|
||||
{(char_u *)0L, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"completefunc", "cfu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE,
|
||||
@ -615,13 +615,13 @@ static vimoption_T
|
||||
(char_u *)&p_csverbose, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"cursorbind", "crb", P_BOOL|P_VI_DEF,
|
||||
(char_u *)VAR_WIN, PV_CRBIND,
|
||||
VAR_WIN, PV_CRBIND,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_CUC,
|
||||
VAR_WIN, PV_CUC,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_CUL,
|
||||
VAR_WIN, PV_CUL,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"debug", NULL, P_STRING|P_VI_DEF,
|
||||
(char_u *)&p_debug, PV_NONE,
|
||||
@ -637,7 +637,7 @@ static vimoption_T
|
||||
(char_u *)&p_dict, PV_DICT,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"diff", NULL, P_BOOL|P_VI_DEF|P_RWIN|P_NOGLOB,
|
||||
(char_u *)VAR_WIN, PV_DIFF,
|
||||
VAR_WIN, PV_DIFF,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE|P_CURSWANT,
|
||||
(char_u *)&p_dex, PV_NONE,
|
||||
@ -743,44 +743,44 @@ static vimoption_T
|
||||
(char_u *)&p_fcl, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldcolumn", "fdc", P_NUM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDC,
|
||||
VAR_WIN, PV_FDC,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldenable", "fen", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FEN,
|
||||
VAR_WIN, PV_FEN,
|
||||
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldexpr", "fde", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDE,
|
||||
VAR_WIN, PV_FDE,
|
||||
{(char_u *)"0", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"foldignore", "fdi", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDI,
|
||||
VAR_WIN, PV_FDI,
|
||||
{(char_u *)"#", (char_u *)NULL} SCRIPTID_INIT},
|
||||
{"foldlevel", "fdl", P_NUM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDL,
|
||||
VAR_WIN, PV_FDL,
|
||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldlevelstart","fdls", P_NUM|P_VI_DEF|P_CURSWANT,
|
||||
(char_u *)&p_fdls, PV_NONE,
|
||||
{(char_u *)-1L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldmarker", "fmr", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|
|
||||
P_RWIN|P_COMMA|P_NODUP,
|
||||
(char_u *)VAR_WIN, PV_FMR,
|
||||
VAR_WIN, PV_FMR,
|
||||
{(char_u *)"{{{,}}}", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"foldmethod", "fdm", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDM,
|
||||
VAR_WIN, PV_FDM,
|
||||
{(char_u *)"manual", (char_u *)NULL} SCRIPTID_INIT},
|
||||
{"foldminlines","fml", P_NUM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FML,
|
||||
VAR_WIN, PV_FML,
|
||||
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldnestmax", "fdn", P_NUM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDN,
|
||||
VAR_WIN, PV_FDN,
|
||||
{(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldopen", "fdo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP|P_CURSWANT,
|
||||
(char_u *)&p_fdo, PV_NONE,
|
||||
{(char_u *)"block,hor,mark,percent,quickfix,search,tag,undo",
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"foldtext", "fdt", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_FDT,
|
||||
VAR_WIN, PV_FDT,
|
||||
{(char_u *)"foldtext()", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"formatexpr", "fex", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
|
||||
@ -1037,7 +1037,7 @@ static vimoption_T
|
||||
(char_u *)&p_lz, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_LBR,
|
||||
VAR_WIN, PV_LBR,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"lines", NULL, P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
|
||||
(char_u *)&Rows, PV_NONE,
|
||||
@ -1057,7 +1057,7 @@ static vimoption_T
|
||||
{(char_u *)LISPWORD_VALUE, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"list", NULL, P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_LIST,
|
||||
VAR_WIN, PV_LIST,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"listchars", "lcs", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
|
||||
(char_u *)&p_lcs, PV_NONE,
|
||||
@ -1161,10 +1161,10 @@ static vimoption_T
|
||||
{(char_u *)"octal,hex", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_NU,
|
||||
VAR_WIN, PV_NU,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
|
||||
(char_u *)VAR_WIN, PV_NUW,
|
||||
VAR_WIN, PV_NUW,
|
||||
{(char_u *)8L, (char_u *)4L} SCRIPTID_INIT},
|
||||
{"omnifunc", "ofu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_ofu, PV_OFU,
|
||||
@ -1213,7 +1213,7 @@ static vimoption_T
|
||||
(char_u *)&p_pvh, PV_NONE,
|
||||
{(char_u *)12L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB,
|
||||
(char_u *)VAR_WIN, PV_PVW,
|
||||
VAR_WIN, PV_PVW,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"printdevice", "pdev", P_STRING|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_pdev, PV_NONE,
|
||||
@ -1273,7 +1273,7 @@ static vimoption_T
|
||||
(char_u *)&p_re, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_RNU,
|
||||
VAR_WIN, PV_RNU,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"remap", NULL, P_BOOL|P_VI_DEF,
|
||||
(char_u *)&p_remap, PV_NONE,
|
||||
@ -1288,10 +1288,10 @@ static vimoption_T
|
||||
(char_u *)&p_ri, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"rightleft", "rl", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_RL,
|
||||
VAR_WIN, PV_RL,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"rightleftcmd", "rlc", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_RLC,
|
||||
VAR_WIN, PV_RLC,
|
||||
{(char_u *)"search", (char_u *)NULL}
|
||||
SCRIPTID_INIT},
|
||||
{"ruler", "ru", P_BOOL|P_VI_DEF|P_VIM|P_RSTAT,
|
||||
@ -1305,10 +1305,10 @@ static vimoption_T
|
||||
{(char_u *)DFLT_RUNTIMEPATH, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"scroll", "scr", P_NUM|P_NO_MKRC|P_VI_DEF,
|
||||
(char_u *)VAR_WIN, PV_SCROLL,
|
||||
VAR_WIN, PV_SCROLL,
|
||||
{(char_u *)12L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"scrollbind", "scb", P_BOOL|P_VI_DEF,
|
||||
(char_u *)VAR_WIN, PV_SCBIND,
|
||||
VAR_WIN, PV_SCBIND,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM,
|
||||
(char_u *)&p_sj, PV_NONE,
|
||||
@ -1449,7 +1449,7 @@ static vimoption_T
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_SPELL,
|
||||
VAR_WIN, PV_SPELL,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF,
|
||||
(char_u *)&p_spc, PV_SPC,
|
||||
@ -1687,10 +1687,10 @@ static vimoption_T
|
||||
(char_u *)&p_wh, PV_NONE,
|
||||
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT,
|
||||
(char_u *)VAR_WIN, PV_WFH,
|
||||
VAR_WIN, PV_WFH,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT,
|
||||
(char_u *)VAR_WIN, PV_WFW,
|
||||
VAR_WIN, PV_WFW,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"winminheight", "wmh", P_NUM|P_VI_DEF,
|
||||
(char_u *)&p_wmh, PV_NONE,
|
||||
@ -1702,7 +1702,7 @@ static vimoption_T
|
||||
(char_u *)&p_wiw, PV_NONE,
|
||||
{(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN,
|
||||
(char_u *)VAR_WIN, PV_WRAP,
|
||||
VAR_WIN, PV_WRAP,
|
||||
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"wrapmargin", "wm", P_NUM|P_VI_DEF,
|
||||
(char_u *)&p_wm, PV_WM,
|
||||
|
@ -3554,7 +3554,7 @@ void ex_helpgrep(exarg_T *eap)
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
char_u *buff_list[1] = {NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &fcount,
|
||||
&fnames, EW_FILE|EW_SILENT) == OK
|
||||
&& fcount > 0) {
|
||||
|
@ -1500,7 +1500,7 @@ static void win_update(win_T *wp)
|
||||
*/
|
||||
screen_fill(wp->w_winrow + wp->w_height - 1,
|
||||
wp->w_winrow + wp->w_height,
|
||||
(int)W_ENDCOL(wp) - 3, (int)W_ENDCOL(wp),
|
||||
W_ENDCOL(wp) - 3, W_ENDCOL(wp),
|
||||
'@', '@', hl_attr(HLF_AT));
|
||||
set_empty_rows(wp, srow);
|
||||
wp->w_botline = lnum;
|
||||
@ -1593,7 +1593,7 @@ static void win_draw_end(win_T *wp, int c1, int c2, int row, int endrow, hlf_T h
|
||||
if (n > wp->w_width)
|
||||
n = wp->w_width;
|
||||
screen_fill(wp->w_winrow + row, wp->w_winrow + endrow,
|
||||
W_ENDCOL(wp) - n, (int)W_ENDCOL(wp),
|
||||
W_ENDCOL(wp) - n, W_ENDCOL(wp),
|
||||
' ', ' ', hl_attr(HLF_FC));
|
||||
}
|
||||
|
||||
@ -1605,7 +1605,7 @@ static void win_draw_end(win_T *wp, int c1, int c2, int row, int endrow, hlf_T h
|
||||
nn = wp->w_width;
|
||||
}
|
||||
screen_fill(wp->w_winrow + row, wp->w_winrow + endrow,
|
||||
W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n,
|
||||
W_ENDCOL(wp) - nn, W_ENDCOL(wp) - n,
|
||||
' ', ' ', hl_attr(HLF_SC));
|
||||
n = nn;
|
||||
}
|
||||
@ -1653,7 +1653,7 @@ static void win_draw_end(win_T *wp, int c1, int c2, int row, int endrow, hlf_T h
|
||||
}
|
||||
|
||||
screen_fill(wp->w_winrow + row, wp->w_winrow + endrow,
|
||||
wp->w_wincol + FDC_OFF, (int)W_ENDCOL(wp),
|
||||
wp->w_wincol + FDC_OFF, W_ENDCOL(wp),
|
||||
c1, c2, hl_attr(hl));
|
||||
}
|
||||
set_empty_rows(wp, row);
|
||||
@ -4779,7 +4779,7 @@ void win_redr_status(win_T *wp)
|
||||
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);
|
||||
|
||||
if (get_keymap_str(wp, NameBuff, MAXPATHL)
|
||||
&& (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
|
||||
&& this_ru_col - len > (int)(STRLEN(NameBuff) + 1))
|
||||
screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
|
||||
- 1 + wp->w_wincol), attr);
|
||||
|
||||
@ -6204,7 +6204,7 @@ void setcursor(void)
|
||||
curwin->w_wincol + (
|
||||
/* With 'rightleft' set and the cursor on a double-wide
|
||||
* character, position it on the leftmost column. */
|
||||
curwin->w_p_rl ? ((int)curwin->w_width - curwin->w_wcol - (
|
||||
curwin->w_p_rl ? (curwin->w_width - curwin->w_wcol - (
|
||||
(has_mbyte
|
||||
&& (*mb_ptr2cells)(get_cursor_pos_ptr()) == 2
|
||||
&& vim_isprintc(gchar_cursor())) ? 2 :
|
||||
@ -6265,7 +6265,7 @@ int win_ins_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
||||
if (lastrow > Rows)
|
||||
lastrow = Rows;
|
||||
screen_fill(nextrow - line_count, lastrow - line_count,
|
||||
wp->w_wincol, (int)W_ENDCOL(wp),
|
||||
wp->w_wincol, W_ENDCOL(wp),
|
||||
' ', ' ', 0);
|
||||
}
|
||||
|
||||
@ -6345,7 +6345,7 @@ static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int de
|
||||
// Delete all remaining lines
|
||||
if (row + line_count >= wp->w_height) {
|
||||
screen_fill(wp->w_winrow + row, wp->w_winrow + wp->w_height,
|
||||
wp->w_wincol, (int)W_ENDCOL(wp),
|
||||
wp->w_wincol, W_ENDCOL(wp),
|
||||
' ', ' ', 0);
|
||||
return OK;
|
||||
}
|
||||
@ -7103,7 +7103,7 @@ static void win_redr_ruler(win_T *wp, int always)
|
||||
i = redraw_cmdline;
|
||||
screen_fill(row, row + 1,
|
||||
this_ru_col + off + (int)STRLEN(buffer),
|
||||
(int)(off + width),
|
||||
off + width,
|
||||
fillchar, fillchar, attr);
|
||||
/* don't redraw the cmdline because of showing the ruler */
|
||||
redraw_cmdline = i;
|
||||
|
@ -986,7 +986,7 @@ int do_search(
|
||||
* If there is a matching '/' or '?', toss it.
|
||||
*/
|
||||
ps = strcopy;
|
||||
p = skip_regexp(pat, dirc, (int)p_magic, &strcopy);
|
||||
p = skip_regexp(pat, dirc, p_magic, &strcopy);
|
||||
if (strcopy != ps) {
|
||||
/* made a copy of "pat" to change "\?" to "?" */
|
||||
searchcmdlen += (int)(STRLEN(pat) - STRLEN(strcopy));
|
||||
@ -3811,7 +3811,7 @@ current_search (
|
||||
flags = SEARCH_END;
|
||||
|
||||
int result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD),
|
||||
spats[last_idx].pat, (long) (i ? count : 1),
|
||||
spats[last_idx].pat, i ? count : 1,
|
||||
SEARCH_KEEP | flags, RE_SEARCH, 0, NULL);
|
||||
|
||||
/* First search may fail, but then start searching from the
|
||||
|
@ -333,7 +333,7 @@ bool sha256_self_test(void)
|
||||
memset(buf, 'a', 1000);
|
||||
|
||||
for (size_t j = 0; j < 1000; j++) {
|
||||
sha256_update(&ctx, (char_u *) buf, 1000);
|
||||
sha256_update(&ctx, buf, 1000);
|
||||
}
|
||||
sha256_finish(&ctx, sha256sum);
|
||||
|
||||
|
@ -2541,7 +2541,7 @@ spell_load_file (
|
||||
EMSG2(_(e_notopen), fname);
|
||||
else if (p_verbose > 2) {
|
||||
verbose_enter();
|
||||
smsg((char_u *)e_notopen, fname);
|
||||
smsg(e_notopen, fname);
|
||||
verbose_leave();
|
||||
}
|
||||
goto endFAIL;
|
||||
@ -5480,7 +5480,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
|
||||
}
|
||||
|
||||
// Store the word in the hashtable to be able to find duplicates.
|
||||
dw = (char_u *)getroom_save(spin, w);
|
||||
dw = getroom_save(spin, w);
|
||||
if (dw == NULL) {
|
||||
retval = FAIL;
|
||||
free(pc);
|
||||
@ -10904,7 +10904,7 @@ stp_sal_score (
|
||||
char_u goodword[MAXWLEN];
|
||||
int lendiff;
|
||||
|
||||
lendiff = (int)(su->su_badlen - stp->st_orglen);
|
||||
lendiff = su->su_badlen - stp->st_orglen;
|
||||
if (lendiff >= 0)
|
||||
pbad = badsound;
|
||||
else {
|
||||
|
@ -3223,8 +3223,8 @@ static void syn_clear_one(int id, int syncing)
|
||||
|
||||
/* Clear keywords only when not ":syn sync clear group-name" */
|
||||
if (!syncing) {
|
||||
(void)syn_clear_keyword(id, &curwin->w_s->b_keywtab);
|
||||
(void)syn_clear_keyword(id, &curwin->w_s->b_keywtab_ic);
|
||||
syn_clear_keyword(id, &curwin->w_s->b_keywtab);
|
||||
syn_clear_keyword(id, &curwin->w_s->b_keywtab_ic);
|
||||
}
|
||||
|
||||
/* clear the patterns for "id" */
|
||||
@ -6068,7 +6068,7 @@ do_highlight (
|
||||
if (ends_excmd(*line)) {
|
||||
for (int i = 1; i <= highlight_ga.ga_len && !got_int; ++i)
|
||||
/* TODO: only call when the group has attributes set */
|
||||
highlight_list_one((int)i);
|
||||
highlight_list_one(i);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1003,7 +1003,7 @@ static int tag_strnicmp(char_u *s1, char_u *s2, size_t len)
|
||||
int i;
|
||||
|
||||
while (len > 0) {
|
||||
i = (int)TOUPPER_ASC(*s1) - (int)TOUPPER_ASC(*s2);
|
||||
i = TOUPPER_ASC(*s1) - TOUPPER_ASC(*s2);
|
||||
if (i != 0)
|
||||
return i; /* this character different */
|
||||
if (*s1 == NUL)
|
||||
@ -1583,7 +1583,7 @@ parse_line:
|
||||
*/
|
||||
i = (int)tagp.tagname[0];
|
||||
if (sortic)
|
||||
i = (int)TOUPPER_ASC(tagp.tagname[0]);
|
||||
i = TOUPPER_ASC(tagp.tagname[0]);
|
||||
if (i < search_info.low_char || i > search_info.high_char)
|
||||
sort_error = TRUE;
|
||||
|
||||
@ -2590,7 +2590,7 @@ static char_u *expand_tag_fname(char_u *fname, char_u *tag_fname, int expand)
|
||||
if (expand && mch_has_wildcard(fname)) {
|
||||
ExpandInit(&xpc);
|
||||
xpc.xp_context = EXPAND_FILES;
|
||||
expanded_fname = ExpandOne(&xpc, (char_u *)fname, NULL,
|
||||
expanded_fname = ExpandOne(&xpc, fname, NULL,
|
||||
WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
|
||||
if (expanded_fname != NULL)
|
||||
fname = expanded_fname;
|
||||
|
@ -66,7 +66,7 @@ void vim_deltempdir(void)
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically
|
||||
// sized array so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
char_u *buff_list[1] = {NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &file_count, &files,
|
||||
EW_DIR|EW_FILE|EW_SILENT) == OK) {
|
||||
for (int i = 0; i < file_count; ++i) {
|
||||
|
@ -110,7 +110,7 @@ void tui_start(void)
|
||||
unibi_out(ui, unibi_enter_ca_mode);
|
||||
unibi_out(ui, unibi_clear_screen);
|
||||
// Enable bracketed paste
|
||||
unibi_out(ui, (int)data->unibi_ext.enable_bracketed_paste);
|
||||
unibi_out(ui, data->unibi_ext.enable_bracketed_paste);
|
||||
|
||||
// setup output handle in a separate event loop(we wanna do synchronous
|
||||
// write to the tty)
|
||||
@ -172,7 +172,7 @@ static void tui_stop(UI *ui)
|
||||
unibi_out(ui, unibi_cursor_normal);
|
||||
unibi_out(ui, unibi_exit_ca_mode);
|
||||
// Disable bracketed paste
|
||||
unibi_out(ui, (int)data->unibi_ext.disable_bracketed_paste);
|
||||
unibi_out(ui, data->unibi_ext.disable_bracketed_paste);
|
||||
flush_buf(ui);
|
||||
uv_tty_reset_mode();
|
||||
uv_close((uv_handle_t *)&data->output_handle, NULL);
|
||||
@ -355,25 +355,25 @@ static void tui_cursor_off(UI *ui)
|
||||
static void tui_mouse_on(UI *ui)
|
||||
{
|
||||
TUIData *data = ui->data;
|
||||
unibi_out(ui, (int)data->unibi_ext.enable_mouse);
|
||||
unibi_out(ui, data->unibi_ext.enable_mouse);
|
||||
}
|
||||
|
||||
static void tui_mouse_off(UI *ui)
|
||||
{
|
||||
TUIData *data = ui->data;
|
||||
unibi_out(ui, (int)data->unibi_ext.disable_mouse);
|
||||
unibi_out(ui, data->unibi_ext.disable_mouse);
|
||||
}
|
||||
|
||||
static void tui_insert_mode(UI *ui)
|
||||
{
|
||||
TUIData *data = ui->data;
|
||||
unibi_out(ui, (int)data->unibi_ext.enter_insert_mode);
|
||||
unibi_out(ui, data->unibi_ext.enter_insert_mode);
|
||||
}
|
||||
|
||||
static void tui_normal_mode(UI *ui)
|
||||
{
|
||||
TUIData *data = ui->data;
|
||||
unibi_out(ui, (int)data->unibi_ext.exit_insert_mode);
|
||||
unibi_out(ui, data->unibi_ext.exit_insert_mode);
|
||||
}
|
||||
|
||||
static void tui_set_scroll_region(UI *ui, int top, int bot, int left,
|
||||
|
@ -4764,7 +4764,7 @@ void command_height(void)
|
||||
|
||||
/* clear the lines added to cmdline */
|
||||
if (full_screen)
|
||||
screen_fill((int)(cmdline_row), (int)Rows, 0,
|
||||
screen_fill(cmdline_row, (int)Rows, 0,
|
||||
(int)Columns, ' ', ' ', 0);
|
||||
msg_row = cmdline_row;
|
||||
redraw_cmdline = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user