Patch 8.2.4241

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 28, 2022, 10:28:41 AM1/28/22
to vim...@googlegroups.com

Patch 8.2.4241
Problem: Some type casts are redundant.
Solution: Remove the type casts. (closes #9643)
Files: src/blob.c, src/buffer.c, src/channel.c, src/clientserver.c,
src/clipboard.c, src/drawline.c, src/drawscreen.c, src/edit.c,
src/evalfunc.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_eval.c,
src/fold.c, src/if_cscope.c, src/json.c, src/match.c,
src/memline.c, src/message.c, src/misc1.c, src/normal.c,
src/ops.c, src/option.c, src/optionstr.c, src/os_unix.c,
src/register.c, src/sign.c, src/spellfile.c, src/tag.c, src/ui.c,
src/undo.c, src/window.c


*** ../vim-8.2.4240/src/blob.c 2022-01-01 14:19:44.028353885 +0000
--- src/blob.c 2022-01-28 15:18:28.493642198 +0000
***************
*** 237,243 ****
{
if (i > 0 && (i & 3) == 0)
ga_concat(&ga, (char_u *)".");
! vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", (int)blob_get(blob, i));
ga_concat(&ga, numbuf);
}
ga_append(&ga, NUL); // append a NUL at the end
--- 237,243 ----
{
if (i > 0 && (i & 3) == 0)
ga_concat(&ga, (char_u *)".");
! vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", blob_get(blob, i));
ga_concat(&ga, numbuf);
}
ga_append(&ga, NUL); // append a NUL at the end
*** ../vim-8.2.4240/src/buffer.c 2022-01-22 13:39:04.103476264 +0000
--- src/buffer.c 2022-01-28 15:18:28.493642198 +0000
***************
*** 1624,1630 ****
// also be deleted, etc.
if (bnr == curbuf->b_fnum)
do_current = bnr;
! else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, (int)bnr,
DOBUF_NOPOPUP | (forceit ? DOBUF_FORCEIT : 0)) == OK)
++deleted;

--- 1624,1630 ----
// also be deleted, etc.
if (bnr == curbuf->b_fnum)
do_current = bnr;
! else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, bnr,
DOBUF_NOPOPUP | (forceit ? DOBUF_FORCEIT : 0)) == OK)
++deleted;

***************
*** 3754,3760 ****
}
else
{
! p = (char *)msg_trunc_attr(buffer, FALSE, 0);
if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
// Need to repeat the message after redrawing when:
// - When restart_edit is set (otherwise there will be a delay
--- 3754,3760 ----
}
else
{
! p = msg_trunc_attr(buffer, FALSE, 0);
if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
// Need to repeat the message after redrawing when:
// - When restart_edit is set (otherwise there will be a delay
*** ../vim-8.2.4240/src/channel.c 2022-01-08 16:19:18.497639954 +0000
--- src/channel.c 2022-01-28 14:45:44.691961144 +0000
***************
*** 816,822 ****
ch_log(channel,
"Waiting for connection (waiting %d msec)...", waitnow);

! ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv);
if (ret < 0)
{
SOCK_ERRNO;
--- 816,822 ----
ch_log(channel,
"Waiting for connection (waiting %d msec)...", waitnow);

! ret = select(sd + 1, &rfds, &wfds, NULL, &tv);
if (ret < 0)
{
SOCK_ERRNO;
*** ../vim-8.2.4240/src/clientserver.c 2022-01-05 20:24:34.268005660 +0000
--- src/clientserver.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 34,40 ****
// The last but one parameter of replace_termcodes() is TRUE so that the
// <lt> sequence is recognised - needed for a real backslash.
p_cpo = (char_u *)"Bk";
! str = replace_termcodes((char_u *)str, &ptr, REPTERM_DO_LT, NULL);
p_cpo = cpo_save;

if (*ptr != NUL) // trailing CTRL-V results in nothing
--- 34,40 ----
// The last but one parameter of replace_termcodes() is TRUE so that the
// <lt> sequence is recognised - needed for a real backslash.
p_cpo = (char_u *)"Bk";
! str = replace_termcodes(str, &ptr, REPTERM_DO_LT, NULL);
p_cpo = cpo_save;

if (*ptr != NUL) // trailing CTRL-V results in nothing
***************
*** 55,61 ****
// buffer.
typebuf_was_filled = TRUE;
}
! vim_free((char_u *)ptr);
}

