0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.3460: some type casts are not needed

Problem:    Some type casts are not needed.
Solution:   Remove unnecessary type casts. (closes #8934)
This commit is contained in:
=?UTF-8?q?Dundar=20G=C3=B6c?= 2021-10-02 11:26:51 +01:00 committed by Bram Moolenaar
parent 51491adfa8
commit dfa5e464d4
9 changed files with 20 additions and 18 deletions

View File

@ -386,7 +386,7 @@ au_cleanup(void)
return; return;
// loop over all events // loop over all events
for (event = (event_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < NUM_EVENTS;
event = (event_T)((int)event + 1)) event = (event_T)((int)event + 1))
{ {
// loop over all autocommand patterns // loop over all autocommand patterns
@ -460,7 +460,7 @@ aubuflocal_remove(buf_T *buf)
apc->arg_bufnr = 0; apc->arg_bufnr = 0;
// invalidate buflocals looping through events // invalidate buflocals looping through events
for (event = (event_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < NUM_EVENTS;
event = (event_T)((int)event + 1)) event = (event_T)((int)event + 1))
// loop over all autocommand patterns // loop over all autocommand patterns
FOR_ALL_AUTOCMD_PATTERNS(event, ap) FOR_ALL_AUTOCMD_PATTERNS(event, ap)
@ -523,7 +523,7 @@ au_del_group(char_u *name)
AutoPat *ap; AutoPat *ap;
int in_use = FALSE; int in_use = FALSE;
for (event = (event_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < NUM_EVENTS;
event = (event_T)((int)event + 1)) event = (event_T)((int)event + 1))
{ {
FOR_ALL_AUTOCMD_PATTERNS(event, ap) FOR_ALL_AUTOCMD_PATTERNS(event, ap)
@ -695,7 +695,7 @@ find_end_event(
{ {
for (pat = arg; *pat && *pat != '|' && !VIM_ISWHITE(*pat); pat = p) for (pat = arg; *pat && *pat != '|' && !VIM_ISWHITE(*pat); pat = p)
{ {
if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS) if ((int)event_name2nr(pat, &p) >= NUM_EVENTS)
{ {
if (have_group) if (have_group)
semsg(_("E216: No such event: %s"), pat); semsg(_("E216: No such event: %s"), pat);
@ -967,7 +967,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
if (!forceit && *cmd != NUL) if (!forceit && *cmd != NUL)
emsg(_(e_cannot_define_autocommands_for_all_events)); emsg(_(e_cannot_define_autocommands_for_all_events));
else else
for (event = (event_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < NUM_EVENTS;
event = (event_T)((int)event + 1)) event = (event_T)((int)event + 1))
if (do_autocmd_event(event, pat, if (do_autocmd_event(event, pat,
once, nested, cmd, forceit, group, flags) == FAIL) once, nested, cmd, forceit, group, flags) == FAIL)

View File

@ -103,7 +103,7 @@ read_buffer(
retval = readfile( retval = readfile(
read_stdin ? NULL : curbuf->b_ffname, read_stdin ? NULL : curbuf->b_ffname,
read_stdin ? NULL : curbuf->b_fname, read_stdin ? NULL : curbuf->b_fname,
(linenr_T)line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap, line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap,
flags | READ_BUFFER); flags | READ_BUFFER);
if (retval == OK) if (retval == OK)
{ {

View File

@ -440,7 +440,7 @@ dbg_check_breakpoint(exarg_T *eap)
// replace K_SNR with "<SNR>" // replace K_SNR with "<SNR>"
if (debug_breakpoint_name[0] == K_SPECIAL if (debug_breakpoint_name[0] == K_SPECIAL
&& debug_breakpoint_name[1] == KS_EXTRA && debug_breakpoint_name[1] == KS_EXTRA
&& debug_breakpoint_name[2] == (int)KE_SNR) && debug_breakpoint_name[2] == KE_SNR)
p = (char_u *)"<SNR>"; p = (char_u *)"<SNR>";
else else
p = (char_u *)""; p = (char_u *)"";

View File

@ -1853,7 +1853,7 @@ vgetc(void)
// or a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI // or a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI
// too. // too.
c = vgetorpeek(TRUE); c = vgetorpeek(TRUE);
if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA) if (vgetorpeek(TRUE) == KE_CSI && c == KS_EXTRA)
buf[i] = CSI; buf[i] = CSI;
} }
} }
@ -2521,7 +2521,7 @@ handle_mapping(
if (*s == RM_SCRIPT if (*s == RM_SCRIPT
&& (mp->m_keys[0] != K_SPECIAL && (mp->m_keys[0] != K_SPECIAL
|| mp->m_keys[1] != KS_EXTRA || mp->m_keys[1] != KS_EXTRA
|| mp->m_keys[2] != (int)KE_SNR)) || mp->m_keys[2] != KE_SNR))
continue; continue;
// If one of the typed keys cannot be remapped, skip the // If one of the typed keys cannot be remapped, skip the
@ -3139,7 +3139,7 @@ vgetorpeek(int advance)
if (!VIM_ISWHITE(ptr[col])) if (!VIM_ISWHITE(ptr[col]))
curwin->w_wcol = vcol; curwin->w_wcol = vcol;
vcol += lbr_chartabsize(ptr, ptr + col, vcol += lbr_chartabsize(ptr, ptr + col,
(colnr_T)vcol); vcol);
if (has_mbyte) if (has_mbyte)
col += (*mb_ptr2len)(ptr + col); col += (*mb_ptr2len)(ptr + col);
else else

View File

@ -588,7 +588,7 @@ ex_hardcopy(exarg_T *eap)
*/ */
if (mch_print_init(&settings, if (mch_print_init(&settings,
curbuf->b_fname == NULL curbuf->b_fname == NULL
? (char_u *)buf_spname(curbuf) ? buf_spname(curbuf)
: curbuf->b_sfname == NULL : curbuf->b_sfname == NULL
? curbuf->b_fname ? curbuf->b_fname
: curbuf->b_sfname, : curbuf->b_sfname,
@ -1931,7 +1931,7 @@ prt_open_resource(struct prt_ps_resource_S *resource)
break; break;
case PRT_DSC_ENDCOMMENTS_TYPE: case PRT_DSC_ENDCOMMENTS_TYPE:
// Wont find title or resource after this comment, stop searching // Won't find title or resource after this comment, stop searching
seen_all = TRUE; seen_all = TRUE;
break; break;

View File

@ -1253,7 +1253,7 @@ cs_find_common(
int matched = 0; int matched = 0;
// read output // read output
cs_fill_results((char *)pat, totmatches, nummatches, &matches, cs_fill_results(pat, totmatches, nummatches, &matches,
&contexts, &matched); &contexts, &matched);
vim_free(nummatches); vim_free(nummatches);
if (matches == NULL) if (matches == NULL)
@ -1745,7 +1745,7 @@ cs_parse_results(
* *
* <filename> <context> <line number> <pattern> * <filename> <context> <line number> <pattern>
*/ */
if ((name = strtok((char *)buf, (const char *)" ")) == NULL) if ((name = strtok(buf, (const char *)" ")) == NULL)
return NULL; return NULL;
if ((*context = strtok(NULL, (const char *)" ")) == NULL) if ((*context = strtok(NULL, (const char *)" ")) == NULL)
return NULL; return NULL;

View File

@ -1028,7 +1028,7 @@ curs_columns(
// column // column
sbr = get_showbreak_value(curwin); sbr = get_showbreak_value(curwin);
if (*sbr && *ml_get_cursor() == NUL if (*sbr && *ml_get_cursor() == NUL
&& curwin->w_wcol == (int)vim_strsize(sbr)) && curwin->w_wcol == vim_strsize(sbr))
curwin->w_wcol = 0; curwin->w_wcol = 0;
#endif #endif
} }

View File

@ -2802,7 +2802,7 @@ findtag_end:
if (*p == TAG_SEP) if (*p == TAG_SEP)
*p = NUL; *p = NUL;
} }
matches[match_count++] = (char_u *)mfp; matches[match_count++] = mfp;
} }
} }

View File

@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3460,
/**/ /**/
3459, 3459,
/**/ /**/
@ -7746,7 +7748,7 @@ ex_version(exarg_T *eap)
static void static void
version_msg_wrap(char_u *s, int wrap) version_msg_wrap(char_u *s, int wrap)
{ {
int len = (int)vim_strsize(s) + (wrap ? 2 : 0); int len = vim_strsize(s) + (wrap ? 2 : 0);
if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
&& *s != '\n') && *s != '\n')
@ -7798,7 +7800,7 @@ list_in_columns(char_u **items, int size, int current)
// width. // width.
for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i) for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
{ {
int l = (int)vim_strsize(items[i]) + (i == current ? 2 : 0); int l = vim_strsize(items[i]) + (i == current ? 2 : 0);
if (l > width) if (l > width)
width = l; width = l;