aboutsummaryrefslogtreecommitdiff
path: root/src/memfile.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-03-24 20:30:14 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-25 18:57:02 -0300
commited3e9d51ac2fd2a24d244796dd9cebfe0a19bc6d (patch)
treeecb1f753dd0fad9889aca15a083c7c99c1407ba7 /src/memfile.c
parent68bc6bce2923f049f84d919aea24600f18139a46 (diff)
downloadrneovim-ed3e9d51ac2fd2a24d244796dd9cebfe0a19bc6d.tar.gz
rneovim-ed3e9d51ac2fd2a24d244796dd9cebfe0a19bc6d.tar.bz2
rneovim-ed3e9d51ac2fd2a24d244796dd9cebfe0a19bc6d.zip
Use memset instead of vim_memset
Ran some commands on terminal, reviewed changes, and made some manual changes too. find src | xargs perl -i -p -e "s/vim_memset/memset/g" git grep -l memset | egrep "\.c$" | xargs perl -i -p -e \ 's/(#include "vim\.h")/#include <string.h>\n\n\1/g'
Diffstat (limited to 'src/memfile.c')
-rw-r--r--src/memfile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/memfile.c b/src/memfile.c
index 714a64fb6f..ffa92bfffe 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -32,6 +32,8 @@
* file is opened.
*/
+#include <string.h>
+
#include "vim.h"
#include "memfile.h"
#include "fileio.h"
@@ -372,7 +374,7 @@ bhdr_T *mf_new(memfile_T *mfp, int negative, int page_count)
* Init the data to all zero, to avoid reading uninitialized data.
* This also avoids that the passwd file ends up in the swap file!
*/
- (void)vim_memset((char *)(hp->bh_data), 0,
+ (void)memset((char *)(hp->bh_data), 0,
(size_t)mfp->mf_page_size * page_count);
return hp;
@@ -1151,7 +1153,7 @@ mf_do_open (
*/
static void mf_hash_init(mf_hashtab_T *mht)
{
- vim_memset(mht, 0, sizeof(mf_hashtab_T));
+ memset(mht, 0, sizeof(mf_hashtab_T));
mht->mht_buckets = mht->mht_small_buckets;
mht->mht_mask = MHT_INIT_SIZE - 1;
}
@@ -1284,7 +1286,7 @@ static int mf_hash_grow(mf_hashtab_T *mht)
* a power of two.
*/
- vim_memset(tails, 0, sizeof(tails));
+ memset(tails, 0, sizeof(tails));
for (mhi = mht->mht_buckets[i]; mhi != NULL; mhi = mhi->mhi_next) {
j = (mhi->mhi_key >> shift) & (MHT_GROWTH_FACTOR - 1);