diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-31 00:49:17 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-06-16 01:40:28 -0300 |
commit | 3cb3c20b7451ef4a7bc857026e2bc28b171fbb0f (patch) | |
tree | 889602c0ddd1d647e51f0010605bdc973738696e /src/nvim/eval.c | |
parent | f4002c97dc36e817a59b5e18c852d1a17e775c1c (diff) | |
download | rneovim-3cb3c20b7451ef4a7bc857026e2bc28b171fbb0f.tar.gz rneovim-3cb3c20b7451ef4a7bc857026e2bc28b171fbb0f.tar.bz2 rneovim-3cb3c20b7451ef4a7bc857026e2bc28b171fbb0f.zip |
Fix some "out of memory" comments and few cosmetics
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index faa80ed0fa..8a9f8cbd55 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5150,7 +5150,7 @@ static void list_extend(list_T *l1, list_T *l2, listitem_T *bef) /* * Concatenate lists "l1" and "l2" into a new list, stored in "tv". - * Return FAIL when out of memory. + * Return FAIL on failure to copy. */ static int list_concat(list_T *l1, list_T *l2, typval_T *tv) { @@ -5175,7 +5175,7 @@ static int list_concat(list_T *l1, list_T *l2, typval_T *tv) * Make a copy of list "orig". Shallow if "deep" is FALSE. * The refcount of the new list is set to 1. * See item_copy() for "copyID". - * Returns NULL when out of memory. + * Returns NULL if orig is NULL or some failure happens. */ static list_T *list_copy(list_T *orig, int deep, int copyID) { @@ -5721,7 +5721,7 @@ void dictitem_free(dictitem_T *item) * Make a copy of dict "d". Shallow if "deep" is FALSE. * The refcount of the new dict is set to 1. * See item_copy() for "copyID". - * Returns NULL when out of memory. + * Returns NULL if orig is NULL or some other failure. */ static dict_T *dict_copy(dict_T *orig, int deep, int copyID) { @@ -5865,7 +5865,7 @@ dictitem_T *dict_find(dict_T *d, char_u *key, int len) /* * Get a string item from a dictionary. * When "save" is TRUE allocate memory for it. - * Returns NULL if the entry doesn't exist or out of memory. + * Returns NULL if the entry doesn't exist or some other failure. */ char_u *get_dict_string(dict_T *d, char_u *key, int save) { @@ -5883,13 +5883,11 @@ char_u *get_dict_string(dict_T *d, char_u *key, int save) /* * Get a number item from a dictionary. - * Returns 0 if the entry doesn't exist or out of memory. + * Returns 0 if the entry doesn't exist. */ long get_dict_number(dict_T *d, char_u *key) { - dictitem_T *di; - - di = dict_find(d, key, -1); + dictitem_T *di = dict_find(d, key, -1); if (di == NULL) return 0; return get_tv_number(&di->di_tv); @@ -17436,7 +17434,7 @@ static void func_do_profile(ufunc_T *fp) fp->uf_tml_idx = -1; if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL || fp->uf_tml_self == NULL) - return; /* out of memory */ + return; fp->uf_profiling = TRUE; } |