]> granicus.if.org Git - vim/commitdiff
patch 8.2.4241: some type casts are redundant v8.2.4241
author=?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Fri, 28 Jan 2022 15:28:04 +0000 (15:28 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Jan 2022 15:28:04 +0000 (15:28 +0000)
Problem:    Some type casts are redundant.
Solution:   Remove the type casts. (closes #9643)

32 files changed:
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/version.c
src/window.c

index b5b4428a815f0fd81f32fd3350accc1077eeda75..afc2de63640bbd5d65786368e7e890f327bc13a5 100644 (file)
@@ -237,7 +237,7 @@ blob2string(blob_T *blob, char_u **tofree, char_u *numbuf)
     {
        if (i > 0 && (i & 3) == 0)
            ga_concat(&ga, (char_u *)".");
-       vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", (int)blob_get(blob, i));
+       vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", blob_get(blob, i));
        ga_concat(&ga, numbuf);
     }
     ga_append(&ga, NUL);               // append a NUL at the end
index e50b01d4a78bdd4f4009762bba256e45a3ee3c01..24da8298478ff129e6c4ffccbc4a6f4abb4cec3b 100644 (file)
@@ -1624,7 +1624,7 @@ do_bufdel(
            // also be deleted, etc.
            if (bnr == curbuf->b_fnum)
                do_current = bnr;
-           else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, (int)bnr,
+           else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, bnr,
                          DOBUF_NOPOPUP | (forceit ? DOBUF_FORCEIT : 0)) == OK)
                ++deleted;
 
@@ -3754,7 +3754,7 @@ fileinfo(
     }
     else
     {
-       p = (char *)msg_trunc_attr(buffer, FALSE, 0);
+       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
index 0b8bfb3ba3b71f47c13194d0c632a77c9fc40481..68f1177f816da7a5fa790b4df2c94f8d1d258cbc 100644 (file)
@@ -816,7 +816,7 @@ channel_connect(
            ch_log(channel,
                      "Waiting for connection (waiting %d msec)...", waitnow);
 
-           ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv);
+           ret = select(sd + 1, &rfds, &wfds, NULL, &tv);
            if (ret < 0)
            {
                SOCK_ERRNO;
index 0f178d08816624cf75bf29cc87c173ca9a55b7f8..793570abd80fb572d072711f363544ecb243ac78 100644 (file)
@@ -34,7 +34,7 @@ server_to_input_buf(char_u *str)
     //  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);
+    str = replace_termcodes(str, &ptr, REPTERM_DO_LT, NULL);
     p_cpo = cpo_save;
 
     if (*ptr != NUL)   // trailing CTRL-V results in nothing
@@ -55,7 +55,7 @@ server_to_input_buf(char_u *str)
        // buffer.
        typebuf_was_filled = TRUE;
     }
-    vim_free((char_u *)ptr);
+    vim_free(ptr);
 }
 
 /*
index e2ebd114b9a2bafa8236f2b6430e3a9652fbe578..9eace3de6d882e3075ae69969389ec9265aae7bd 100644 (file)
@@ -1488,7 +1488,7 @@ clip_x11_convert_selection_cb(
        // 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,
+       conv_result = XmbTextListToTextProperty(X_DISPLAY, &string_nt,
                                           1, XCompoundTextStyle, &text_prop);
        if (conv_result != Success)
        {
index 1cf468137aa881f9821b8eaf698205e67a31ce75..35658a4e885705c01294004ffa700907d53db5fb 100644 (file)
@@ -1357,7 +1357,7 @@ win_line(
 #endif
                )
        {
-           screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
+           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,7 +2846,7 @@ win_line(
 #endif
 
            screen_line(screen_row, wp->w_wincol, col,
-                                         (int)wp->w_width, screen_line_flags);
+                                         wp->w_width, screen_line_flags);
            row++;
 
            // Update w_cline_height and w_cline_folded if the cursor line was
@@ -3147,11 +3147,11 @@ win_line(
        {
 #ifdef FEAT_CONCEAL
            screen_line(screen_row, wp->w_wincol, col - boguscols,
-                                         (int)wp->w_width, screen_line_flags);
+                                         wp->w_width, screen_line_flags);
            boguscols = 0;
 #else
            screen_line(screen_row, wp->w_wincol, col,
-                                         (int)wp->w_width, screen_line_flags);
+                                         wp->w_width, screen_line_flags);
 #endif
            ++row;
            ++screen_row;
index d03c429cc71aac5eb30d857e160b43b23dcdcb34..5732b89ab0fa0f7981316e6c24984b2dc917c410 100644 (file)
@@ -538,7 +538,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
                        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))
+               && (this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
            screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
                                                   - 1 + wp->w_wincol), attr);
 
@@ -797,7 +797,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
        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;
@@ -1038,8 +1038,7 @@ redraw_win_toolbar(win_T *wp)
     }
     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);
+    screen_line(wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, 0);
 }
 #endif
 
@@ -1372,8 +1371,7 @@ fold_line(
     }
 #endif
 
-    screen_line(row + W_WINROW(wp), wp->w_wincol, (int)wp->w_width,
-                                                    (int)wp->w_width, 0);
+    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).
index 2b5301100ddbf2fd9b44cfa49c9e1e028b41a7c5..2a889631ae0a4dd9be086a20452f298661097003 100644 (file)
@@ -523,7 +523,7 @@ edit(
 
            if (
 #ifdef FEAT_VARTABS
-               (int)curwin->w_wcol < mincol - tabstop_at(
+               curwin->w_wcol < mincol - tabstop_at(
                                          get_nolist_virtcol(), curbuf->b_p_ts,
                                                         curbuf->b_p_vts_array)
 #else
@@ -2134,7 +2134,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
@@ -2907,7 +2907,7 @@ stuff_inserted(
     // 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)
+    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
index 411d332997125b5f270827e2c662fb1bc71afc7e..045e5444f33c59294652eb5bf9bddb8810c1fc4d 100644 (file)
@@ -7158,7 +7158,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, matchtype_T type)
                    break;
            }
 
-           match = vim_regexec_nl(&regmatch, str, (colnr_T)startcol);
+           match = vim_regexec_nl(&regmatch, str, startcol);
 
            if (match && --nth <= 0)
                break;
@@ -7944,7 +7944,7 @@ range_list_materialize(list_T *list)
     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)
+       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,7 +9804,7 @@ f_synID(typval_T *argvars UNUSED, typval_T *rettv)
 
     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);
+       id = syn_get_id(curwin, lnum, col, trans, NULL, FALSE);
 #endif
 
     rettv->vval.v_number = id;
@@ -10024,7 +10024,7 @@ f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
            && 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);
+       (void)syn_get_id(curwin, lnum, col, FALSE, NULL, TRUE);
        for (i = 0; ; ++i)
        {
            id = syn_get_stack_item(i);
index f5d93e664531ef5ff548ea1d459db002bd0ba838..099d9cfeedd78499193f0adebf81667cc06aa7c0 100644 (file)
@@ -1185,7 +1185,7 @@ do_filter(
 
     if (do_out)
     {
-       if (u_save((linenr_T)(line2), (linenr_T)(line2 + 1)) == FAIL)
+       if (u_save(line2, (linenr_T)(line2 + 1)) == FAIL)
        {
            vim_free(cmd_buf);
            goto error;
index fa06e06d8a55278ba7596e76a315922956115dd4..aa91539270c4891f5a49a202bdf947a7b0b63785 100644 (file)
@@ -6800,7 +6800,7 @@ ex_resize(exarg_T *eap)
            n += wp->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
     {
@@ -6808,7 +6808,7 @@ ex_resize(exarg_T *eap)
            n += wp->w_height;
        else if (n == 0 && eap->arg[0] == NUL)  // default is very high
            n = 9999;
-       win_setheight_win((int)n, wp);
+       win_setheight_win(n, wp);
     }
 }
 
@@ -7531,7 +7531,7 @@ ex_sleep(exarg_T *eap)
     {
        n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
        if (n >= 0)
-           windgoto((int)n, curwin->w_wincol + curwin->w_wcol);
+           windgoto(n, curwin->w_wincol + curwin->w_wcol);
     }
 
     len = eap->line2;
index a48f60930620381564f9edf167020c2b352943c2..ab30798622dc4f0bc2fbe191edcd17553e1d5df9 100644 (file)
@@ -2283,7 +2283,7 @@ leave_cleanup(cleanup_T *csp)
     {
        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);
 
index 73c71160bda4945a776f13793ce6838346c79af2..3f8de1c25c6144128f89f2025a3ee15e613a25de 100644 (file)
@@ -2637,7 +2637,7 @@ foldUpdateIEMSRecurse(
                        // to stop just above startlnum.
                        fp->fd_len = startlnum - fp->fd_top;
                        foldMarkAdjustRecurse(&fp->fd_nested,
-                               (linenr_T)fp->fd_len, (linenr_T)MAXLNUM,
+                               fp->fd_len, (linenr_T)MAXLNUM,
                                                       (linenr_T)MAXLNUM, 0L);
                        fold_changed = TRUE;
                    }
index 9e0ec456be3a757f69e29e073ceff524890050f1..edcd4ca684a2871d4b8d7548a531b39d680d532f 100644 (file)
@@ -916,7 +916,7 @@ err_closing:
            goto err_closing;
 #endif
        }
-       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);
index e19bc9742c4a8c4ae81d64fa61bec92410ec2fed..942d131e3a35958522b706ae52aa269133f3fde4 100644 (file)
@@ -244,7 +244,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
                    if (i > 0)
                        ga_concat(gap, (char_u *)",");
                    vim_snprintf((char *)numbuf, NUMBUFLEN, "%d",
-                           (int)blob_get(b, i));
+                           blob_get(b, i));
                    ga_concat(gap, numbuf);
                }
                ga_append(gap, ']');
index 3d7010e774ccbacd4934c6d6c7af09b4b5ec2f28..5041d6b3427f8fa5407bf4be63794b831c329914 100644 (file)
@@ -1036,7 +1036,7 @@ f_getmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
        {
            char_u buf[MB_MAXBYTES + 1];
 
-           buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL;
+           buf[(*mb_char2bytes)(cur->conceal_char, buf)] = NUL;
            dict_add_string(dict, "conceal", (char_u *)&buf);
        }
 #  endif
@@ -1309,7 +1309,7 @@ f_matcharg(typval_T *argvars UNUSED, typval_T *rettv)
        id = (int)tv_get_number(&argvars[0]);
        if (id >= 1 && id <= 3)
        {
-           if ((m = (matchitem_T *)get_match(curwin, id)) != NULL)
+           if ((m = get_match(curwin, id)) != NULL)
            {
                list_append_string(rettv->vval.v_list,
                                                syn_id2name(m->hlg_id), -1);
index 56f6958dea1b6d4d06f39ee5459c1b8f3d2c1fd6..06fd97c7fe6d4221725d91ebe17d5d8cc61c1db8 100644 (file)
@@ -551,7 +551,7 @@ ml_set_crypt_key(
                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 ((hp = mf_get(mfp, bnum, page_count)) == NULL)
            {
                if (bnum == 1)
                    break;
@@ -1511,7 +1511,7 @@ ml_recover(int checkext)
        /*
         * get block
         */
-       if ((hp = mf_get(mfp, (blocknr_T)bnum, page_count)) == NULL)
+       if ((hp = mf_get(mfp, bnum, page_count)) == NULL)
        {
            if (bnum == 1)
            {
@@ -3672,7 +3672,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int flags)
 
 #ifdef FEAT_NETBEANS_INTG
     if (netbeans_active())
-       netbeans_removed(buf, lnum, 0, (long)line_size);
+       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
index 31314d2c7da02d9248c6969b03854d060d471ab1..c13a94d14f943f3a16163c38d228cc2430d8ea54 100644 (file)
@@ -164,7 +164,7 @@ msg_attr_keep(
 #ifdef FEAT_JOB_CHANNEL
     if (emsg_to_channel_log)
        // Write message in the channel log.
-       ch_log(NULL, "ERROR: %s", (char *)s);
+       ch_log(NULL, "ERROR: %s", s);
 #endif
 
     // Truncate the message if needed.
@@ -905,7 +905,7 @@ emsg_invreg(int name)
     void
 emsg_namelen(char *msg, char_u *name, int len)
 {
-    char_u *copy = vim_strnsave((char_u *)name, len);
+    char_u *copy = vim_strnsave(name, len);
 
     semsg(msg, copy == NULL ? "NULL" : (char *)copy);
     vim_free(copy);
@@ -3701,7 +3701,7 @@ give_warning2(char_u *message, char_u *a1, int hl)
     {
        // 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);
+       give_warning(message, hl);
     }
     else
     {
index e43d001568dc97261881b5962a91ec8ef62c40f2..7fc625b51d50d0ffd50b067109930329f895bb62 100644 (file)
@@ -379,7 +379,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;
 }
 
index 21840369f78d3fc0d82ab3872394605f5eb1b85d..2d5f8a5f764997a07892ed8a0cd9409231f59863 100644 (file)
@@ -5211,7 +5211,7 @@ nv_replace(cmdarg_T *cap)
                colnr_T  start = (colnr_T)(curwin->w_cursor.col - cap->count1);
 
                netbeans_removed(curbuf, curwin->w_cursor.lnum, start,
-                                                          (long)cap->count1);
+                                                          cap->count1);
                netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
                                               &ptr[start], (int)cap->count1);
            }
index 6e327a2b27360e713774060b98594c2e815bd865..77e45de768c7d6f5fbc6f52c6f799b9b72c54e82 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -334,8 +334,7 @@ shift_block(oparg_T *oap, int amount)
        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));
