diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-23 14:45:33 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-23 14:45:33 +0400 |
commit | 18ce6f0c60f1125c5344d9fd8e90e5ea2941bf01 (patch) | |
tree | eb79d0b925375a19aae1f7e88323621990c72150 /src/mem_pool.c | |
parent | 80e9384ebfaca000eb7f0693a466795f51e3f29d (diff) | |
download | rspamd-18ce6f0c60f1125c5344d9fd8e90e5ea2941bf01.tar.gz rspamd-18ce6f0c60f1125c5344d9fd8e90e5ea2941bf01.zip |
* Fix compatibility issues
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r-- | src/mem_pool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c index 363116ce5..8d5c22ad1 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -83,7 +83,7 @@ pool_chain_new_shared (memory_pool_ssize_t size) struct _pool_chain_shared *chain; #if defined(HAVE_MMAP_ANON) - chain = mmap (NULL, size + sizeof (struct _pool_chain_shared), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + chain = (struct _pool_chain_shared *)mmap (NULL, size + sizeof (struct _pool_chain_shared), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); g_assert (chain != MAP_FAILED); chain->begin = ((u_char *) chain) + sizeof (struct _pool_chain_shared); g_assert (chain->begin != MAP_FAILED); @@ -94,7 +94,7 @@ pool_chain_new_shared (memory_pool_ssize_t size) if (fd == -1) { return NULL; } - chain = mmap (NULL, size + sizeof (struct _pool_chain_shared), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + chain = (struct _pool_chain_shared *)mmap (NULL, size + sizeof (struct _pool_chain_shared), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); g_assert (chain != MAP_FAILED); chain->begin = ((u_char *) chain) + sizeof (struct _pool_chain_shared); g_assert (chain->begin != MAP_FAILED); @@ -127,14 +127,14 @@ memory_pool_new (memory_pool_ssize_t size) /* Allocate statistic structure if it is not allocated before */ if (mem_pool_stat == NULL) { #if defined(HAVE_MMAP_ANON) - mem_pool_stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + mem_pool_stat = (memory_pool_stat_t *)mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); g_assert (stat != MAP_FAILED); #elif defined(HAVE_MMAP_ZERO) int fd; fd = open ("/dev/zero", O_RDWR); g_assert (fd != -1); - mem_pool_stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + mem_pool_stat = (memory_pool_stat_t *)mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); g_assert (chain != MAP_FAILED); #else # error No mmap methods are defined @@ -474,7 +474,7 @@ memory_pool_delete (memory_pool_t * pool) while (cur_shared) { tmp_shared = cur_shared; cur_shared = cur_shared->next; - munmap (tmp_shared, tmp_shared->len + sizeof (struct _pool_chain_shared)); + munmap ((void *)tmp_shared, tmp_shared->len + sizeof (struct _pool_chain_shared)); STAT_LOCK (); mem_pool_stat->chunks_freed++; STAT_UNLOCK (); |