]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1393: unnecessary type casts v8.1.1393
authorBram Moolenaar <Bram@vim.org>
Sat, 25 May 2019 18:21:28 +0000 (20:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 25 May 2019 18:21:28 +0000 (20:21 +0200)
Problem:    Unnecessary type casts.
Solution:   Remove type casts from alloc() and lalloc() calls. (Mike Williams)

31 files changed:
src/channel.c
src/crypt.c
src/dict.c
src/dosinst.c
src/evalfunc.c
src/ex_cmds.c
src/ex_cmds2.c
src/ex_docmd.c
src/ex_getln.c
src/fileio.c
src/findfile.c
src/if_ole.cpp
src/if_py_both.h
src/list.c
src/message.c
src/misc1.c
src/misc2.c
src/ops.c
src/os_vms.c
src/os_win32.c
src/quickfix.c
src/regexp_nfa.c
src/screen.c
src/search.c
src/sign.c
src/syntax.c
src/tag.c
src/term.c
src/terminal.c
src/textprop.c
src/version.c

index 4794ae3fabb4ce1b1885b4fea31b98c5758b2e96..f6fa13b76fc38936d2fc7870d001238cd486782b 100644 (file)
@@ -1354,7 +1354,7 @@ channel_set_req_callback(
        int         id)
 {
     cbq_T *head = &channel->ch_part[part].ch_cb_head;
-    cbq_T *item = (cbq_T *)alloc((int)sizeof(cbq_T));
+    cbq_T *item = (cbq_T *)alloc(sizeof(cbq_T));
 
     if (item != NULL)
     {
@@ -3921,7 +3921,7 @@ channel_send(
                }
                else
                {
-                   writeq_T *last = (writeq_T *)alloc((int)sizeof(writeq_T));
+                   writeq_T *last = (writeq_T *)alloc(sizeof(writeq_T));
 
                    if (last != NULL)
                    {
index 6eb3e21fafac850f1c24784bf9f44d9f44aaccd3..2846d28103aa655c990412a6c36507eabd445387 100644 (file)
@@ -254,7 +254,7 @@ crypt_create(
     char_u     *seed,
     int                seed_len)
 {
-    cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
+    cryptstate_T *state = (cryptstate_T *)alloc(sizeof(cryptstate_T));
 
     if (state == NULL)
        return state;
@@ -407,7 +407,7 @@ crypt_encode_alloc(
        /* Not buffering, just return EOF. */
        return (long)len;
 
-    *newptr = alloc((long)len);
+    *newptr = alloc(len);
     if (*newptr == NULL)
        return -1;
     method->encode_fn(state, from, len, *newptr);
index 6e1d0d640f4a80a5a4a6338ca32b0cb6992fbde1..40c940e3d92b616fd333ddda6c42cf5d8e192d62 100644 (file)
@@ -54,7 +54,7 @@ dict_alloc(void)
 dict_alloc_id(alloc_id_T id UNUSED)
 {
 #ifdef FEAT_EVAL
-    if (alloc_fail_id == id && alloc_does_fail((long_u)sizeof(list_T)))
+    if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T)))
        return NULL;
 #endif
     return (dict_alloc());
index b975ff8bbcc7f94cc18fc7815d48ac2bb3af6274..0ea879a3906373872b947de66c4b352c105e0494 100644 (file)
@@ -306,7 +306,7 @@ findoldfile(char **destination)
            || strchr(cp, '/') != NULL)
        return;
 
-    tmpname = alloc((int)strlen(cp) + 1);
+    tmpname = alloc(strlen(cp) + 1);
     strcpy(tmpname, cp);
     tmpname[strlen(tmpname) - 1] = 'x';        /* .exe -> .exx */
 
@@ -962,7 +962,7 @@ alloc_text(int idx, char *fmt, char *arg)
     if (choices[idx].text != NULL)
        free(choices[idx].text);
 
-    choices[idx].text = alloc((int)(strlen(fmt) + strlen(arg)) - 1);
+    choices[idx].text = alloc(strlen(fmt) + strlen(arg) - 1);
     sprintf(choices[idx].text, fmt, arg);
 }
 
@@ -1040,7 +1040,7 @@ change_bat_choice(int idx)
                s = p + strlen(p);
            if (names != NULL)
            {
-               names[count] = alloc((int)(s - p) + 1);
+               names[count] = alloc(s - p + 1);
                strncpy(names[count], p, s - p);
                names[count][s - p] = NUL;
            }
@@ -1051,7 +1051,7 @@ change_bat_choice(int idx)
        }
        if (names != NULL)
            break;
-       names = alloc((int)(count + 1) * sizeof(char *));
+       names = alloc((count + 1) * sizeof(char *));
     }
     names[0] = alloc(50);
     sprintf(names[0], "Select directory to create %s in:", name);
index 914efb1c9db42c5f4f55bce21f4b86ad0d61f2a2..3256b22c9d4094ba823d87db8df68f2425bf5982 100644 (file)
@@ -4412,7 +4412,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
             * would also work, but some plugins depend on the name being
             * printable text. */
            sprintf(sid_buf, "<SNR>%ld_", (long)current_sctx.sc_sid);
-           name = alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1));
+           name = alloc(STRLEN(sid_buf) + STRLEN(s + off) + 1);
            if (name != NULL)
            {
                STRCPY(name, sid_buf);
@@ -12671,7 +12671,7 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
        }
 
        /* Make an array with each entry pointing to an item in the List. */
