]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1386: unessesary type casts for lalloc() v8.1.1386
authorBram Moolenaar <Bram@vim.org>
Fri, 24 May 2019 17:39:03 +0000 (19:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 24 May 2019 17:39:03 +0000 (19:39 +0200)
Problem:    Unessesary type casts for lalloc().
Solution:   Remove type casts.  Change lalloc(size, TRUE) to alloc(size).

41 files changed:
src/buffer.c
src/change.c
src/channel.c
src/diff.c
src/edit.c
src/eval.c
src/ex_cmds.c
src/ex_getln.c
src/fileio.c
src/getchar.c
src/gui_mac.c
src/gui_w32.c
src/gui_x11.c
src/insexpand.c
src/menu.c
src/netbeans.c
src/ops.c
src/os_amiga.c
src/os_mswin.c
src/os_qnx.c
src/os_unix.c
src/os_win32.c
src/popupmnu.c
src/quickfix.c
src/regexp.c
src/regexp_nfa.c
src/screen.c
src/search.c
src/sign.c
src/spell.c
src/spellfile.c
src/syntax.c
src/tag.c
src/terminal.c
src/textprop.c
src/ui.c
src/undo.c
src/userfunc.c
src/version.c
src/winclip.c
src/window.c

index d99071674f16a4273d72165f0d81f3aa841ff33f..f6210952d6c76b397aafc13cd99beccd89c49c38 100644 (file)
@@ -1958,7 +1958,7 @@ buflist_new(
     }
     if (buf != curbuf || curbuf == NULL)
     {
-       buf = (buf_T *)alloc_clear((unsigned)sizeof(buf_T));
+       buf = (buf_T *)alloc_clear(sizeof(buf_T));
        if (buf == NULL)
        {
            vim_free(ffname);
@@ -1985,7 +1985,7 @@ buflist_new(
     }
 
     clear_wininfo(buf);
-    buf->b_wininfo = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
+    buf->b_wininfo = (wininfo_T *)alloc_clear(sizeof(wininfo_T));
 
     if ((ffname != NULL && (buf->b_ffname == NULL || buf->b_sfname == NULL))
            || buf->b_wininfo == NULL)
@@ -2771,7 +2771,7 @@ buflist_setfpos(
     if (wip == NULL)
     {
        /* allocate a new entry */
-       wip = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
+       wip = (wininfo_T *)alloc_clear(sizeof(wininfo_T));
        if (wip == NULL)
            return;
        wip->wi_win = win;
@@ -4911,7 +4911,7 @@ do_arg_all(
     setpcmark();
 
     opened_len = ARGCOUNT;
-    opened = alloc_clear((unsigned)opened_len);
+    opened = alloc_clear(opened_len);
     if (opened == NULL)
        return;
 
index d2aa1530f1df2ab3699ae4090772c5090be8553f..8f0cacb4509f4290ebade6450083a2f8532264c4 100644 (file)
@@ -282,7 +282,7 @@ f_listener_add(typval_T *argvars, typval_T *rettv)
            return;
     }
 
-    lnr = (listener_T *)alloc_clear((sizeof(listener_T)));
+    lnr = (listener_T *)alloc_clear(sizeof(listener_T));
     if (lnr == NULL)
     {
        free_callback(callback, partial);
index 1564128efb5bb0fc058879f9a4aac205d40e0c07..4794ae3fabb4ce1b1885b4fea31b98c5758b2e96 100644 (file)
@@ -294,7 +294,7 @@ static int next_ch_id = 0;
 add_channel(void)
 {
     ch_part_T  part;
-    channel_T  *channel = (channel_T *)alloc_clear((int)sizeof(channel_T));
+    channel_T  *channel = (channel_T *)alloc_clear(sizeof(channel_T));
 
     if (channel == NULL)
        return NULL;
@@ -1728,7 +1728,7 @@ channel_get_all(channel_T *channel, ch_part_T part, int *outlen)
     // Concatenate everything into one buffer.
     for (node = head->rq_next; node != NULL; node = node->rq_next)
        len += node->rq_buflen;
-    res = lalloc(len + 1, TRUE);
+    res = alloc(len + 1);
     if (res == NULL)
        return NULL;
     p = res;
index 3c72e12bf85c86790b172f35cf0537ee660d4c87..7210ce2680df9ce451fde15ac6a19c3e66724626 100644 (file)
@@ -710,7 +710,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din)
     // xdiff requires one big block of memory with all the text.
     for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
        len += (long)STRLEN(ml_get_buf(buf, lnum, FALSE)) + 1;
-    ptr = lalloc(len, TRUE);
+    ptr = alloc(len);
     if (ptr == NULL)
     {
        // Allocating memory failed.  This can happen, because we try to read
index 6e2fdb84481100c2cdb2f4fa623cfa50098ba8ad..6e4b4743c47744d05908132337d51a12e998b3b3 100644 (file)
@@ -3859,7 +3859,7 @@ replace_push(
     if (replace_stack_len <= replace_stack_nr)
     {
        replace_stack_len += 50;
-       p = lalloc(sizeof(char_u) * replace_stack_len, TRUE);
+       p = alloc(sizeof(char_u) * replace_stack_len);
        if (p == NULL)      /* out of memory */
        {
            replace_stack_len -= 50;
index 4796a25bb30412870eaab08ed628ecbe33bc8a3c..1d5d0f11a97b07f594396ce46f62d3eac85a6d95 100644 (file)
@@ -491,7 +491,7 @@ var_redir_start(char_u *name, int append)
     if (redir_varname == NULL)
        return FAIL;
 
-    redir_lval = (lval_T *)alloc_clear((unsigned)sizeof(lval_T));
+    redir_lval = (lval_T *)alloc_clear(sizeof(lval_T));
     if (redir_lval == NULL)
     {
        var_redir_stop();
@@ -7288,7 +7288,7 @@ handle_subscript(
     typval_T *
 alloc_tv(void)
 {
-    return (typval_T *)alloc_clear((unsigned)sizeof(typval_T));
+    return (typval_T *)alloc_clear(sizeof(typval_T));
 }
 
 /*
index 7420d6752ac31262be3dfe4957a8ae10c64b8f12..3d967580bce47ab14260cfa3ea4d0fbdd28e4f88 100644 (file)
@@ -397,7 +397,7 @@ ex_sort(exarg_T *eap)
     sortbuf1 = NULL;
     sortbuf2 = NULL;
     regmatch.regprog = NULL;
-    nrs = (sorti_T *)lalloc((long_u)(count * sizeof(sorti_T)), TRUE);
+    nrs = (sorti_T *)alloc(count * sizeof(sorti_T));
     if (nrs == NULL)
        goto sortend;
 
@@ -793,8 +793,7 @@ ex_retab(exarg_T *eap)
                        /* len is actual number of white characters used */
                        len = num_spaces + num_tabs;
                        old_len = (long)STRLEN(ptr);
-                       new_line = lalloc(old_len - col + start_col + len + 1,
-                                                                       TRUE);
+                       new_line = alloc(old_len - col + start_col + len + 1);
                        if (new_line == NULL)
                            break;
                        if (start_col > 0)
@@ -1745,7 +1744,7 @@ make_filter_cmd(
        len += (long_u)STRLEN(itmp) + 9;                /* " { < " + " } " */
     if (otmp != NULL)
        len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* "  " */
-    buf = lalloc(len, TRUE);
+    buf = alloc(len);
     if (buf == NULL)
        return NULL;
 
@@ -2536,7 +2535,7 @@ viminfo_readstring(
     if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1]))
     {
        len = atol((char *)virp->vir_line + off + 1);
-       retval = lalloc(len, TRUE);
+       retval = alloc(len);
        if (retval == NULL)
        {
            /* Line too long?  File messed up?  Skip next line. */
index 00193fee881a7bd1d4b6c11fa204520113ea757d..530efce5793f8b969ea11e9d37ddea68250ad228 100644 (file)
@@ -4166,7 +4166,7 @@ ExpandOne(
        len = 0;
        for (i = 0; i < xp->xp_numfiles; ++i)
            len += (long_u)STRLEN(xp->xp_files[i]) + 1;
-       ss = lalloc(len, TRUE);
+       ss = alloc(len);
        if (ss != NULL)
        {
            *ss = NUL;
@@ -5914,8 +5914,8 @@ init_history(void)
        {
            if (newlen)
            {
-               temp = (histentry_T *)lalloc(
-                               (long_u)(newlen * sizeof(histentry_T)), TRUE);
+               temp = (histentry_T *)alloc(
+                                      (long_u)(newlen * sizeof(histentry_T)));
                if (temp == NULL)   /* out of memory! */
                {
                    if (type == 0)  /* first one: just keep the old length */
@@ -6688,7 +6688,7 @@ read_viminfo_history(vir_T *virp, int writing)
            {
                /* Need to re-allocate to append the separator byte. */
                len = STRLEN(val);
-               p = lalloc(len + 2, TRUE);
+               p = alloc(len + 2);
                if (p != NULL)
                {
                    if (type == HIST_SEARCH)
@@ -6774,7 +6774,7 @@ handle_viminfo_history(
                {
                    /* Need to re-allocate to append the separator byte. */
                    len = vp[3].bv_len;
-                   p = lalloc(len + 2, TRUE);
+                   p = alloc(len + 2);
                }
                else
                    len = 0; /* for picky compilers */
index 4182d563fdcd664f88a6509aec1b797f5076e77a..96207ab9ca3daf317a76e56e10329ce5c1624b8b 100644 (file)
@@ -89,7 +89,7 @@ struct bw_info
     int                bw_restlen;     /* nr of bytes in bw_rest[] */
     int                bw_first;       /* first write call */
     char_u     *bw_conv_buf;   /* buffer for writing converted chars */
-    int                bw_conv_buflen; /* size of bw_conv_buf */
+    size_t     bw_conv_buflen; /* size of bw_conv_buf */
     int                bw_conv_error;  /* set for conversion error */
     linenr_T   bw_conv_error_lnum;  /* first line with error or zero */
     linenr_T   bw_start_lnum;  /* line number at start of buffer */
@@ -1189,7 +1189,7 @@ retry:
            {
                for ( ; size >= 10; size = (long)((long_u)size >> 1))
                {
-                   if ((new_buffer = lalloc((long_u)(size + linerest + 1),
+                   if ((new_buffer = lalloc(size + linerest + 1,
                                                              FALSE)) != NULL)
                        break;
                }
@@ -4168,8 +4168,7 @@ buf_write(
                write_info.bw_conv_buflen = bufsize * 2;
            else /* FIO_UCS4 */
                write_info.bw_conv_buflen = bufsize * 4;
-           write_info.bw_conv_buf
-                          = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+           write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
            if (write_info.bw_conv_buf == NULL)
                end = 0;
        }
@@ -4180,8 +4179,7 @@ buf_write(
     {
        /* Convert UTF-8 -> UCS-2 and UCS-2 -> DBCS.  Worst-case * 4: */
        write_info.bw_conv_buflen = bufsize * 4;
-       write_info.bw_conv_buf
-                           = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+       write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
        if (write_info.bw_conv_buf == NULL)
            end = 0;
     }
@@ -4191,8 +4189,7 @@ buf_write(
     if (converted && wb_flags == 0 && (wb_flags = get_mac_fio_flags(fenc)) != 0)
     {
        write_info.bw_conv_buflen = bufsize * 3;
-       write_info.bw_conv_buf
-                           = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+       write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
        if (write_info.bw_conv_buf == NULL)
            end = 0;
     }
@@ -4212,8 +4209,7 @@ buf_write(
        {
            /* We're going to use iconv(), allocate a buffer to convert in. */
            write_info.bw_conv_buflen = bufsize * ICONV_MULT;
-           write_info.bw_conv_buf
-                          = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+           write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
            if (write_info.bw_conv_buf == NULL)
                end = 0;
            write_info.bw_first = TRUE;
index 0ebe715cd4066a587a41ea56c2ac629a00e7133a..9eacdc9a96e53c2c2a8d105399e0e5b6349fdc15 100644 (file)
@@ -156,7 +156,7 @@ get_buffcont(
     for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
        count += (long_u)STRLEN(bp->b_str);
 
-    if ((count || dozero) && (p = lalloc(count + 1, TRUE)) != NULL)
+    if ((count || dozero) && (p = alloc(count + 1)) != NULL)
     {
        p2 = p;
        for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
@@ -258,8 +258,7 @@ add_buff(
            len = MINIMAL_SIZE;
        else
            len = slen;
-       p = (buffblock_T *)lalloc((long_u)(sizeof(buffblock_T) + len),
-                                                                       TRUE);
+       p = (buffblock_T *)alloc(sizeof(buffblock_T) + len);
        if (p == NULL)
            return; /* no space, just forget it */
        buf->bh_space = (int)(len - slen);
index c177ee650b265937ce5fd5c9601a9e1ed7d5a302..41fb01ec3f78c2327517b1ac7951d69a134e63c5 100644 (file)
@@ -4476,7 +4476,7 @@ clip_mch_request_selection(VimClipboard *cbd)
     /* In CARBON we don't need a Handle, a pointer is good */
     textOfClip = NewHandle(scrapSize);
 
-    /* tempclip = lalloc(scrapSize+1, TRUE); */
+    /* tempclip = alloc(scrapSize+1); */
     HLock(textOfClip);
     error = GetScrapFlavorData(scrap,
            flavor ? VIMSCRAPFLAVOR : SCRAPTEXTFLAVOR,
@@ -4488,7 +4488,7 @@ clip_mch_request_selection(VimClipboard *cbd)
     else
        type = MAUTO;
 
-    tempclip = lalloc(scrapSize + 1, TRUE);
+    tempclip = alloc(scrapSize + 1);
     mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
     tempclip[scrapSize] = 0;
 
index bf273860614dff46d3ec8430884100a1abc380ed..fd46b66856a85ccf39451b0f24a7e4ffd1e9bc03 100644 (file)
@@ -6803,12 +6803,12 @@ gui_mch_dialog(
        dfltbutton = -1;
 
     /* Allocate array to hold the width of each button */
-    buttonWidths = (int *)lalloc(numButtons * sizeof(int), TRUE);
+    buttonWidths = (int *)alloc(numButtons * sizeof(int));
     if (buttonWidths == NULL)
        return -1;
 
     /* Allocate array to hold the X position of each button */
-    buttonPositions = (int *)lalloc(numButtons * sizeof(int), TRUE);
+    buttonPositions = (int *)alloc(numButtons * sizeof(int));
     if (buttonPositions == NULL)
        return -1;
 
index 6ff164417309278557d5a527a6815a863d9c5599..01881380bca2de94a83947f5795f97f751517c63 100644 (file)
@@ -1167,7 +1167,7 @@ gui_mch_prepare(int *argc, char **argv)
      * Move all the entries in argv which are relevant to X into gui_argv.
      */
     gui_argc = 0;
-    gui_argv = (char **)lalloc((long_u)(*argc * sizeof(char *)), FALSE);
+    gui_argv = (char **)lalloc(*argc * sizeof(char *), FALSE);
     if (gui_argv == NULL)
        return;
     gui_argv[gui_argc++] = argv[0];
index 4a807f48c8ef8358afb3e1457b022154ec52f4f2..387f0666d88930350eecba213728eed9131b4006 100644 (file)
@@ -611,7 +611,7 @@ ins_compl_add(
 
     // Allocate a new match structure.
     // Copy the values to the new match structure.
-    match = (compl_T *)alloc_clear((unsigned)sizeof(compl_T));
+    match = (compl_T *)alloc_clear(sizeof(compl_T));
     if (match == NULL)
        return FAIL;
     match->cp_number = -1;
@@ -1071,8 +1071,7 @@ ins_compl_show_pum(void)
        if (compl_match_arraysize == 0)
            return;
        compl_match_array = (pumitem_T *)alloc_clear(
-                                   (unsigned)(sizeof(pumitem_T)
-                                                   * compl_match_arraysize));
+                                   sizeof(pumitem_T) * compl_match_arraysize);
        if (compl_match_array != NULL)
        {
            // If the current match is the original text don't find the first
index 1ff45b98da49ba0db7827775b89850a7137836ff..f32fe4992d00204c2da792b7433d7a4a8e133287 100644 (file)
@@ -583,7 +583,7 @@ add_menu_path(
            }
 
            /* Not already there, so lets add it */
-           menu = (vimmenu_T *)alloc_clear((unsigned)sizeof(vimmenu_T));
+           menu = (vimmenu_T *)alloc_clear(sizeof(vimmenu_T));
            if (menu == NULL)
                goto erret;
 
index f1ba01a082f88c3310db8702dfe8323d10ac4a64..2d55b8006531d0373ebc3a208525e8709b09b69c 100644 (file)
@@ -863,7 +863,7 @@ nb_unquote(char_u *p, char_u **endp)
     int done = 0;
 
     /* result is never longer than input */
-    result = (char *)alloc_clear((unsigned)STRLEN(p) + 1);
+    result = (char *)alloc_clear(STRLEN(p) + 1);
     if (result == NULL)
        return NULL;
 
@@ -3210,7 +3210,8 @@ addsigntype(
            if (globalsignmaplen == 0) /* first allocation */
            {
                globalsignmaplen = 20;
-               globalsignmap = (char **)alloc_clear(globalsignmaplen*sizeof(char *));
+               globalsignmap = (char **)alloc_clear(
+                                           globalsignmaplen * sizeof(char *));
            }
            else    /* grow it */
            {
index f1e6a63b231ea39229045a433ea691838fad113e..b205cbba3a8d072b6697670c2f8ca6fe9f3d2ae6 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1160,7 +1160,7 @@ stuff_yank(int regname, char_u *p)
     if (y_append && y_current->y_array != NULL)
     {
        pp = &(y_current->y_array[y_current->y_size - 1]);
-       lp = lalloc((long_u)(STRLEN(*pp) + STRLEN(p) + 1), TRUE);
+       lp = alloc(STRLEN(*pp) + STRLEN(p) + 1);
        if (lp == NULL)
        {
            vim_free(p);
@@ -3057,8 +3057,8 @@ op_yank(oparg_T *oap, int deleting, int mess)
     y_current->y_size = yanklines;
     y_current->y_type = yanktype;   /* set the yank register type */
     y_current->y_width = 0;
-    y_current->y_array = (char_u **)lalloc_clear((long_u)(sizeof(char_u *) *
-                                                           yanklines), TRUE);
+    y_current->y_array = (char_u **)lalloc_clear(sizeof(char_u *) * yanklines,
+                                                                        TRUE);
     if (y_current->y_array == NULL)
     {
        y_current = curr;
@@ -3171,8 +3171,8 @@ op_yank(oparg_T *oap, int deleting, int mess)
 
     if (curr != y_current)     /* append the new block to the old block */
     {
-       new_ptr = (char_u **)lalloc((long_u)(sizeof(char_u *) *
-                                  (curr->y_size + y_current->y_size)), TRUE);
+       new_ptr = (char_u **)alloc(sizeof(char_u *) *
+                                          (curr->y_size + y_current->y_size));
        if (new_ptr == NULL)
            goto fail;
        for (j = 0; j < curr->y_size; ++j)
@@ -3190,8 +3190,8 @@ op_yank(oparg_T *oap, int deleting, int mess)
         * the new block, unless being Vi compatible. */
        if (curr->y_type == MCHAR && vim_strchr(p_cpo, CPO_REGAPPEND) == NULL)
        {
-           pnew = lalloc((long_u)(STRLEN(curr->y_array[curr->y_size - 1])
-                             + STRLEN(y_current->y_array[0]) + 1), TRUE);
+           pnew = alloc(STRLEN(curr->y_array[curr->y_size - 1])
+                                         + STRLEN(y_current->y_array[0]) + 1);
            if (pnew == NULL)
            {
                y_idx = y_current->y_size - 1;
@@ -4453,13 +4453,13 @@ do_join(
     /* Allocate an array to store the number of spaces inserted before each
      * line.  We will use it to pre-compute the length of the new line and the
      * proper placement of each original line in the new one. */
-    spaces = lalloc_clear((long_u)count, TRUE);
+    spaces = lalloc_clear(count, TRUE);
     if (spaces == NULL)
        return FAIL;
 #if defined(FEAT_COMMENTS) || defined(PROTO)
     if (remove_comments)
     {
-       comments = (int *)lalloc_clear((long_u)count * sizeof(int), TRUE);
+       comments = (int *)lalloc_clear(count * sizeof(int), TRUE);
        if (comments == NULL)
        {
            vim_free(spaces);
@@ -4571,8 +4571,8 @@ do_join(
        // Allocate an array to copy the text properties of joined lines into.
        // And another array to store the number of properties in each line.
        prop_lines = (textprop_T **)alloc_clear(
-                                     (int)(count - 1) * sizeof(textprop_T *));
-       prop_lengths = (int *)alloc_clear((int)(count - 1) * sizeof(int));
+                                          (count - 1) * sizeof(textprop_T *));
+       prop_lengths = (int *)alloc_clear((count - 1) * sizeof(int));
        if (prop_lengths == NULL)
            VIM_CLEAR(prop_lines);
     }
@@ -6600,7 +6600,7 @@ clip_convert_selection(char_u **str, long_u *len, VimClipboard *cbd)
     if (y_ptr->y_type == MCHAR && *len >= eolsize)
        *len -= eolsize;
 
-    p = *str = lalloc(*len + 1, TRUE); /* add one to avoid zero */
+    p = *str = alloc(*len + 1);        // add one to avoid zero
     if (p == NULL)
        return -1;
     lnum = 0;
@@ -6818,7 +6818,7 @@ get_reg_contents(int regname, int flags)
            ++len;
     }
 
-    retval = lalloc(len + 1, TRUE);
+    retval = alloc(len + 1);
 
     /*
      * Copy the lines of the yank register into the string.
index ec392cd7f700126ca802b7ea6ca1e4f2e2c3ef34..d99c19886b52e26fde2eca1c452576a9ef1f4207 100644 (file)
@@ -1448,7 +1448,7 @@ mch_expandpath(
 #ifdef __amigaos4__
     Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
 #else
-    Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
+    Anchor = (struct AnchorPath *)alloc_clear(ANCHOR_SIZE);
 #endif
     if (Anchor == NULL)
        return 0;
index 67989fe28c482db4f84eb248599d853c82189fca..6f3e708db866a60a05e9fa81df48364069e6a657 100644 (file)
@@ -890,7 +890,7 @@ mch_libcall(
        else if (retval_str != NULL
                && (len = check_str_len(retval_str)) > 0)
        {
-           *string_result = lalloc((long_u)len, TRUE);
+           *string_result = alloc(len);
            if (*string_result != NULL)
                mch_memmove(*string_result, retval_str, len);
        }
index 8091599ecdcae7b05722c238fcfa4a2ea92d4720..79b7ec0f68f780d862b89a9d366717d3cdd12b30 100644 (file)
@@ -120,7 +120,7 @@ clip_mch_set_selection(VimClipboard *cbd)
     type = clip_convert_selection(&str, &len, cbd);
     if (type >= 0)
     {
-       text_clip = lalloc(len + 1, TRUE); /* Normal text */
+       text_clip = alloc(len + 1); // Normal text
 
        if (text_clip && vim_clip)
        {
index 0ec48a1127a21c4b13332159d83b537f80d21fdd..803f9441c634641b621c356b0fe4753af571a3c7 100644 (file)
@@ -4459,9 +4459,9 @@ mch_call_shell_system(
        else
            x = system((char *)cmd);
 # else
-       newcmd = lalloc(STRLEN(p_sh)
+       newcmd = alloc(STRLEN(p_sh)
                + (extra_shell_arg == NULL ? 0 : STRLEN(extra_shell_arg))
-               + STRLEN(p_shcf) + STRLEN(cmd) + 4, TRUE);
+               + STRLEN(p_shcf) + STRLEN(cmd) + 4);
        if (newcmd == NULL)
            x = 0;
        else
index d2907102e0a3c3fe60b26f8c7cd4892cac4b1527..5bec2a219f50b72cd77289633d8ea2d008f8ac18 100644 (file)
@@ -3394,7 +3394,7 @@ mch_get_acl(char_u *fname)
     struct my_acl   *p = NULL;
     DWORD   err;
 
-    p = (struct my_acl *)alloc_clear((unsigned)sizeof(struct my_acl));
+    p = (struct my_acl *)alloc_clear(sizeof(struct my_acl));
     if (p != NULL)
     {
        WCHAR   *wn;
@@ -4533,7 +4533,7 @@ mch_call_shell_terminal(
        cmdlen = STRLEN(p_sh) + 1;
     else
        cmdlen = STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10;
-    newcmd = lalloc(cmdlen, TRUE);
+    newcmd = alloc(cmdlen);
     if (newcmd == NULL)
        return 255;
     if (cmd == NULL)
@@ -4772,7 +4772,7 @@ mch_call_shell(
                {
                    /* make "cmd.exe /c arguments" */
                    cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
-                   newcmd = lalloc(cmdlen, TRUE);
+                   newcmd = alloc(cmdlen);
                    if (newcmd != NULL)
                        vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
                                                       cmd_shell, subcmd);
@@ -4827,7 +4827,7 @@ mch_call_shell(
 #endif
                STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10;
 
-           newcmd = lalloc(cmdlen, TRUE);
+           newcmd = alloc(cmdlen);
            if (newcmd != NULL)
            {
 #if defined(FEAT_GUI_MSWIN)
index 0b002f53e3c92a7ebc5029f084c33a614a0cbacf..e5811d31b1f5fd4bae29908fe8ff708fda3016ac 100644 (file)
@@ -1071,7 +1071,7 @@ split_message(char_u *mesg, pumitem_T **array)
      * position. */
     if (height > max_height)
        height = max_height;
-    *array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * height);
+    *array = (pumitem_T *)alloc_clear(sizeof(pumitem_T) * height);
     if (*array == NULL)
        goto failed;
 
@@ -1165,7 +1165,7 @@ ui_post_balloon(char_u *mesg, list_T *list)
 
        balloon_arraysize = list->lv_len;
        balloon_array = (pumitem_T *)alloc_clear(
-                                  (unsigned)sizeof(pumitem_T) * list->lv_len);
+                                            sizeof(pumitem_T) * list->lv_len);
        if (balloon_array == NULL)
            return;
        for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx)
@@ -1271,7 +1271,7 @@ pum_show_popupmenu(vimmenu_T *menu)
        return;
     }
 
-    array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * pum_size);
+    array = (pumitem_T *)alloc_clear(sizeof(pumitem_T) * pum_size);
     if (array == NULL)
        return;
 
index 46eae2dd2888c062a87ca9a5ff9b688094323635..69ffc9c2861f5be289d3e13e858eb52b957f94fb 100644 (file)
@@ -540,7 +540,7 @@ parse_efm_option(char_u *efm)
     while (efm[0] != NUL)
     {
        // Allocate a new eformat structure and put it at the end of the list
-       fmt_ptr = (efm_T *)alloc_clear((unsigned)sizeof(efm_T));
+       fmt_ptr = (efm_T *)alloc_clear(sizeof(efm_T));
        if (fmt_ptr == NULL)
            goto parse_efm_error;
        if (fmt_first == NULL)      // first one
@@ -2141,7 +2141,7 @@ qf_alloc_stack(qfltype_T qfltype)
 {
     qf_info_T *qi;
 
-    qi = (qf_info_T *)alloc_clear((unsigned)sizeof(qf_info_T));
+    qi = (qf_info_T *)alloc_clear(sizeof(qf_info_T));
     if (qi != NULL)
     {
        qi->qf_refcount++;
index 3697cd983793bb62cd3ba2c882328f2c381693b0..b090389929d0129bf2c9076b861ab773ae8a6850 100644 (file)
@@ -1319,7 +1319,7 @@ bt_regcomp(char_u *expr, int re_flags)
        return NULL;
 
     /* Allocate space. */
-    r = (bt_regprog_T *)lalloc(sizeof(bt_regprog_T) + regsize, TRUE);
+    r = (bt_regprog_T *)alloc(sizeof(bt_regprog_T) + regsize);
     if (r == NULL)
        return NULL;
     r->re_in_use = FALSE;
@@ -3932,7 +3932,7 @@ make_extmatch(void)
 {
     reg_extmatch_T     *em;
 
-    em = (reg_extmatch_T *)alloc_clear((unsigned)sizeof(reg_extmatch_T));
+    em = (reg_extmatch_T *)alloc_clear(sizeof(reg_extmatch_T));
     if (em != NULL)
        em->refcnt = 1;
     return em;
@@ -7830,7 +7830,7 @@ reg_submatch(int no)
 
            if (retval == NULL)
            {
-               retval = lalloc((long_u)len, TRUE);
+               retval = alloc(len);
                if (retval == NULL)
                    return NULL;
            }
index a214b4a3fac90831bde9da754a1d06c52ca780d1..f81c05d76c5bc0be4e268cf755398c096fb46a6f 100644 (file)
@@ -300,7 +300,7 @@ nfa_regcomp_start(
     /* Size for postfix representation of expr. */
     postfix_size = sizeof(int) * nstate_max;
 
-    post_start = (int *)lalloc(postfix_size, TRUE);
+    post_start = (int *)alloc(postfix_size);
     if (post_start == NULL)
        return FAIL;
     post_ptr = post_start;
@@ -516,7 +516,7 @@ realloc_post_list(void)
     // For weird patterns the number of states can be very high. Increasing by
     // 50% seems a reasonable compromise between memory use and speed.
     new_max = nstate_max * 3 / 2;
-    new_start = (int *)lalloc(new_max * sizeof(int), TRUE);
+    new_start = (int *)alloc(new_max * sizeof(int));
     if (new_start == NULL)
        return FAIL;
     mch_memmove(new_start, post_start, nstate_max * sizeof(int));
@@ -3214,7 +3214,7 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
     if (nfa_calc_size == FALSE)
     {
        // Allocate space for the stack. Max states on the stack: "nstate'.
-       stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
+       stack = (Frag_T *)alloc((nstate + 1) * sizeof(Frag_T));
        if (stack == NULL)
            return NULL;
        stackp = stack;
@@ -5184,7 +5184,7 @@ recursive_regmatch(
        if (*listids == NULL || *listids_len < prog->nstate)
        {
            vim_free(*listids);
-           *listids = (int *)lalloc(sizeof(int) * prog->nstate, TRUE);
+           *listids = (int *)alloc(sizeof(int) * prog->nstate);
            if (*listids == NULL)
            {
                emsg(_("E878: (NFA) Could not allocate memory for branch traversal!"));
@@ -5567,9 +5567,9 @@ nfa_regmatch(
     /* Allocate memory for the lists of nodes. */
     size = (prog->nstate + 1) * sizeof(nfa_thread_T);
 
-    list[0].t = (nfa_thread_T *)lalloc(size, TRUE);
+    list[0].t = (nfa_thread_T *)alloc(size);
     list[0].len = prog->nstate + 1;
-    list[1].t = (nfa_thread_T *)lalloc(size, TRUE);
+    list[1].t = (nfa_thread_T *)alloc(size);
     list[1].len = prog->nstate + 1;
     if (list[0].t == NULL || list[1].t == NULL)
        goto theend;
@@ -7276,7 +7276,7 @@ nfa_regcomp(char_u *expr, int re_flags)
 
     /* allocate the regprog with space for the compiled regexp */
     prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * (nstate - 1);
-    prog = (nfa_regprog_T *)lalloc(prog_size, TRUE);
+    prog = (nfa_regprog_T *)alloc(prog_size);
     if (prog == NULL)
        goto fail;
     state_ptr = prog->state;
index cb10f6ee9c9c61d04869412b5d0d4cd40a7c8c7a..4691775057450715e54fb1590200c27803dea73a 100644 (file)
@@ -8782,26 +8782,25 @@ retry:
     if (aucmd_win != NULL)
        win_free_lsize(aucmd_win);
 
-    new_ScreenLines = (schar_T *)lalloc((long_u)(
-                             (Rows + 1) * Columns * sizeof(schar_T)), FALSE);
+    new_ScreenLines = (schar_T *)lalloc(
+                             (Rows + 1) * Columns * sizeof(schar_T), FALSE);
     vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO);
     if (enc_utf8)
     {
-       new_ScreenLinesUC = (u8char_T *)lalloc((long_u)(
-                            (Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
+       new_ScreenLinesUC = (u8char_T *)lalloc(
+                            (Rows + 1) * Columns * sizeof(u8char_T), FALSE);
        for (i = 0; i < p_mco; ++i)
-           new_ScreenLinesC[i] = (u8char_T *)lalloc_clear((long_u)(
-                            (Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
+           new_ScreenLinesC[i] = (u8char_T *)lalloc_clear(
+                            (Rows + 1) * Columns * sizeof(u8char_T), FALSE);
     }
     if (enc_dbcs == DBCS_JPNU)
-       new_ScreenLines2 = (schar_T *)lalloc((long_u)(
-                            (Rows + 1) * Columns * sizeof(schar_T)), FALSE);
-    new_ScreenAttrs = (sattr_T *)lalloc((long_u)(
-                             (Rows + 1) * Columns * sizeof(sattr_T)), FALSE);
-    new_LineOffset = (unsigned *)lalloc((long_u)(
-                                        Rows * sizeof(unsigned)), FALSE);
-    new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE);
-    new_TabPageIdxs = (short *)lalloc((long_u)(Columns * sizeof(short)), FALSE);
+       new_ScreenLines2 = (schar_T *)lalloc(
+                            (Rows + 1) * Columns * sizeof(schar_T), FALSE);
+    new_ScreenAttrs = (sattr_T *)lalloc(
+                             (Rows + 1) * Columns * sizeof(sattr_T), FALSE);
+    new_LineOffset = (unsigned *)lalloc(Rows * sizeof(unsigned), FALSE);
+    new_LineWraps = (char_u *)lalloc(Rows * sizeof(char_u), FALSE);
+    new_TabPageIdxs = (short *)lalloc(Columns * sizeof(short), FALSE);
 
     FOR_ALL_TAB_WINDOWS(tp, wp)
     {
@@ -10741,7 +10740,7 @@ redraw_win_toolbar(win_T *wp)
     for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next)
        ++item_count;
     wp->w_winbar_items = (winbar_item_T *)alloc_clear(
-                          (unsigned)sizeof(winbar_item_T) * (item_count + 1));
+                                    sizeof(winbar_item_T) * (item_count + 1));
 
     /* TODO: use fewer spaces if there is not enough room */
     for (menu = wp->w_winbar->children;
index f7b3dda3123091e9dd2f7f808140ec623b11f0ef..bbe370356d295bd1942afc98ab35783564a034ae 100644 (file)
@@ -5137,8 +5137,8 @@ find_pattern_in_path(
            goto fpip_end;
        def_regmatch.rm_ic = FALSE;     /* don't ignore case in define pat. */
     }
-    files = (SearchedFile *)lalloc_clear((long_u)
-                              (max_path_depth * sizeof(SearchedFile)), TRUE);
+    files = (SearchedFile *)lalloc_clear(
+                                 max_path_depth * sizeof(SearchedFile), TRUE);
     if (files == NULL)
        goto fpip_end;
     old_files = max_path_depth;
@@ -5298,8 +5298,8 @@ find_pattern_in_path(
                /* Push the new file onto the file stack */
                if (depth + 1 == old_files)
                {
-                   bigger = (SearchedFile *)lalloc((long_u)(
-                           max_path_depth * 2 * sizeof(SearchedFile)), TRUE);
+                   bigger = (SearchedFile *)alloc(
+                                   max_path_depth * 2 * sizeof(SearchedFile));
                    if (bigger != NULL)
                    {
                        for (i = 0; i <= depth; i++)
index cc519010726fc488c2f50ddeca2f17e10f1f4164..32e6bad18390cd78af30372f23da6b3c54599f22 100644 (file)
@@ -202,8 +202,8 @@ insert_sign(
 {
     signlist_T *newsign;
 
-    newsign = (signlist_T *)lalloc_id((long_u)sizeof(signlist_T), FALSE,
-                                                       aid_insert_sign);
+    newsign = (signlist_T *)lalloc_id(sizeof(signlist_T), FALSE,
+                                                             aid_insert_sign);
     if (newsign != NULL)
     {
        newsign->id = id;
@@ -1057,7 +1057,7 @@ sign_jump(int sign_id, char_u *sign_group, buf_T *buf)
            emsg(_("E934: Cannot jump to a buffer that does not have a name"));
            return -1;
        }
-       cmd = alloc((unsigned)STRLEN(buf->b_fname) + 25);
+       cmd = alloc(STRLEN(buf->b_fname) + 25);
        if (cmd == NULL)
            return -1;
        sprintf((char *)cmd, "e +%ld %s", (long)lnum, buf->b_fname);
index fa5be8be1038c946831c33b12f92480cd21414de..1e14fabffff866fde29eb32f200fffbbfdde85d5 100644 (file)
@@ -7820,8 +7820,7 @@ spell_edit_score(
 
     /* We use "cnt" as an array: CNT(badword_idx, goodword_idx). */
 #define CNT(a, b)   cnt[(a) + (b) * (badlen + 1)]
-    cnt = (int *)lalloc((long_u)(sizeof(int) * (badlen + 1) * (goodlen + 1)),
-                                                                       TRUE);
+    cnt = (int *)alloc(sizeof(int) * (badlen + 1) * (goodlen + 1));
     if (cnt == NULL)
        return 0;       /* out of memory */
 
index 06cf1bcab73c6e0a88a7b4a8d6db3947af31573d..0a16514a4dcd0219c46248a7dde3e990f016bfca 100644 (file)
@@ -892,8 +892,7 @@ read_prefcond_section(FILE *fd, slang_T *lp)
     if (cnt <= 0)
        return SP_FORMERROR;
 
-    lp->sl_prefprog = (regprog_T **)alloc_clear(
-                                        (unsigned)sizeof(regprog_T *) * cnt);
+    lp->sl_prefprog = (regprog_T **)alloc_clear(sizeof(regprog_T *) * cnt);
     if (lp->sl_prefprog == NULL)
        return SP_OTHERERROR;
     lp->sl_prefixcnt = cnt;
@@ -1580,13 +1579,13 @@ spell_read_tree(
     if (len > 0)
     {
        /* Allocate the byte array. */
-       bp = lalloc((long_u)len, TRUE);
+       bp = alloc(len);
        if (bp == NULL)
            return SP_OTHERERROR;
        *bytsp = bp;
 
        /* Allocate the index array. */
-       ip = (idx_T *)lalloc_clear((long_u)(len * sizeof(int)), TRUE);
+       ip = (idx_T *)lalloc_clear(len * sizeof(int), TRUE);
        if (ip == NULL)
            return SP_OTHERERROR;
        *idxsp = ip;
@@ -4272,8 +4271,7 @@ getroom(
            bl = NULL;
        else
            /* Allocate a block of memory. It is not freed until much later. */
-           bl = (sblock_T *)alloc_clear(
-                                  (unsigned)(sizeof(sblock_T) + SBLOCKSIZE));
+           bl = (sblock_T *)alloc_clear(sizeof(sblock_T) + SBLOCKSIZE);
        if (bl == NULL)
        {
            if (!spin->si_did_emsg)
index 27a64c226debde879f6d72e0f5239a3275a27113..e711198f7d3b0d7ba04fa2e28c4e0273af102558 100644 (file)
@@ -1215,7 +1215,7 @@ syn_stack_alloc(void)
                len = syn_block->b_sst_len - syn_block->b_sst_freecount + 2;
        }
 
-       sstp = (synstate_T *)alloc_clear((unsigned)(len * sizeof(synstate_T)));
+       sstp = (synstate_T *)alloc_clear(len * sizeof(synstate_T));
        if (sstp == NULL)       /* out of memory! */
            return;
 
@@ -5216,7 +5216,7 @@ syn_cmd_region(
            }
            ppp->pp_next = pat_ptrs[item];
            pat_ptrs[item] = ppp;
-           ppp->pp_synp = (synpat_T *)alloc_clear((unsigned)sizeof(synpat_T));
+           ppp->pp_synp = (synpat_T *)alloc_clear(sizeof(synpat_T));
            if (ppp->pp_synp == NULL)
            {
                rest = NULL;
index 6781a18906702346fc9011169fa7f924a1066810..b6ae1b05ad74f25eb97881edc96bd894f253a6ec 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -2789,8 +2789,7 @@ findtag_end:
        match_count = 0;
 
     if (match_count > 0)
-       matches = (char_u **)lalloc((long_u)(match_count * sizeof(char_u *)),
-                                                                       TRUE);
+       matches = (char_u **)alloc(match_count * sizeof(char_u *));
     else
        matches = NULL;
     match_count = 0;
index caa4c857341a89c392809346fcaf89bee41fb5f3..1ceac3ada927c57c7213de989b05ed813d159f2b 100644 (file)
@@ -3925,7 +3925,7 @@ static VTermParserCallbacks parser_fallbacks = {
     static void *
 vterm_malloc(size_t size, void *data UNUSED)
 {
-    return alloc_clear((unsigned) size);
+    return alloc_clear(size);
 }
 
     static void
index 66ad694454b3e73e0cb276794cebe9d43c2d170d..e993afce8c3cfe61ec5f647edebd2a2b58c4c580 100644 (file)
@@ -678,7 +678,7 @@ prop_type_set(typval_T *argvars, int add)
            semsg(_("E969: Property type %s already defined"), name);
            return;
        }
-       prop = (proptype_T *)alloc_clear((int)(sizeof(proptype_T) + STRLEN(name)));
+       prop = (proptype_T *)alloc_clear(sizeof(proptype_T) + STRLEN(name));
        if (prop == NULL)
            return;
        STRCPY(prop->pt_name, name);
index 972880d2697889e2176b83547085cea515c07bb0..9d7c2ca8cb898a73e6d9206fb37ab883bca81e19 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1514,7 +1514,7 @@ clip_copy_modeless_selection(int both UNUSED)
        len *= 2;       /* max. 2 bytes per display cell */
     else if (enc_utf8)
        len *= MB_MAXBYTES;
-    buffer = lalloc((long_u)len, TRUE);
+    buffer = alloc(len);
     if (buffer == NULL)            /* out of memory */
        return;
 
@@ -1897,11 +1897,11 @@ get_input_buf(void)
     garray_T   *gap;
 
     /* We use a growarray to store the data pointer and the length. */
-    gap = (garray_T *)alloc((unsigned)sizeof(garray_T));
+    gap = (garray_T *)alloc(sizeof(garray_T));
     if (gap != NULL)
     {
        /* Add one to avoid a zero size. */
-       gap->ga_data = alloc((unsigned)inbufcount + 1);
+       gap->ga_data = alloc(inbufcount + 1);
        if (gap->ga_data != NULL)
            mch_memmove(gap->ga_data, inbuf, (size_t)inbufcount);
        gap->ga_len = inbufcount;
index ed2cd58fe4feac2a1a4e74e32b16227124ee4c38..6547ee6420c921e476a12bce6d61b7f1b9009f69 100644 (file)
@@ -124,7 +124,7 @@ static void serialize_visualinfo(bufinfo_T *bi, visualinfo_T *info);
 static void unserialize_visualinfo(bufinfo_T *bi, visualinfo_T *info);
 #endif
 
-#define U_ALLOC_LINE(size) lalloc((long_u)(size), FALSE)
+#define U_ALLOC_LINE(size) lalloc(size, FALSE)
 
 /* used in undo_end() to report number of added and deleted lines */
 static long    u_newcount, u_oldcount;
@@ -2013,8 +2013,7 @@ u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
     }
 
 #ifdef U_DEBUG
-    uhp_table_used = (int *)alloc_clear(
-                                    (unsigned)(sizeof(int) * num_head + 1));
+    uhp_table_used = (int *)alloc_clear(sizeof(int) * num_head + 1);
 # define SET_FLAG(j) ++uhp_table_used[j]
 #else
 # define SET_FLAG(j)
index dcf803401ed4011a7780528f7660db9d9f95d761..0c898efe309f2f4b0af4091c92e750bf3b457e10 100644 (file)
@@ -292,10 +292,10 @@ get_lambda_tv(char_u **arg, typval_T *rettv, int evaluate)
 
        sprintf((char*)name, "<lambda>%d", ++lambda_no);
 
-       fp = (ufunc_T *)alloc_clear((unsigned)(sizeof(ufunc_T) + STRLEN(name)));
+       fp = (ufunc_T *)alloc_clear(sizeof(ufunc_T) + STRLEN(name));
        if (fp == NULL)
            goto errret;
-       pt = (partial_T *)alloc_clear((unsigned)sizeof(partial_T));
+       pt = (partial_T *)alloc_clear(sizeof(partial_T));
        if (pt == NULL)
            goto errret;
 
@@ -2580,7 +2580,7 @@ ex_function(exarg_T *eap)
            }
        }
 
-       fp = (ufunc_T *)alloc_clear((unsigned)(sizeof(ufunc_T) + STRLEN(name)));
+       fp = (ufunc_T *)alloc_clear(sizeof(ufunc_T) + STRLEN(name));
        if (fp == NULL)
            goto erret;
 
@@ -2751,14 +2751,13 @@ func_do_profile(ufunc_T *fp)
        profile_zero(&fp->uf_tm_self);
        profile_zero(&fp->uf_tm_total);
        if (fp->uf_tml_count == NULL)
-           fp->uf_tml_count = (int *)alloc_clear(
-                                              (unsigned)(sizeof(int) * len));
+           fp->uf_tml_count = (int *)alloc_clear(sizeof(int) * len);
        if (fp->uf_tml_total == NULL)
            fp->uf_tml_total = (proftime_T *)alloc_clear(
-                                        (unsigned)(sizeof(proftime_T) * len));
+                                                    sizeof(proftime_T) * len);
        if (fp->uf_tml_self == NULL)
            fp->uf_tml_self = (proftime_T *)alloc_clear(
-                                        (unsigned)(sizeof(proftime_T) * len));
+                                                    sizeof(proftime_T) * len);
        fp->uf_tml_idx = -1;
        if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL
                                                    || fp->uf_tml_self == NULL)
index a66b7a5601897fadaa57979b389360396b242825..3653b9b613023b0a032600ba6d574086c47c6bbd 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1386,
 /**/
     1385,
 /**/
index feef18d3c10dfac08844f50160acc5a5a7f9f728..f6f24d103921a88f91d94845b999a84a16688279 100644 (file)
@@ -244,7 +244,7 @@ crnl_to_nl(const char_u *str, int *size)
     char_u     *retp;
 
     /* Avoid allocating zero bytes, it generates an error message. */
-    ret = lalloc((long_u)(str_len == 0 ? 1 : str_len), TRUE);
+    ret = alloc(str_len == 0 ? 1 : str_len);
     if (ret != NULL)
     {
        retp = ret;
index fd732f22d32e56e93028ce395f8210315bb19377..6e02caad660cbb503373698145c6cef7c59b58be 100644 (file)
@@ -1065,7 +1065,7 @@ win_split_ins(
     if (curfrp->fr_parent == NULL || curfrp->fr_parent->fr_layout != layout)
     {
        /* Need to create a new frame in the tree to make a branch. */
-       frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+       frp = (frame_T *)alloc_clear(sizeof(frame_T));
        *frp = *curfrp;
        curfrp->fr_layout = layout;
        frp->fr_parent = curfrp;
@@ -3549,7 +3549,7 @@ win_alloc_firstwin(win_T *oldwin)
     static void
 new_frame(win_T *wp)
 {
-    frame_T *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+    frame_T *frp = (frame_T *)alloc_clear(sizeof(frame_T));
 
     wp->w_frame = frp;
     if (frp != NULL)
@@ -3584,7 +3584,7 @@ alloc_tabpage(void)
 # endif
 
 
-    tp = (tabpage_T *)alloc_clear((unsigned)sizeof(tabpage_T));
+    tp = (tabpage_T *)alloc_clear(sizeof(tabpage_T));
     if (tp == NULL)
        return NULL;
 
@@ -4597,7 +4597,7 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED)
     /*
      * allocate window structure and linesizes arrays
      */
-    new_wp = (win_T *)alloc_clear((unsigned)sizeof(win_T));
+    new_wp = (win_T *)alloc_clear(sizeof(win_T));
     if (new_wp == NULL)
        return NULL;
 
@@ -4898,7 +4898,7 @@ frame_remove(frame_T *frp)
 win_alloc_lines(win_T *wp)
 {
     wp->w_lines_valid = 0;
-    wp->w_lines = (wline_T *)alloc_clear((unsigned)(Rows * sizeof(wline_T)));
+    wp->w_lines = (wline_T *)alloc_clear(Rows * sizeof(wline_T));
     if (wp->w_lines == NULL)
        return FAIL;
     return OK;
@@ -6280,7 +6280,7 @@ make_snapshot(int idx)
     static void
 make_snapshot_rec(frame_T *fr, frame_T **frp)
 {
-    *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+    *frp = (frame_T *)alloc_clear(sizeof(frame_T));
     if (*frp == NULL)
        return;
     (*frp)->fr_layout = fr->fr_layout;