aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memfile.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-10-24 15:22:48 +0200
committerEliseo Martínez <eliseomarmol@gmail.com>2014-11-06 22:53:42 +0100
commit96e7f229a5d7d5461c7518802f298cab47017a77 (patch)
tree544461c548a242bff1f41a6e466da02e05478202 /src/nvim/memfile.c
parent844d64e9ff55336e803c43d9411bb76c19173dba (diff)
downloadrneovim-96e7f229a5d7d5461c7518802f298cab47017a77.tar.gz
rneovim-96e7f229a5d7d5461c7518802f298cab47017a77.tar.bz2
rneovim-96e7f229a5d7d5461c7518802f298cab47017a77.zip
Review: Remove long_u: memfile: Refactor: bhdr_T.bh_data: char_u* -> void*.
This, in addition to being more correct, allows removing a lot of explicit casts.
Diffstat (limited to 'src/nvim/memfile.c')
-rw-r--r--src/nvim/memfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index 6061ed363b..a6fcdcfbeb 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -292,7 +292,7 @@ bhdr_T *mf_new(memfile_T *mfp, int negative, unsigned page_count)
freep->bh_bnum += page_count;
freep->bh_page_count -= page_count;
} else if (hp == NULL) { // need to allocate memory for this block
- char_u *p = xmalloc(mfp->mf_page_size * page_count);
+ void *p = xmalloc(mfp->mf_page_size * page_count);
hp = mf_rem_free(mfp);
hp->bh_data = p;
} else { // use the number, remove entry from free list
@@ -320,7 +320,7 @@ bhdr_T *mf_new(memfile_T *mfp, int negative, unsigned 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)memset((char *)(hp->bh_data), 0, mfp->mf_page_size * page_count);
+ (void)memset(hp->bh_data, 0, mfp->mf_page_size * page_count);
return hp;
}
@@ -796,7 +796,7 @@ static int mf_write(memfile_T *mfp, bhdr_T *hp)
static int mf_write_block(memfile_T *mfp, bhdr_T *hp,
off_t offset, unsigned size)
{
- char_u *data = hp->bh_data;
+ void *data = hp->bh_data;
int result = OK;
if ((unsigned)write_eintr(mfp->mf_fd, data, size) != size)
result = FAIL;