-       ptrs = (sortItem_T *)alloc((int)(len * sizeof(sortItem_T)));
+       ptrs = (sortItem_T *)alloc(len * sizeof(sortItem_T));
        if (ptrs == NULL)
            goto theend;
 
index 3d967580bce47ab14260cfa3ea4d0fbdd28e4f88..02750647e15f1c8c18503cee43a90a8fdbb1d548 100644 (file)
@@ -2746,7 +2746,7 @@ barline_parse(vir_T *virp, char_u *text, garray_T *values)
                 */
                ++p;
                len = getdigits(&p);
-               buf = alloc((int)(len + 1));
+               buf = alloc(len + 1);
                if (buf == NULL)
                    return TRUE;
                p = buf;
index c56e305336b0f62941e3f3db92bb63622e07c35e..a0c71694dd83db5c514ededdae81620e206d91d2 100644 (file)
@@ -2800,7 +2800,7 @@ add_pack_dir_to_rtp(char_u *fname)
 
     oldlen = STRLEN(p_rtp);
     addlen = STRLEN(fname) + 1; // add one for comma
-    new_rtp = alloc((int)(oldlen + addlen + afterlen + 1)); // add one for NUL
+    new_rtp = alloc(oldlen + addlen + afterlen + 1); // add one for NUL
     if (new_rtp == NULL)
        goto theend;
 
index 9f127ec72a15fdf34d3dfd331809b8f53fd142b1..2b16a1e0aab13b4d466fcb33780856a2b640448e 100644 (file)
@@ -4816,7 +4816,7 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
            while ((pos = (char_u *)strstr((char *)pos + 2, "$*")) != NULL)
                ++i;
            len = (int)STRLEN(p);
-           new_cmdline = alloc((int)(STRLEN(program) + i * (len - 2) + 1));
+           new_cmdline = alloc(STRLEN(program) + i * (len - 2) + 1);
            if (new_cmdline == NULL)
                return NULL;                    /* out of memory */
            ptr = new_cmdline;