/*
--- 55,61 ----
// buffer.
typebuf_was_filled = TRUE;
}
! vim_free(ptr);
}

/*
*** ../vim-8.2.4240/src/clipboard.c 2022-01-08 12:41:12.200795557 +0000
--- src/clipboard.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 1488,1494 ****
// create NUL terminated string which XmbTextListToTextProperty wants
mch_memmove(string_nt, string, (size_t)*length);
string_nt[*length] = NUL;
! conv_result = XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt,
1, XCompoundTextStyle, &text_prop);
if (conv_result != Success)
{
--- 1488,1494 ----
// create NUL terminated string which XmbTextListToTextProperty wants
mch_memmove(string_nt, string, (size_t)*length);
string_nt[*length] = NUL;
! conv_result = XmbTextListToTextProperty(X_DISPLAY, &string_nt,
1, XCompoundTextStyle, &text_prop);
if (conv_result != Success)
{
*** ../vim-8.2.4240/src/drawline.c 2022-01-11 13:14:32.978510736 +0000
--- src/drawline.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 1357,1363 ****
#endif
)
{
! screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
screen_line_flags);
// Pretend we have finished updating the window. Except when
// 'cursorcolumn' is set.
--- 1357,1363 ----
#endif
)
{
! screen_line(screen_row, wp->w_wincol, col, -wp->w_width,
screen_line_flags);
// Pretend we have finished updating the window. Except when
// 'cursorcolumn' is set.
***************
*** 2846,2852 ****
#endif

screen_line(screen_row, wp->w_wincol, col,
! (int)wp->w_width, screen_line_flags);
row++;

// Update w_cline_height and w_cline_folded if the cursor line was
--- 2846,2852 ----
#endif

screen_line(screen_row, wp->w_wincol, col,
! wp->w_width, screen_line_flags);
row++;

// Update w_cline_height and w_cline_folded if the cursor line was
***************
*** 3147,3157 ****
{
#ifdef FEAT_CONCEAL
screen_line(screen_row, wp->w_wincol, col - boguscols,
! (int)wp->w_width, screen_line_flags);
boguscols = 0;
#else
screen_line(screen_row, wp->w_wincol, col,
! (int)wp->w_width, screen_line_flags);
#endif
++row;
++screen_row;
--- 3147,3157 ----
{
#ifdef FEAT_CONCEAL
screen_line(screen_row, wp->w_wincol, col - boguscols,
! wp->w_width, screen_line_flags);
boguscols = 0;
#else
screen_line(screen_row, wp->w_wincol, col,
! wp->w_width, screen_line_flags);
#endif
++row;
++screen_row;
*** ../vim-8.2.4240/src/drawscreen.c 2022-01-16 13:58:29.878203450 +0000
--- src/drawscreen.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 538,544 ****
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);

if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)
! && (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
- 1 + wp->w_wincol), attr);

--- 538,544 ----
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);

if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)
! && (this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
- 1 + wp->w_wincol), attr);

***************
*** 797,803 ****
i = redraw_cmdline;
screen_fill(row, row + 1,
this_ru_col + off + (int)STRLEN(buffer),
! (int)(off + width),
fillchar, fillchar, attr);
// don't redraw the cmdline because of showing the ruler
redraw_cmdline = i;
--- 797,803 ----
i = redraw_cmdline;
screen_fill(row, row + 1,
this_ru_col + off + (int)STRLEN(buffer),
! (off + width),
fillchar, fillchar, attr);
// don't redraw the cmdline because of showing the ruler
redraw_cmdline = i;
***************
*** 1038,1045 ****
}
wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker

! screen_line(wp->w_winrow, wp->w_wincol, (int)wp->w_width,
! (int)wp->w_width, 0);
}
#endif

--- 1038,1044 ----
}
wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker

! screen_line(wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, 0);
}
#endif

***************
*** 1372,1379 ****
}
#endif

! screen_line(row + W_WINROW(wp), wp->w_wincol, (int)wp->w_width,
! (int)wp->w_width, 0);

// Update w_cline_height and w_cline_folded if the cursor line was
// updated (saves a call to plines() later).
--- 1371,1377 ----
}
#endif

! screen_line(row + W_WINROW(wp), wp->w_wincol, wp->w_width, wp->w_width, 0);

// Update w_cline_height and w_cline_folded if the cursor line was
// updated (saves a call to plines() later).
*** ../vim-8.2.4240/src/edit.c 2022-01-25 20:45:13.210333180 +0000
--- src/edit.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 523,529 ****

if (
#ifdef FEAT_VARTABS
! (int)curwin->w_wcol < mincol - tabstop_at(
get_nolist_virtcol(), curbuf->b_p_ts,
curbuf->b_p_vts_array)
#else
--- 523,529 ----

if (
#ifdef FEAT_VARTABS
! curwin->w_wcol < mincol - tabstop_at(
get_nolist_virtcol(), curbuf->b_p_ts,
curbuf->b_p_vts_array)
#else
***************
*** 2134,2140 ****
return;

// Check whether this character should end a comment.
! if (did_ai && (int)c == end_comment_pending)
{
char_u *line;
char_u lead_end[COM_MAX_LEN]; // end-comment string
--- 2134,2140 ----
return;

// Check whether this character should end a comment.
! if (did_ai && c == end_comment_pending)
{
char_u *line;
char_u lead_end[COM_MAX_LEN]; // end-comment string
***************
*** 2907,2913 ****
// may want to stuff the command character, to start Insert mode
if (c != NUL)
stuffcharReadbuff(c);
! if ((esc_ptr = (char_u *)vim_strrchr(ptr, ESC)) != NULL)
*esc_ptr = NUL; // remove the ESC

// when the last char is either "0" or "^" it will be quoted if no ESC
--- 2907,2913 ----
// may want to stuff the command character, to start Insert mode
if (c != NUL)
stuffcharReadbuff(c);
! if ((esc_ptr = vim_strrchr(ptr, ESC)) != NULL)
*esc_ptr = NUL; // remove the ESC

// when the last char is either "0" or "^" it will be quoted if no ESC
*** ../vim-8.2.4240/src/evalfunc.c 2022-01-27 16:36:25.415543684 +0000
--- src/evalfunc.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 7158,7164 ****
break;
}

! match = vim_regexec_nl(&regmatch, str, (colnr_T)startcol);

if (match && --nth <= 0)
break;
--- 7158,7164 ----
break;
}

! match = vim_regexec_nl(&regmatch, str, startcol);

if (match && --nth <= 0)
break;
***************
*** 7944,7950 ****
list->lv_u.mat.lv_idx_item = NULL;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
{
! if (list_append_number(list, (varnumber_T)i) == FAIL)
break;
if (list->lv_lock & VAR_ITEMS_LOCKED)
list->lv_u.mat.lv_last->li_tv.v_lock = VAR_LOCKED;
--- 7944,7950 ----
list->lv_u.mat.lv_idx_item = NULL;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
{
! if (list_append_number(list, i) == FAIL)
break;
if (list->lv_lock & VAR_ITEMS_LOCKED)
list->lv_u.mat.lv_last->li_tv.v_lock = VAR_LOCKED;
***************
*** 9804,9810 ****

if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
! id = syn_get_id(curwin, lnum, (colnr_T)col, trans, NULL, FALSE);
#endif

rettv->vval.v_number = id;
--- 9804,9810 ----

if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
! id = syn_get_id(curwin, lnum, col, trans, NULL, FALSE);
#endif

rettv->vval.v_number = id;
***************
*** 10024,10030 ****
&& col >= 0 && col <= (long)STRLEN(ml_get(lnum))
&& rettv_list_alloc(rettv) != FAIL)
{
! (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE);
for (i = 0; ; ++i)
{
id = syn_get_stack_item(i);
--- 10024,10030 ----
&& col >= 0 && col <= (long)STRLEN(ml_get(lnum))
&& rettv_list_alloc(rettv) != FAIL)
{
! (void)syn_get_id(curwin, lnum, col, FALSE, NULL, TRUE);
for (i = 0; ; ++i)
{
id = syn_get_stack_item(i);
*** ../vim-8.2.4240/src/ex_cmds.c 2022-01-25 13:52:49.409429882 +0000
--- src/ex_cmds.c 2022-01-28 15:18:32.717577571 +0000
***************
*** 1185,1191 ****

if (do_out)
{
! if (u_save((linenr_T)(line2), (linenr_T)(line2 + 1)) == FAIL)
{
vim_free(cmd_buf);
goto error;
--- 1185,1191 ----

if (do_out)
{
! if (u_save(line2, (linenr_T)(line2 + 1)) == FAIL)
{
vim_free(cmd_buf);
goto error;
*** ../vim-8.2.4240/src/ex_docmd.c 2022-01-24 11:23:59.855900536 +0000
--- src/ex_docmd.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 6800,6806 ****
n += wp->w_width;
else if (n == 0 && eap->arg[0] == NUL) // default is very wide
n = 9999;
! win_setwidth_win((int)n, wp);
}
else
{
--- 6800,6806 ----
n += wp->w_width;
else if (n == 0 && eap->arg[0] == NUL) // default is very wide
n = 9999;
! win_setwidth_win(n, wp);
}
else
{
***************
*** 6808,6814 ****
n += wp->w_height;
else if (n == 0 && eap->arg[0] == NUL) // default is very high
n = 9999;
! win_setheight_win((int)n, wp);
}
}

--- 6808,6814 ----
n += wp->w_height;
else if (n == 0 && eap->arg[0] == NUL) // default is very high
n = 9999;
! win_setheight_win(n, wp);
}
}

***************
*** 7531,7537 ****
{
n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
if (n >= 0)
! windgoto((int)n, curwin->w_wincol + curwin->w_wcol);
}

len = eap->line2;
--- 7531,7537 ----
{
n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
if (n >= 0)
! windgoto(n, curwin->w_wincol + curwin->w_wcol);
}

len = eap->line2;
*** ../vim-8.2.4240/src/ex_eval.c 2022-01-04 21:30:43.537800355 +0000
--- src/ex_eval.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 2283,2289 ****
{
if (pending & CSTP_THROW)
// Cancel the pending exception (includes report).
! discard_exception((except_T *)csp->exception, FALSE);
else
report_discard_pending(pending, NULL);

--- 2283,2289 ----
{
if (pending & CSTP_THROW)
// Cancel the pending exception (includes report).
! discard_exception(csp->exception, FALSE);
else
report_discard_pending(pending, NULL);

*** ../vim-8.2.4240/src/fold.c 2022-01-22 13:39:04.103476264 +0000
--- src/fold.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 2637,2643 ****
// to stop just above startlnum.
fp->fd_len = startlnum - fp->fd_top;
foldMarkAdjustRecurse(&fp->fd_nested,
! (linenr_T)fp->fd_len, (linenr_T)MAXLNUM,
(linenr_T)MAXLNUM, 0L);
fold_changed = TRUE;
}
--- 2637,2643 ----
// to stop just above startlnum.
fp->fd_len = startlnum - fp->fd_top;
foldMarkAdjustRecurse(&fp->fd_nested,
! fp->fd_len, (linenr_T)MAXLNUM,
(linenr_T)MAXLNUM, 0L);
fold_changed = TRUE;
}
*** ../vim-8.2.4240/src/if_cscope.c 2022-01-24 11:23:59.855900536 +0000
--- src/if_cscope.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 916,922 ****
goto err_closing;
#endif
}
! expand_env((char_u *)p_csprg, (char_u *)prog, MAXPATHL);

// alloc space to hold the cscope command
len = (int)(strlen(prog) + strlen(csinfo[i].fname) + 32);
--- 916,922 ----
goto err_closing;
#endif
}
! expand_env(p_csprg, (char_u *)prog, MAXPATHL);

// alloc space to hold the cscope command
len = (int)(strlen(prog) + strlen(csinfo[i].fname) + 32);
*** ../vim-8.2.4240/src/json.c 2022-01-05 20:24:34.276005641 +0000
--- src/json.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 244,250 ****
if (i > 0)
ga_concat(gap, (char_u *)",");
vim_snprintf((char *)numbuf, NUMBUFLEN, "%d",
! (int)blob_get(b, i));
ga_concat(gap, numbuf);
}
ga_append(gap, ']');
--- 244,250 ----
if (i > 0)
ga_concat(gap, (char_u *)",");
vim_snprintf((char *)numbuf, NUMBUFLEN, "%d",
! blob_get(b, i));
ga_concat(gap, numbuf);
}
ga_append(gap, ']');
*** ../vim-8.2.4240/src/match.c 2022-01-05 18:16:48.638057135 +0000
--- src/match.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 1036,1042 ****
{
char_u buf[MB_MAXBYTES + 1];

! buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL;
dict_add_string(dict, "conceal", (char_u *)&buf);
}
# endif
--- 1036,1042 ----
{
char_u buf[MB_MAXBYTES + 1];

! buf[(*mb_char2bytes)(cur->conceal_char, buf)] = NUL;
dict_add_string(dict, "conceal", (char_u *)&buf);
}
# endif
***************
*** 1309,1315 ****
id = (int)tv_get_number(&argvars[0]);
if (id >= 1 && id <= 3)
{
! if ((m = (matchitem_T *)get_match(curwin, id)) != NULL)
{
list_append_string(rettv->vval.v_list,
syn_id2name(m->hlg_id), -1);
--- 1309,1315 ----
id = (int)tv_get_number(&argvars[0]);
if (id >= 1 && id <= 3)
{
! if ((m = get_match(curwin, id)) != NULL)
{
list_append_string(rettv->vval.v_list,
syn_id2name(m->hlg_id), -1);
*** ../vim-8.2.4240/src/memline.c 2022-01-19 13:32:53.443929932 +0000
--- src/memline.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 551,557 ****
mf_put(mfp, hp, FALSE, FALSE); // release previous block

// get the block (pointer or data)
! if ((hp = mf_get(mfp, (blocknr_T)bnum, page_count)) == NULL)
{
if (bnum == 1)
break;
--- 551,557 ----
mf_put(mfp, hp, FALSE, FALSE); // release previous block

// get the block (pointer or data)
! if ((hp = mf_get(mfp, bnum, page_count)) == NULL)
{
if (bnum == 1)
break;
***************
*** 1511,1517 ****
/*
* get block
*/
! if ((hp = mf_get(mfp, (blocknr_T)bnum, page_count)) == NULL)
{
if (bnum == 1)
{
--- 1511,1517 ----
/*
* get block
*/
! if ((hp = mf_get(mfp, bnum, page_count)) == NULL)
{
if (bnum == 1)
{
***************
*** 3672,3678 ****

#ifdef FEAT_NETBEANS_INTG
if (netbeans_active())
! netbeans_removed(buf, lnum, 0, (long)line_size);
#endif
#ifdef FEAT_PROP_POPUP
// If there are text properties, make a copy, so that we can update
--- 3672,3678 ----

#ifdef FEAT_NETBEANS_INTG
if (netbeans_active())
! netbeans_removed(buf, lnum, 0, line_size);
#endif
#ifdef FEAT_PROP_POPUP
// If there are text properties, make a copy, so that we can update
*** ../vim-8.2.4240/src/message.c 2022-01-20 14:43:55.715749023 +0000
--- src/message.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 164,170 ****
#ifdef FEAT_JOB_CHANNEL
if (emsg_to_channel_log)
// Write message in the channel log.
! ch_log(NULL, "ERROR: %s", (char *)s);
#endif

// Truncate the message if needed.
--- 164,170 ----
#ifdef FEAT_JOB_CHANNEL
if (emsg_to_channel_log)
// Write message in the channel log.
! ch_log(NULL, "ERROR: %s", s);
#endif

// Truncate the message if needed.
***************
*** 905,911 ****
void
emsg_namelen(char *msg, char_u *name, int len)
{
! char_u *copy = vim_strnsave((char_u *)name, len);

semsg(msg, copy == NULL ? "NULL" : (char *)copy);
vim_free(copy);
--- 905,911 ----
void
emsg_namelen(char *msg, char_u *name, int len)
{
! char_u *copy = vim_strnsave(name, len);

semsg(msg, copy == NULL ? "NULL" : (char *)copy);
vim_free(copy);
***************
*** 3701,3707 ****
{
// Very early in initialisation and already something wrong, just give
// the raw message so the user at least gets a hint.
! give_warning((char_u *)message, hl);
}
else
{
--- 3701,3707 ----
{
// Very early in initialisation and already something wrong, just give
// the raw message so the user at least gets a hint.
! give_warning(message, hl);
}
else
{
*** ../vim-8.2.4240/src/misc1.c 2022-01-08 12:41:12.204795554 +0000
--- src/misc1.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 379,385 ****

lines = plines_win_nofold(wp, lnum);
if (winheight > 0 && lines > wp->w_height)
! return (int)wp->w_height;
return lines;
}

--- 379,385 ----

lines = plines_win_nofold(wp, lnum);
if (winheight > 0 && lines > wp->w_height)
! return wp->w_height;
return lines;
}

*** ../vim-8.2.4240/src/normal.c 2022-01-28 12:50:38.596217550 +0000
--- src/normal.c 2022-01-28 15:18:32.721577508 +0000
***************
*** 5211,5217 ****
colnr_T start = (colnr_T)(curwin->w_cursor.col - cap->count1);

netbeans_removed(curbuf, curwin->w_cursor.lnum, start,
! (long)cap->count1);
netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
&ptr[start], (int)cap->count1);
}
--- 5211,5217 ----
colnr_T start = (colnr_T)(curwin->w_cursor.col - cap->count1);

netbeans_removed(curbuf, curwin->w_cursor.lnum, start,
! cap->count1);
netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
&ptr[start], (int)cap->count1);
}
*** ../vim-8.2.4240/src/ops.c 2022-01-20 15:25:59.309844687 +0000
--- src/ops.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 334,341 ****
for ( ; VIM_ISWHITE(*bd.textstart); )
{
// TODO: is passing bd.textstart for start of the line OK?
! incr = lbr_chartabsize_adv(bd.textstart, &bd.textstart,
! (colnr_T)(bd.start_vcol));
total += incr;
bd.start_vcol += incr;
}
--- 334,340 ----
for ( ; VIM_ISWHITE(*bd.textstart); )
{
// TODO: is passing bd.textstart for start of the line OK?
! incr = lbr_chartabsize_adv(bd.textstart, &bd.textstart, bd.start_vcol);
total += incr;
bd.start_vcol += incr;
}
***************
*** 460,466 ****
}
// replace the line
ml_replace(curwin->w_cursor.lnum, newp, FALSE);
! changed_bytes(curwin->w_cursor.lnum, (colnr_T)bd.textcol);
State = oldstate;
curwin->w_cursor.col = oldcol;
#ifdef FEAT_RIGHTLEFT
--- 459,465 ----
}
// replace the line
ml_replace(curwin->w_cursor.lnum, newp, FALSE);
! changed_bytes(curwin->w_cursor.lnum, bd.textcol);
State = oldstate;
curwin->w_cursor.col = oldcol;
#ifdef FEAT_RIGHTLEFT
***************
*** 2133,2139 ****
// what is added if it is inside these spaces.
spaces_removed = (curr - curr_start) - spaces[t];

! mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t,
(long)(cend - newp - spaces_removed), spaces_removed);
#ifdef FEAT_PROP_POPUP
prepend_joined_props(newp + sumsize + 1, propcount, &props_remaining,
--- 2132,2138 ----
// what is added if it is inside these spaces.
spaces_removed = (curr - curr_start) - spaces[t];

! mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, -t,
(long)(cend - newp - spaces_removed), spaces_removed);
#ifdef FEAT_PROP_POPUP
prepend_joined_props(newp + sumsize + 1, propcount, &props_remaining,
***************
*** 2243,2249 ****
while (bdp->start_vcol < oap->start_vcol && *pstart)
{
// Count a tab for what it's worth (if list mode not on)
! incr = lbr_chartabsize(line, pstart, (colnr_T)bdp->start_vcol);
bdp->start_vcol += incr;
if (VIM_ISWHITE(*pstart))
{
--- 2242,2248 ----
while (bdp->start_vcol < oap->start_vcol && *pstart)
{
// Count a tab for what it's worth (if list mode not on)
! incr = lbr_chartabsize(line, pstart, bdp->start_vcol);
bdp->start_vcol += incr;
if (VIM_ISWHITE(*pstart))
{
***************
*** 2306,2312 ****
{
// Count a tab for what it's worth (if list mode not on)
prev_pend = pend;
! incr = lbr_chartabsize_adv(line, &pend, (colnr_T)bdp->end_vcol);
bdp->end_vcol += incr;
}
if (bdp->end_vcol <= oap->end_vcol
--- 2305,2311 ----
{
// Count a tab for what it's worth (if list mode not on)
prev_pend = pend;
! incr = lbr_chartabsize_adv(line, &pend, bdp->end_vcol);
bdp->end_vcol += incr;
}
if (bdp->end_vcol <= oap->end_vcol
***************
*** 2866,2878 ****
buf2[i] = '\0';
}
else if (pre == 0)
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", (uvarnumber_T)n);
else if (pre == '0')
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", (uvarnumber_T)n);
else if (pre && hexupper)
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", (uvarnumber_T)n);
else
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", (uvarnumber_T)n);
length -= (int)STRLEN(buf2);

/*
--- 2865,2877 ----
buf2[i] = '\0';
}
else if (pre == 0)
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", n);
else if (pre == '0')
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", n);
else if (pre && hexupper)
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", n);
else
! vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", n);
length -= (int)STRLEN(buf2);

/*
***************
*** 3191,3211 ****
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
! (varnumber_T)word_count_cursor,
! (varnumber_T)word_count,
! (varnumber_T)byte_count_cursor,
! (varnumber_T)byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Chars; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
! (varnumber_T)word_count_cursor,
! (varnumber_T)word_count,
! (varnumber_T)char_count_cursor,
! (varnumber_T)char_count,
! (varnumber_T)byte_count_cursor,
! (varnumber_T)byte_count);
}
else
{
--- 3190,3210 ----
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
! word_count_cursor,
! word_count,
! byte_count_cursor,
! byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Chars; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
! word_count_cursor,
! word_count,
! char_count_cursor,
! char_count,
! byte_count_cursor,
! byte_count);
}
else
{
***************
*** 3223,3239 ****
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
! (varnumber_T)word_count_cursor, (varnumber_T)word_count,
! (varnumber_T)byte_count_cursor, (varnumber_T)byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Col %s of %s; Line %ld of %ld; Word %lld of %lld; Char %lld of %lld; Byte %lld of %lld"),
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
! (varnumber_T)word_count_cursor, (varnumber_T)word_count,
! (varnumber_T)char_count_cursor, (varnumber_T)char_count,
! (varnumber_T)byte_count_cursor, (varnumber_T)byte_count);
}
}

--- 3222,3238 ----
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
! word_count_cursor, word_count,
! byte_count_cursor, byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Col %s of %s; Line %ld of %ld; Word %lld of %lld; Char %lld of %lld; Byte %lld of %lld"),
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
! word_count_cursor, word_count,
! char_count_cursor, char_count,
! byte_count_cursor, byte_count);
}
}

***************
*** 3243,3249 ****
size_t len = STRLEN(IObuff);

vim_snprintf((char *)IObuff + len, IOSIZE - len,
! _("(+%lld for BOM)"), (varnumber_T)bom_count);
}
if (dict == NULL)
{
--- 3242,3248 ----
size_t len = STRLEN(IObuff);

vim_snprintf((char *)IObuff + len, IOSIZE - len,
! _("(+%lld for BOM)"), bom_count);
}
if (dict == NULL)
{
*** ../vim-8.2.4240/src/option.c 2022-01-22 15:09:32.497898745 +0000
--- src/option.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 3702,3708 ****
{
if (errbuf != NULL)
{
! vim_snprintf((char *)errbuf, errbuflen,
_(e_need_at_least_nr_lines), min_rows());
errmsg = errbuf;
}
--- 3702,3708 ----
{
if (errbuf != NULL)
{
! vim_snprintf(errbuf, errbuflen,
_(e_need_at_least_nr_lines), min_rows());
errmsg = errbuf;
}
***************
*** 3712,3718 ****
{
if (errbuf != NULL)
{
! vim_snprintf((char *)errbuf, errbuflen,
_(e_need_at_least_nr_columns), MIN_COLUMNS);
errmsg = errbuf;
}
--- 3712,3718 ----
{
if (errbuf != NULL)
{
! vim_snprintf(errbuf, errbuflen,
_(e_need_at_least_nr_columns), MIN_COLUMNS);
errmsg = errbuf;
}
*** ../vim-8.2.4240/src/optionstr.c 2022-01-23 14:17:24.631509344 +0000
--- src/optionstr.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 181,187 ****
set_vim_var_string(VV_OPTION_OLDLOCAL, oldval, -1);
}
apply_autocmds(EVENT_OPTIONSET,
! (char_u *)get_option_fullname(opt_idx), NULL, FALSE,
NULL);
reset_v_option_vars();
}
--- 181,187 ----
set_vim_var_string(VV_OPTION_OLDLOCAL, oldval, -1);
}
apply_autocmds(EVENT_OPTIONSET,
! get_option_fullname(opt_idx), NULL, FALSE,
NULL);
reset_v_option_vars();
}
*** ../vim-8.2.4240/src/os_unix.c 2022-01-24 12:20:41.597511550 +0000
--- src/os_unix.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 5666,5672 ****
{
typval_T *item = &dict_lookup(hi)->di_tv;

! vim_setenv((char_u*)hi->hi_key, tv_get_string(item));
--todo;
}
}
--- 5666,5672 ----
{
typval_T *item = &dict_lookup(hi)->di_tv;

! vim_setenv(hi->hi_key, tv_get_string(item));
--todo;
}
}
***************
*** 7487,7493 ****
if (hinstLib == NULL)
{
// "dlerr" must be used before dlclose()
! dlerr = (char *)dlerror();
if (dlerr != NULL)
semsg(_("dlerror = \"%s\""), dlerr);
}
--- 7487,7493 ----
if (hinstLib == NULL)
{
// "dlerr" must be used before dlclose()
! dlerr = dlerror();
if (dlerr != NULL)
semsg(_("dlerror = \"%s\""), dlerr);
}
***************
*** 7522,7528 ****
{
# if defined(USE_DLOPEN)
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
! dlerr = (char *)dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
TYPE_PROCEDURE, (void *)&ProcAdd) < 0)
--- 7522,7528 ----
{
# if defined(USE_DLOPEN)
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
! dlerr = dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
TYPE_PROCEDURE, (void *)&ProcAdd) < 0)
***************
*** 7544,7550 ****
{
# if defined(USE_DLOPEN)
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
! dlerr = (char *)dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
TYPE_PROCEDURE, (void *)&ProcAddI) < 0)
--- 7544,7550 ----
{
# if defined(USE_DLOPEN)
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
! dlerr = dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
TYPE_PROCEDURE, (void *)&ProcAddI) < 0)
*** ../vim-8.2.4240/src/register.c 2022-01-25 21:26:13.743440874 +0000
--- src/register.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 1842,1848 ****
for (ptr = oldp; vcol < col && *ptr; )
{
// Count a tab for what it's worth (if list mode not on)
! incr = lbr_chartabsize_adv(oldp, &ptr, (colnr_T)vcol);
vcol += incr;
}
bd.textcol = (colnr_T)(ptr - oldp);
--- 1842,1848 ----
for (ptr = oldp; vcol < col && *ptr; )
{
// Count a tab for what it's worth (if list mode not on)
! incr = lbr_chartabsize_adv(oldp, &ptr, vcol);
vcol += incr;
}
bd.textcol = (colnr_T)(ptr - oldp);
*** ../vim-8.2.4240/src/sign.c 2022-01-05 20:24:34.280005633 +0000
--- src/sign.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 1745,1782 ****
{
char_u *p;

! dict_add_string(retdict, "name", (char_u *)sp->sn_name);
if (sp->sn_icon != NULL)
! dict_add_string(retdict, "icon", (char_u *)sp->sn_icon);
if (sp->sn_text != NULL)
! dict_add_string(retdict, "text", (char_u *)sp->sn_text);
if (sp->sn_line_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_line_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "linehl", (char_u *)p);
}
if (sp->sn_text_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_text_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "texthl", (char_u *)p);
}
if (sp->sn_cul_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_cul_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "culhl", (char_u *)p);
}
if (sp->sn_num_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_num_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "numhl", (char_u *)p);
}
}

--- 1745,1782 ----
{
char_u *p;

! dict_add_string(retdict, "name", sp->sn_name);
if (sp->sn_icon != NULL)
! dict_add_string(retdict, "icon", sp->sn_icon);
if (sp->sn_text != NULL)
! dict_add_string(retdict, "text", sp->sn_text);
if (sp->sn_line_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_line_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "linehl", p);
}
if (sp->sn_text_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_text_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "texthl", p);
}
if (sp->sn_cul_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_cul_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "culhl", p);
}
if (sp->sn_num_hl > 0)
{
p = get_highlight_name_ext(NULL, sp->sn_num_hl - 1, FALSE);
if (p == NULL)
p = (char_u *)"NONE";
! dict_add_string(retdict, "numhl", p);
}
}

*** ../vim-8.2.4240/src/spellfile.c 2022-01-08 16:19:18.509639849 +0000
--- src/spellfile.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 3618,3624 ****
}

// Store the word in the hashtable to be able to find duplicates.
! dw = (char_u *)getroom_save(spin, w);
if (dw == NULL)
{
retval = FAIL;
--- 3618,3624 ----
}

// Store the word in the hashtable to be able to find duplicates.
! dw = getroom_save(spin, w);
if (dw == NULL)
{
retval = FAIL;
*** ../vim-8.2.4240/src/tag.c 2022-01-08 16:19:18.509639849 +0000
--- src/tag.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 3799,3805 ****
{
ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
! expanded_fname = ExpandOne(&xpc, (char_u *)fname, NULL,
WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
if (expanded_fname != NULL)
fname = expanded_fname;
--- 3799,3805 ----
{
ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
! expanded_fname = ExpandOne(&xpc, fname, NULL,
WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
if (expanded_fname != NULL)
fname = expanded_fname;
*** ../vim-8.2.4240/src/ui.c 2021-12-25 15:13:13.036442971 +0000
--- src/ui.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 1106,1113 ****
{
if (col < 0)
return 0;
! if (col >= (int)screen_Columns)
! return (int)screen_Columns - 1;
return col;
}

--- 1106,1113 ----
{
if (col < 0)
return 0;
! if (col >= screen_Columns)
! return screen_Columns - 1;
return col;
}

***************
*** 1119,1126 ****
{
if (row < 0)
return 0;
! if (row >= (int)screen_Rows)
! return (int)screen_Rows - 1;
return row;
}

--- 1119,1126 ----
{
if (row < 0)
return 0;
! if (row >= screen_Rows)
! return screen_Rows - 1;
return row;
}

*** ../vim-8.2.4240/src/undo.c 2022-01-25 18:23:57.102514548 +0000
--- src/undo.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 1142,1148 ****
}
else
#endif
! if (fread(buffer, (size_t)size, 1, bi->bi_fp) != 1)
retval = FAIL;

if (retval == FAIL)
--- 1142,1148 ----
}
else
#endif
! if (fread(buffer, size, 1, bi->bi_fp) != 1)
retval = FAIL;

if (retval == FAIL)
***************
*** 3710,3719 ****

dict_add_number(dict, "synced", (long)curbuf->b_u_synced);
dict_add_number(dict, "seq_last", curbuf->b_u_seq_last);
! dict_add_number(dict, "save_last", (long)curbuf->b_u_save_nr_last);
dict_add_number(dict, "seq_cur", curbuf->b_u_seq_cur);
dict_add_number(dict, "time_cur", (long)curbuf->b_u_time_cur);
! dict_add_number(dict, "save_cur", (long)curbuf->b_u_save_nr_cur);

list = list_alloc();
if (list != NULL)
--- 3710,3719 ----

dict_add_number(dict, "synced", (long)curbuf->b_u_synced);
dict_add_number(dict, "seq_last", curbuf->b_u_seq_last);
! dict_add_number(dict, "save_last", curbuf->b_u_save_nr_last);
dict_add_number(dict, "seq_cur", curbuf->b_u_seq_cur);
dict_add_number(dict, "time_cur", (long)curbuf->b_u_time_cur);
! dict_add_number(dict, "save_cur", curbuf->b_u_save_nr_cur);

list = list_alloc();
if (list != NULL)
*** ../vim-8.2.4240/src/window.c 2022-01-20 13:32:46.679047565 +0000
--- src/window.c 2022-01-28 15:18:32.725577449 +0000
***************
*** 6493,6499 ****

// clear the lines added to cmdline
if (full_screen)
! screen_fill((int)(cmdline_row), (int)Rows, 0,
(int)Columns, ' ', ' ', 0);
msg_row = cmdline_row;
redraw_cmdline = TRUE;
--- 6493,6499 ----

// clear the lines added to cmdline
if (full_screen)
! screen_fill(cmdline_row, (int)Rows, 0,
(int)Columns, ' ', ' ', 0);
msg_row = cmdline_row;
redraw_cmdline = TRUE;
*** ../vim-8.2.4240/src/version.c 2022-01-28 15:01:43.889148190 +0000
--- src/version.c 2022-01-28 15:21:07.711209004 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4241,
/**/

--
Computers make very fast, very accurate, mistakes.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages