diff options
| author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-03-26 17:31:13 -0300 | 
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-26 18:29:17 -0300 | 
| commit | f8432ef127c0d84bc89ef604dfd6b619acd89c3b (patch) | |
| tree | 9452aa3b53d877517585166c2cebaaef8606c41e /src | |
| parent | 580ababcb5b822aaf938defa38a0ffd5511f0d65 (diff) | |
| download | rneovim-f8432ef127c0d84bc89ef604dfd6b619acd89c3b.tar.gz rneovim-f8432ef127c0d84bc89ef604dfd6b619acd89c3b.tar.bz2 rneovim-f8432ef127c0d84bc89ef604dfd6b619acd89c3b.zip  | |
Use realloc instead of vim_realloc
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 4 | ||||
| -rw-r--r-- | src/file_search.c | 2 | ||||
| -rw-r--r-- | src/garray.c | 2 | ||||
| -rw-r--r-- | src/if_cscope.c | 6 | ||||
| -rw-r--r-- | src/memline.c | 2 | ||||
| -rw-r--r-- | src/misc1.c | 2 | ||||
| -rw-r--r-- | src/normal.c | 2 | ||||
| -rw-r--r-- | src/regexp_nfa.c | 2 | ||||
| -rw-r--r-- | src/vim.h | 3 | 
9 files changed, 11 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c index 793ff30727..eb0a14eaca 100644 --- a/src/eval.c +++ b/src/eval.c @@ -12015,7 +12015,7 @@ static void f_readfile(typval_T *argvars, typval_T *rettv)            /* Change "prev" buffer to be the right size.  This way             * the bytes are only copied once, and very long lines are             * allocated only once.  */ -          if ((s = vim_realloc(prev, prevlen + len + 1)) != NULL) { +          if ((s = realloc(prev, prevlen + len + 1)) != NULL) {              memmove(s + prevlen, start, len);              s[prevlen + len] = NUL;              prev = NULL;             /* the list will own the string */ @@ -12100,7 +12100,7 @@ static void f_readfile(typval_T *argvars, typval_T *rettv)            prevsize = grow50pc > growmin ? grow50pc : growmin;          }          newprev = prev == NULL ? alloc(prevsize) -                  : vim_realloc(prev, prevsize); +                  : realloc(prev, prevsize);          if (newprev == NULL) {            do_outofmem_msg((long_u)prevsize);            failed = TRUE; diff --git a/src/file_search.c b/src/file_search.c index 0c06a4c091..92f2a9b509 100644 --- a/src/file_search.c +++ b/src/file_search.c @@ -386,7 +386,7 @@ vim_findfile_init (          void    *ptr;          helper = walker; -        ptr = vim_realloc(search_ctx->ffsc_stopdirs_v, +        ptr = realloc(search_ctx->ffsc_stopdirs_v,              (dircount + 1) * sizeof(char_u *));          if (ptr)            search_ctx->ffsc_stopdirs_v = ptr; diff --git a/src/garray.c b/src/garray.c index 4113110c77..aba4d5649f 100644 --- a/src/garray.c +++ b/src/garray.c @@ -73,7 +73,7 @@ int ga_grow(garray_T *gap, int n)      new_len = gap->ga_itemsize * (gap->ga_len + n);      pp = (gap->ga_data == NULL)           ? alloc((unsigned)new_len) -         : vim_realloc(gap->ga_data, new_len); +         : realloc(gap->ga_data, new_len);      if (pp == NULL) {        return FAIL; diff --git a/src/if_cscope.c b/src/if_cscope.c index a6229529ea..85633db927 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -1330,7 +1330,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags, struct stat      } else {        /* Reallocate space for more connections. */        csinfo_size *= 2; -      csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size); +      csinfo = realloc(csinfo, sizeof(csinfo_T)*csinfo_size);      }      if (csinfo == NULL)        return -1; @@ -1870,7 +1870,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)      /* hopefully 'num' (num of matches) will be less than 10^16 */      newsize = (int)(strlen(csfmt_str) + 16 + strlen(lno));      if (bufsize < newsize) { -      buf = (char *)vim_realloc(buf, newsize); +      buf = (char *)realloc(buf, newsize);        if (buf == NULL)          bufsize = 0;        else @@ -1891,7 +1891,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)      newsize = (int)(strlen(context) + strlen(cntxformat));      if (bufsize < newsize) { -      buf = (char *)vim_realloc(buf, newsize); +      buf = (char *)realloc(buf, newsize);        if (buf == NULL)          bufsize = 0;        else diff --git a/src/memline.c b/src/memline.c index 6a7686d087..c34e39be6e 100644 --- a/src/memline.c +++ b/src/memline.c @@ -4371,7 +4371,7 @@ static void ml_updatechunk(buf_T *buf, linenr_T line, long len, int updtype)      if (buf->b_ml.ml_usedchunks + 1 >= buf->b_ml.ml_numchunks) {        buf->b_ml.ml_numchunks = buf->b_ml.ml_numchunks * 3 / 2;        buf->b_ml.ml_chunksize = (chunksize_T *) -                               vim_realloc(buf->b_ml.ml_chunksize, +                               realloc(buf->b_ml.ml_chunksize,            sizeof(chunksize_T) * buf->b_ml.ml_numchunks);        if (buf->b_ml.ml_chunksize == NULL) {          /* Hmmmm, Give up on offset for this buffer */ diff --git a/src/misc1.c b/src/misc1.c index 2ca4c80a40..7438d57b0a 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -2417,7 +2417,7 @@ int get_keystroke(void)        /* Need some more space. This might happen when receiving a long         * escape sequence. */        buflen += 100; -      buf = vim_realloc(buf, buflen); +      buf = realloc(buf, buflen);        maxlen = (buflen - 6 - len) / 3;      }      if (buf == NULL) { diff --git a/src/normal.c b/src/normal.c index 6e6875b244..7610520780 100644 --- a/src/normal.c +++ b/src/normal.c @@ -4496,7 +4496,7 @@ static void nv_ident(cmdarg_T *cap)        vim_free(buf);        return;      } -    newbuf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1); +    newbuf = (char_u *)realloc(buf, STRLEN(buf) + STRLEN(p) + 1);      if (newbuf == NULL) {        vim_free(buf);        vim_free(p); diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 5f1aeeaadb..74e2f61e76 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -3963,7 +3963,7 @@ skip_add:          subs = &temp_subs;        } -      l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T)); +      l->t = realloc(l->t, newlen * sizeof(nfa_thread_T));        l->len = newlen;      } @@ -1387,9 +1387,6 @@ typedef int VimClipboard;       /* This is required for the prototypes. */  /* stop using fastcall for Borland */ -/* Note: a NULL argument for vim_realloc() is not portable, don't use it. */ -#define vim_realloc(ptr, size)  realloc((ptr), (size)) -  /*   * The following macros stop display/event loop nesting at the wrong time.   */  | 