@@ -4832,7 +4832,7 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
        }
        else
        {
-           new_cmdline = alloc((int)(STRLEN(program) + STRLEN(p) + 2));
+           new_cmdline = alloc(STRLEN(program) + STRLEN(p) + 2);
            if (new_cmdline == NULL)
                return NULL;                    /* out of memory */
            STRCPY(new_cmdline, program);
index 530efce5793f8b969ea11e9d37ddea68250ad228..80f1855ad398ce462e3308d3fdcdefb950638cb6 100644 (file)
@@ -5914,8 +5914,7 @@ init_history(void)
        {
            if (newlen)
            {
-               temp = (histentry_T *)alloc(
-                                      (long_u)(newlen * sizeof(histentry_T)));
+               temp = (histentry_T *)alloc(newlen * sizeof(histentry_T));
                if (temp == NULL)   /* out of memory! */
                {
                    if (type == 0)  /* first one: just keep the old length */
@@ -6655,7 +6654,7 @@ prepare_viminfo_history(int asklen, int writing)
            viminfo_history[type] = NULL;
        else
            viminfo_history[type] = (histentry_T *)lalloc(
-                                 (long_u)(len * sizeof(histentry_T)), FALSE);
+                                           len * sizeof(histentry_T), FALSE);
        if (viminfo_history[type] == NULL)
            len = 0;
        viminfo_hislen[type] = len;
index 96207ab9ca3daf317a76e56e10329ce5c1624b8b..ee8c14d352f6532a368eeedda15a0d6af82d3ed5 100644 (file)
@@ -7190,7 +7190,7 @@ readdir_core(
     ga_init2(gap, (int)sizeof(char *), 20);
 
 #ifdef MSWIN
-    buf = alloc((int)MAXPATHL);
+    buf = alloc(MAXPATHL);
     if (buf == NULL)
        return FAIL;
     STRNCPY(buf, path, MAXPATHL-5);
index a6d164ad29d8092f9d757cba3ecad4502989dc90..2fee353628b5f51d12a0009ed8ce21ba68a08e58 100644 (file)
@@ -588,9 +588,9 @@ vim_findfile_init(
            if (search_ctx->ffsc_wc_path != NULL)
            {
                wc_path = vim_strsave(search_ctx->ffsc_wc_path);
-               temp = alloc((int)(STRLEN(search_ctx->ffsc_wc_path)
+               temp = alloc(STRLEN(search_ctx->ffsc_wc_path)
                                 + STRLEN(search_ctx->ffsc_fix_path + len)
-                                + 1));
+                                + 1);
                if (temp == NULL || wc_path == NULL)
                {
                    vim_free(buf);
@@ -722,7 +722,7 @@ vim_findfile(void *search_ctx_arg)
      * filepath is used as buffer for various actions and as the storage to
      * return a found filename.
      */
-    if ((file_path = alloc((int)MAXPATHL)) == NULL)
+    if ((file_path = alloc(MAXPATHL)) == NULL)
        return NULL;
 
 #ifdef FEAT_PATH_EXTRA
@@ -1866,7 +1866,7 @@ find_file_in_path_option(
                    break;
                }
 
-               if ((buf = alloc((int)(MAXPATHL))) == NULL)
+               if ((buf = alloc(MAXPATHL)) == NULL)
                    break;
 
                // copy next path
@@ -2274,7 +2274,7 @@ expand_path_option(char_u *curdir, garray_T *gap)
     char_u     *p;
     int                len;
 
-    if ((buf = alloc((int)MAXPATHL)) == NULL)
+    if ((buf = alloc(MAXPATHL)) == NULL)
        return;
 
     while (*path_option != NUL)
@@ -2424,7 +2424,7 @@ uniquefy_paths(garray_T *gap, char_u *pattern)
     if (regmatch.regprog == NULL)
        return;
 
-    if ((curdir = alloc((int)(MAXPATHL))) == NULL)
+    if ((curdir = alloc(MAXPATHL)) == NULL)
        goto theend;
     mch_dirname(curdir, MAXPATHL);
     expand_path_option(curdir, &path_ga);
@@ -2532,7 +2532,7 @@ uniquefy_paths(garray_T *gap, char_u *pattern)
            continue;
        }
 
-       rel_path = alloc((int)(STRLEN(short_name) + STRLEN(PATHSEPSTR) + 2));
+       rel_path = alloc(STRLEN(short_name) + STRLEN(PATHSEPSTR) + 2);
        if (rel_path == NULL)
            goto theend;
        STRCPY(rel_path, ".");
index e52f5ec784bb3632a5fa9cf3cd42eb952f6de39a..cb643e546189def3ce0de4925a99aaf502936368 100644 (file)
@@ -376,7 +376,7 @@ CVim::Eval(BSTR expr, BSTR *result)
     if (len == 0)
        return E_INVALIDARG;
 
-    buffer = (char *)alloc((unsigned)len);
+    buffer = (char *)alloc(len);
 
     if (buffer == NULL)
        return E_OUTOFMEMORY;
index e36f4fdee3cbdc279fe0f994e6b99c2e678ac0db..bc33a80a2027558c858f064da4631f613b08d860 100644 (file)
@@ -2953,7 +2953,7 @@ FunctionNew(PyTypeObject *subtype, char_u *name, int argc, typval_T *argv,
            char_u *np;
            size_t len = STRLEN(p) + 1;
 
-           if ((np = alloc((int)len + 2)) == NULL)
+           if ((np = alloc(len + 2)) == NULL)
            {
                vim_free(p);
                return NULL;
@@ -3139,7 +3139,7 @@ set_partial(FunctionObject *self, partial_T *pt, int exported)
        if (exported)
        {
            pt->pt_argv = (typval_T *)alloc_clear(
-                   sizeof(typval_T) * self->argc);
+                                               sizeof(typval_T) * self->argc);
            for (i = 0; i < pt->pt_argc; ++i)
                copy_tv(&self->argv[i], &pt->pt_argv[i]);
        }
@@ -4262,7 +4262,7 @@ StringToLine(PyObject *obj)
     /* Create a copy of the string, with internal nulls replaced by
      * newline characters, as is the vim convention.
      */
-    save = (char *)alloc((unsigned)(len+1));
+    save = (char *)alloc(len+1);
     if (save == NULL)
     {
        PyErr_NoMemory();
index 0c21c41f590814422fd9487467cf45c22090e9ff..e7f27eb8d5f439c7dd59ac879de779c06dc13a79 100644 (file)
@@ -92,7 +92,7 @@ list_alloc(void)
 list_alloc_id(alloc_id_T id UNUSED)
 {
 #ifdef FEAT_EVAL
-    if (alloc_fail_id == id && alloc_does_fail((long_u)sizeof(list_T)))
+    if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T)))
        return NULL;
 #endif
     return (list_alloc());
@@ -122,7 +122,7 @@ rettv_list_alloc(typval_T *rettv)
 rettv_list_alloc_id(typval_T *rettv, alloc_id_T id UNUSED)
 {
 #ifdef FEAT_EVAL
-    if (alloc_fail_id == id && alloc_does_fail((long_u)sizeof(list_T)))
+    if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T)))
        return FAIL;
 #endif
     return rettv_list_alloc(rettv);
index f1801c3269d1c5f369c6bd4f0c7e94df95b329f3..489edc32db6bdbef8833c9941f6309d85fa166b3 100644 (file)
@@ -875,7 +875,7 @@ add_msg_hist(
        (void)delete_first_msg();
 
     /* allocate an entry and add the message at the end of the history */
-    p = (struct msg_hist *)alloc((int)sizeof(struct msg_hist));
+    p = (struct msg_hist *)alloc(sizeof(struct msg_hist));
     if (p != NULL)
     {
        if (len < 0)
@@ -2360,7 +2360,7 @@ store_sb_text(
 
     if (s > *sb_str)
     {
-       mp = (msgchunk_T *)alloc((int)(sizeof(msgchunk_T) + (s - *sb_str)));
+       mp = (msgchunk_T *)alloc(sizeof(msgchunk_T) + (s - *sb_str));
        if (mp != NULL)
        {
            mp->sb_eol = finish;
index bb82f0903a74cf59a3cf60e43f055a02876489c3..7ef7e78f07e9174db1919e68df906a40b9f6a6d6 100644 (file)
@@ -3446,7 +3446,7 @@ dos_expandpath(
 
     // Make room for file name.  When doing encoding conversion the actual
     // length may be quite a bit longer, thus use the maximum possible length.
-    buf = alloc((int)MAXPATHL);
+    buf = alloc(MAXPATHL);
     if (buf == NULL)
        return 0;
 
@@ -3690,7 +3690,7 @@ unix_expandpath(
     }
 
     /* make room for file name */
-    buf = alloc((int)STRLEN(path) + BASENAMELEN + 5);
+    buf = alloc(STRLEN(path) + BASENAMELEN + 5);
     if (buf == NULL)
        return 0;
 
index ddb677c20eadae523a6733fc42b49b0d2a489c59..70b23e79b2460e4d71694b47ab9ed95890693c16 100644 (file)
@@ -1290,7 +1290,7 @@ vim_strnsave(char_u *string, int len)
 {
     char_u     *p;
 
-    p = alloc((size_t)(len + 1));
+    p = alloc(len + 1);
     if (p != NULL)
     {
        STRNCPY(p, string, len);
index b205cbba3a8d072b6697670c2f8ca6fe9f3d2ae6..0adb2bcc9b9aff508071035f0c2778a0543ee5e9 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -3355,7 +3355,7 @@ copy_yank_reg(yankreg_T *reg)
     free_yank_all();
     *y_current = *curr;
     y_current->y_array = (char_u **)lalloc_clear(
-                       (long_u)(sizeof(char_u *) * y_current->y_size), TRUE);
+                                   sizeof(char_u *) * y_current->y_size, TRUE);
     if (y_current->y_array == NULL)
        y_current->y_size = 0;
     else
index ca04019d2196c136bda565e0addcfece12a56677..f20e8c25a0deda41ee4c6d839af62a17ea0bdf0f 100644 (file)
@@ -245,7 +245,7 @@ mch_getenv(char_u *lognam)
     else if ((sbuf = getenv((char *)lognam)))
     {
        lengte = strlen(sbuf) + 1;
-       cp = (char_u *)alloc((size_t)lengte);
+       cp = (char_u *)alloc(lengte);
        if (cp)
            strcpy((char *)cp, sbuf);
        return cp;
index 5bec2a219f50b72cd77289633d8ea2d008f8ac18..6a832cfd52534a96e373483ff98a4d55904af2b3 100644 (file)
@@ -7117,7 +7117,7 @@ fix_arg_enc(void)
        return;
 
     /* Remember the buffer numbers for the arguments. */
-    fnum_list = (int *)alloc((int)sizeof(int) * GARGCOUNT);
+    fnum_list = (int *)alloc(sizeof(int) * GARGCOUNT);
     if (fnum_list == NULL)
        return;         /* out of memory */
     for (i = 0; i < GARGCOUNT; ++i)
index 69ffc9c2861f5be289d3e13e858eb52b957f94fb..4f3db39f9294430a458af94882f1096cde2b48d3 100644 (file)
@@ -1815,7 +1815,7 @@ qf_store_title(qf_list_T *qfl, char_u *title)
 
     if (title != NULL)
     {
-       char_u *p = alloc((int)STRLEN(title) + 2);
+       char_u *p = alloc(STRLEN(title) + 2);
 
        qfl->qf_title = p;
        if (p != NULL)
index f81c05d76c5bc0be4e268cf755398c096fb46a6f..cb9c801d84d15d35062c1e501b9fd2933af27f4e 100644 (file)
@@ -4799,7 +4799,7 @@ addstate_here(
                emsg(_(e_maxmempat));
                return NULL;
            }
-           newl = (nfa_thread_T *)alloc((int)newsize);
+           newl = (nfa_thread_T *)alloc(newsize);
            if (newl == NULL)
                return NULL;
            l->len = newlen;
index 79baebe77ae3861033b17c1782e3a4486a9357cc..447dd411b875e9106c612235383e8905c4827e3a 100644 (file)
@@ -328,30 +328,27 @@ redraw_asap(int type)
 
     /* Allocate space to save the text displayed in the command line area. */
     rows = screen_Rows - cmdline_row;
-    screenline = (schar_T *)lalloc(
-                          (long_u)(rows * cols * sizeof(schar_T)), FALSE);
-    screenattr = (sattr_T *)lalloc(
-                          (long_u)(rows * cols * sizeof(sattr_T)), FALSE);
+    screenline = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE);
+    screenattr = (sattr_T *)lalloc(rows * cols * sizeof(sattr_T), FALSE);
     if (screenline == NULL || screenattr == NULL)
        ret = 2;
     if (enc_utf8)
     {
        screenlineUC = (u8char_T *)lalloc(
-                         (long_u)(rows * cols * sizeof(u8char_T)), FALSE);
+                                      rows * cols * sizeof(u8char_T), FALSE);
        if (screenlineUC == NULL)
            ret = 2;
        for (i = 0; i < p_mco; ++i)
        {
            screenlineC[i] = (u8char_T *)lalloc(
-                         (long_u)(rows * cols * sizeof(u8char_T)), FALSE);
+                                      rows * cols * sizeof(u8char_T), FALSE);
            if (screenlineC[i] == NULL)
                ret = 2;
        }
     }
     if (enc_dbcs == DBCS_JPNU)
     {
-       screenline2 = (schar_T *)lalloc(
-                          (long_u)(rows * cols * sizeof(schar_T)), FALSE);
+       screenline2 = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE);
        if (screenline2 == NULL)
            ret = 2;
     }
index 313892f70629fc49ffd11ce4eeb910df8aae2fe1..20e619d39e3b13b40b7279788d0fbe8e428142e5 100644 (file)
@@ -1429,7 +1429,7 @@ do_search(
                // Reserve enough space for the search pattern + offset.
                len = STRLEN(p) + off_len + 3;
 
-           msgbuf = alloc((int)len);
+           msgbuf = alloc(len);
            if (msgbuf != NULL)
            {
                vim_memset(msgbuf, ' ', len);
index 32e6bad18390cd78af30372f23da6b3c54599f22..9766d4e75dd6bd12f08537759c8350f45e68d614 100644 (file)
@@ -85,8 +85,7 @@ sign_group_ref(char_u *groupname)
     if (HASHITEM_EMPTY(hi))
     {
        // new group
-       group = (signgroup_T *)alloc(
-               (unsigned)(sizeof(signgroup_T) + STRLEN(groupname)));
+       group = (signgroup_T *)alloc(sizeof(signgroup_T) + STRLEN(groupname));
        if (group == NULL)
            return NULL;
        STRCPY(group->sg_name, groupname);
@@ -737,8 +736,7 @@ alloc_new_sign(char_u *name)
     int        start = next_sign_typenr;
 
     // Allocate a new sign.
-    sp = (sign_T *)alloc_clear_id((unsigned)sizeof(sign_T),
-           aid_sign_define_by_name);
+    sp = (sign_T *)alloc_clear_id(sizeof(sign_T), aid_sign_define_by_name);
     if (sp == NULL)
        return NULL;
 
index e711198f7d3b0d7ba04fa2e28c4e0273af102558..23ccaf3a38635dd7e9acfa2246c54e37ed4408b4 100644 (file)
@@ -4494,7 +4494,7 @@ add_keyword(
                                                 name_folded, MAXKEYWLEN + 1);
     else
        name_ic = name;
-    kp = (keyentry_T *)alloc((int)(sizeof(keyentry_T) + STRLEN(name_ic)));
+    kp = (keyentry_T *)alloc(sizeof(keyentry_T) + STRLEN(name_ic));
     if (kp == NULL)
        return;
     STRCPY(kp->keyword, name_ic);
@@ -6001,7 +6001,7 @@ get_id_list(
        {
            for (end = p; *end && !VIM_ISWHITE(*end) && *end != ','; ++end)
                ;
-           name = alloc((int)(end - p + 3));       /* leave room for "^$" */
+           name = alloc(end - p + 3);      /* leave room for "^$" */
            if (name == NULL)
            {
                failed = TRUE;
index b6ae1b05ad74f25eb97881edc96bd894f253a6ec..ef2ebbe8fa2c150a0d6c5bf88f25ff92daa68221 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -1430,7 +1430,7 @@ find_tagfunc_tags(
        if (name_only)
            mfp = vim_strsave(res_name);
        else
-           mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
+           mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
 
        if (mfp == NULL)
            continue;
@@ -2536,7 +2536,7 @@ parse_line:
                     */
                    *tagp.tagname_end = NUL;
                    len = (int)(tagp.tagname_end - tagp.tagname);
-                   mfp = (char_u *)alloc((int)sizeof(char_u)
+                   mfp = (char_u *)alloc(sizeof(char_u)
                                                    + len + 10 + ML_EXTRA + 1);
                    if (mfp != NULL)
                    {
@@ -2585,7 +2585,7 @@ parse_line:
                    else
                    {
                        len = (int)(tagp.tagname_end - tagp.tagname);
-                       mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
+                       mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
                        if (mfp != NULL)
                            vim_strncpy(mfp, tagp.tagname, len);
 
@@ -2620,7 +2620,7 @@ parse_line:
                    else
                        ++len;
 #endif
-                   mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
+                   mfp = (char_u *)alloc(sizeof(char_u) + len + 1);
                    if (mfp != NULL)
                    {
                        p = mfp;
@@ -3346,7 +3346,7 @@ jumpto_tag(
     /* Make a copy of the line, it can become invalid when an autocommand calls
      * back here recursively. */
     len = matching_line_len(lbuf_arg) + 1;
-    lbuf = alloc((int)len);
+    lbuf = alloc(len);
     if (lbuf != NULL)
        mch_memmove(lbuf, lbuf_arg, len);
 
index 9885fecfd3e6020cfc08ecadf66a9cbe4f6a043a..e831f8d1fb0b2d2d3bc8006b061011669a4f3415 100644 (file)
@@ -4188,7 +4188,7 @@ add_termcode(char_u *name, char_u *string, int flags)
     {
        tc_max_len += 20;
        new_tc = (struct termcode *)alloc(
-                           (unsigned)(tc_max_len * sizeof(struct termcode)));
+                           tc_max_len * sizeof(struct termcode));
        if (new_tc == NULL)
        {
            tc_max_len -= 20;
@@ -7072,7 +7072,7 @@ gui_get_color_cmn(char_u *name)
            if (!counting)
            {
                colornames_table = (struct rgbcolor_table_S *)alloc(
-                          (unsigned)(sizeof(struct rgbcolor_table_S) * size));
+                                   sizeof(struct rgbcolor_table_S) * size);
                if (colornames_table == NULL)
                {
                    fclose(fd);
index 606a9dbe172b9cbaab2d03868dbff277573e27dd..b0304039e41dcb8f38fd8d5384e29226d786285b 100644 (file)
@@ -534,7 +534,7 @@ term_start(
            cmd = (char_u*)"";
 
        len = STRLEN(cmd) + 10;
-       p = alloc((int)len);
+       p = alloc(len);
 
        for (i = 0; p != NULL; ++i)
        {
@@ -1630,7 +1630,7 @@ update_snapshot(term_T *term)
            if (len == 0)
                p = NULL;
            else
-               p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
+               p = (cellattr_T *)alloc(sizeof(cellattr_T) * len);
            if ((p != NULL || len == 0)
                                     && ga_grow(&term->tl_scrollback, 1) == OK)
            {
@@ -2884,7 +2884,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
 
        ga_init2(&ga, 1, 100);
        if (len > 0)
-           p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
+           p = (cellattr_T *)alloc(sizeof(cellattr_T) * len);
        if (p != NULL)
        {
            for (col = 0; col < len; col += cells[col].width)
@@ -3718,7 +3718,7 @@ handle_drop_command(listitem_T *item)
            p = dict_get_string(dict, (char_u *)"encoding", FALSE);
        if (p != NULL)
        {
-           ea.cmd = alloc((int)STRLEN(p) + 12);
+           ea.cmd = alloc(STRLEN(p) + 12);
            if (ea.cmd != NULL)
            {
                sprintf((char *)ea.cmd, "sbuf ++enc=%s", p);
@@ -4031,7 +4031,7 @@ term_get_status_text(term_T *term)
        else
            txt = (char_u *)_("finished");
        len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt);
-       term->tl_status_text = alloc((int)len);
+       term->tl_status_text = alloc(len);
        if (term->tl_status_text != NULL)
            vim_snprintf((char *)term->tl_status_text, len, "%s [%s]",
                                                term->tl_buffer->b_fname, txt);
@@ -4663,7 +4663,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
     {
        size_t len = STRLEN(fname1) + 12;
 
-       fname_tofree = alloc((int)len);
+       fname_tofree = alloc(len);
        if (fname_tofree != NULL)
        {
            vim_snprintf((char *)fname_tofree, len, "dump diff %s", fname1);
@@ -4935,7 +4935,7 @@ term_swap_diff()
     else
     {
        size_t          size = sizeof(sb_line_T) * term->tl_scrollback.ga_len;
-       sb_line_T       *temp = (sb_line_T *)alloc((int)size);
+       sb_line_T       *temp = (sb_line_T *)alloc(size);
 
        /* need to copy cell properties into temp memory */
        if (temp != NULL)
@@ -5800,7 +5800,7 @@ conpty_term_and_job_init(
     {
        /* Request by CreateProcessW */
        breq = wcslen(cmd_wchar) + 1 + 1;       /* Addition of NUL by API */
-       cmd_wchar_copy = (PWSTR)alloc((int)(breq * sizeof(WCHAR)));
+       cmd_wchar_copy = (PWSTR)alloc(breq * sizeof(WCHAR));
        wcsncpy(cmd_wchar_copy, cmd_wchar, breq - 1);
     }
 
@@ -5830,7 +5830,7 @@ conpty_term_and_job_init(
     /* Set up pipe inheritance safely: Vista or later. */
     pInitializeProcThreadAttributeList(NULL, 1, 0, &breq);
     term->tl_siex.lpAttributeList =
-           (PPROC_THREAD_ATTRIBUTE_LIST)alloc((int)breq);
+           (PPROC_THREAD_ATTRIBUTE_LIST)alloc(breq);
     if (!term->tl_siex.lpAttributeList)
        goto failed;
     if (!pInitializeProcThreadAttributeList(term->tl_siex.lpAttributeList, 1,
index fcf374140f977f64133efff86897e1ebc1ad0269..0abae13278b31b632ea0698e602122f8ddea6a3a 100644 (file)
@@ -1220,7 +1220,7 @@ join_prop_lines(
     oldproplen = get_text_props(curbuf, lnum, &props, FALSE);
 
     len = STRLEN(newp) + 1;
-    line = alloc((int)(len + (oldproplen + proplen) * sizeof(textprop_T)));
+    line = alloc(len + (oldproplen + proplen) * sizeof(textprop_T));
     if (line == NULL)
        return;
     mch_memmove(line, newp, len);
index f8e1d45de636aad3820c5a759fa2d05ea817c724..f774932d221cec7aa3afa48728d7a0b68668f35c 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1393,
 /**/
     1392,
 /**/