+           incr = lbr_chartabsize_adv(bd.textstart, &bd.textstart, bd.start_vcol);
            total += incr;
            bd.start_vcol += incr;
        }
@@ -460,7 +459,7 @@ shift_block(oparg_T *oap, int amount)
     }
     // replace the line
     ml_replace(curwin->w_cursor.lnum, newp, FALSE);
-    changed_bytes(curwin->w_cursor.lnum, (colnr_T)bd.textcol);
+    changed_bytes(curwin->w_cursor.lnum, bd.textcol);
     State = oldstate;
     curwin->w_cursor.col = oldcol;
 #ifdef FEAT_RIGHTLEFT
@@ -2133,7 +2132,7 @@ do_join(
        // 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,
+       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,7 +2242,7 @@ block_prep(
     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);
+       incr = lbr_chartabsize(line, pstart, bdp->start_vcol);
        bdp->start_vcol += incr;
        if (VIM_ISWHITE(*pstart))
        {
@@ -2306,7 +2305,7 @@ block_prep(
            {
                // 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);
+               incr = lbr_chartabsize_adv(line, &pend, bdp->end_vcol);
                bdp->end_vcol += incr;
            }
            if (bdp->end_vcol <= oap->end_vcol
@@ -2866,13 +2865,13 @@ do_addsub(
            buf2[i] = '\0';
        }
        else if (pre == 0)
-           vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", (uvarnumber_T)n);
+           vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", n);
        else if (pre == '0')
-           vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", (uvarnumber_T)n);
+           vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", n);
        else if (pre && hexupper)
-           vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", (uvarnumber_T)n);
+           vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", n);
        else
-           vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", (uvarnumber_T)n);
+           vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", n);
        length -= (int)STRLEN(buf2);
 
        /*
@@ -3191,21 +3190,21 @@ cursor_pos_info(dict_T *dict)
                            _("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);
+                           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,
-                           (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);
+                           word_count_cursor,
+                           word_count,
+                           char_count_cursor,
+                           char_count,
+                           byte_count_cursor,
+                           byte_count);
            }
            else
            {
@@ -3223,17 +3222,17 @@ cursor_pos_info(dict_T *dict)
                        (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);
+                       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,
-                       (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);
+                       word_count_cursor, word_count,
+                       char_count_cursor, char_count,
+                       byte_count_cursor, byte_count);
            }
        }
 
@@ -3243,7 +3242,7 @@ cursor_pos_info(dict_T *dict)
            size_t len = STRLEN(IObuff);
 
            vim_snprintf((char *)IObuff + len, IOSIZE - len,
-                                _("(+%lld for BOM)"), (varnumber_T)bom_count);
+                                _("(+%lld for BOM)"), bom_count);
        }
        if (dict == NULL)
        {
index f6b6afad56ea87a82774be875af2d73b6ab96b44..bb952fee5c78e9b9a2de52d9f516b50832909407 100644 (file)
@@ -3702,7 +3702,7 @@ set_num_option(
     {
        if (errbuf != NULL)
        {
-           vim_snprintf((char *)errbuf, errbuflen,
+           vim_snprintf(errbuf, errbuflen,
                               _(e_need_at_least_nr_lines), min_rows());
            errmsg = errbuf;
        }
@@ -3712,7 +3712,7 @@ set_num_option(
     {
        if (errbuf != NULL)
        {
-           vim_snprintf((char *)errbuf, errbuflen,
+           vim_snprintf(errbuf, errbuflen,
                            _(e_need_at_least_nr_columns), MIN_COLUMNS);
            errmsg = errbuf;
        }
index 4aa7cef5e9aef1ab64445f4ec2ef1936992224fa..8d74ba0d591e46e25f86e011678153124d019ba4 100644 (file)
@@ -181,7 +181,7 @@ trigger_optionsset_string(
            set_vim_var_string(VV_OPTION_OLDLOCAL, oldval, -1);
        }
        apply_autocmds(EVENT_OPTIONSET,
-                      (char_u *)get_option_fullname(opt_idx), NULL, FALSE,
+                      get_option_fullname(opt_idx), NULL, FALSE,
                       NULL);
        reset_v_option_vars();
     }
index a0189ea454104559b93c17cf38e465c0cf6bd139..9a4880493f8522f40182546cdb1517517307baf9 100644 (file)
@@ -5666,7 +5666,7 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options, int is_terminal)
                {
                    typval_T *item = &dict_lookup(hi)->di_tv;
 
-                   vim_setenv((char_u*)hi->hi_key, tv_get_string(item));
+                   vim_setenv(hi->hi_key, tv_get_string(item));
                    --todo;
                }
        }
@@ -7487,7 +7487,7 @@ mch_libcall(
     if (hinstLib == NULL)
     {
        // "dlerr" must be used before dlclose()
-       dlerr = (char *)dlerror();
+       dlerr = dlerror();
        if (dlerr != NULL)
            semsg(_("dlerror = \"%s\""), dlerr);
     }
@@ -7522,7 +7522,7 @@ mch_libcall(
            {
 # if defined(USE_DLOPEN)
                *(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
-               dlerr = (char *)dlerror();
+               dlerr = dlerror();
 # else
                if (shl_findsym(&hinstLib, (const char *)funcname,
                                        TYPE_PROCEDURE, (void *)&ProcAdd) < 0)
@@ -7544,7 +7544,7 @@ mch_libcall(
            {
 # if defined(USE_DLOPEN)
                *(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
-               dlerr = (char *)dlerror();
+               dlerr = dlerror();
 # else
                if (shl_findsym(&hinstLib, (const char *)funcname,
                                       TYPE_PROCEDURE, (void *)&ProcAddI) < 0)
index 03f7f4ec9604ce569913646d19c687ac91828926..a3af8b337ca82f380c7b2727f2699f8c399dfdd9 100644 (file)
@@ -1842,7 +1842,7 @@ do_put(
            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);
+               incr = lbr_chartabsize_adv(oldp, &ptr, vcol);
                vcol += incr;
            }
            bd.textcol = (colnr_T)(ptr - oldp);
index 1be1d13a221fdf956cc694d6d555e3bef064d442..e1aae5121fbb373aa993f8673faac2bbba7daab7 100644 (file)
@@ -1745,38 +1745,38 @@ sign_getinfo(sign_T *sp, dict_T *retdict)
 {
     char_u     *p;
 
-    dict_add_string(retdict, "name", (char_u *)sp->sn_name);
+    dict_add_string(retdict, "name", sp->sn_name);
     if (sp->sn_icon != NULL)
-       dict_add_string(retdict, "icon", (char_u *)sp->sn_icon);
+       dict_add_string(retdict, "icon", sp->sn_icon);
     if (sp->sn_text != NULL)
-       dict_add_string(retdict, "text", (char_u *)sp->sn_text);
+       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", (char_u *)p);
+       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", (char_u *)p);
+       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", (char_u *)p);
+       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", (char_u *)p);
+       dict_add_string(retdict, "numhl", p);
     }
 }
 
index af6c6ef2f9c7fd6eafc89b06329ec55061f25ae6..b5c6693966cbcc7f4956523d69fa971dd34f7794 100644 (file)
@@ -3618,7 +3618,7 @@ 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;
index 346e63c213d6d7dd0c21969170e0f243b2c3bbbb..b405f1fe681f3e56ff24ea4de0a9dda94b961f87 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -3799,7 +3799,7 @@ expand_tag_fname(char_u *fname, char_u *tag_fname, int expand)
     {
        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;
index b37df4981933f63ca7e33e843510e8eca7e14d1f..a6cee804ad47de056543e2f8158c25e833e4602a 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1106,8 +1106,8 @@ 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;
 }
 
@@ -1119,8 +1119,8 @@ 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;
 }
 
index 636144aefd17feb179a0272ca2c66897a9e145be..1ed720c5bfe8f2041ac785753f02b6292d3d83bd 100644 (file)
@@ -1142,7 +1142,7 @@ undo_read(bufinfo_T *bi, char_u *buffer, size_t size)
     }
     else
 #endif
-    if (fread(buffer, (size_t)size, 1, bi->bi_fp) != 1)
+    if (fread(buffer, size, 1, bi->bi_fp) != 1)
        retval = FAIL;
 
     if (retval == FAIL)
@@ -3710,10 +3710,10 @@ f_undotree(typval_T *argvars UNUSED, typval_T *rettv)
 
        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, "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", (long)curbuf->b_u_save_nr_cur);
+       dict_add_number(dict, "save_cur", curbuf->b_u_save_nr_cur);
 
        list = list_alloc();
        if (list != NULL)
index fff4e6dd3ff48ca561668406494b936a5d30376e..eb5006b1b65222d5e6ec6ef8b9761c76ea963cb8 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4241,
 /**/
     4240,
 /**/
index 74257275c7c3a0270e3743b6ea95cfcf7493b42c..c77149f97df49581c48c378e9eb203a862c91c11 100644 (file)
@@ -6493,7 +6493,7 @@ 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;