diff --git a/src/cache/cache.c b/src/cache/cache.c index 50e460fe5..63a7e24b8 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -298,7 +298,7 @@ enlarge_entry(struct cache_entry *cached, off_t size) static struct fragment * frag_alloc(size_t size) { - struct fragment *f = mem_mmap_alloc(FRAGSIZE(size)); + struct fragment *f = (struct fragment *)mem_mmap_alloc(FRAGSIZE(size)); if (!f) return NULL; memset(f, 0, FRAGSIZE(size)); @@ -308,7 +308,7 @@ frag_alloc(size_t size) static struct fragment * frag_realloc(struct fragment *f, size_t size) { - return mem_mmap_realloc(f, FRAGSIZE(f->real_length), FRAGSIZE(size)); + return (struct fragment *)mem_mmap_realloc(f, FRAGSIZE(f->real_length), FRAGSIZE(size)); } static void diff --git a/src/protocol/bittorrent/piececache.c b/src/protocol/bittorrent/piececache.c index 96fa2adec..e4385e23d 100644 --- a/src/protocol/bittorrent/piececache.c +++ b/src/protocol/bittorrent/piececache.c @@ -713,7 +713,7 @@ bittorrent_file_piece_translation(struct bittorrent_meta *meta, if (trans == BITTORRENT_READ) { assert(!entry->data); - entry->data = mem_mmap_alloc(piece_length); + entry->data = (char *)mem_mmap_alloc(piece_length); if (!entry->data) return BITTORRENT_STATE_OUT_OF_MEM; } @@ -904,7 +904,7 @@ add_to_bittorrent_piece_cache(struct bittorrent_peer_connection *peer, piece_length = get_bittorrent_piece_length(meta, piece); if (!entry->data) { - entry->data = mem_mmap_alloc(piece_length); + entry->data = (char *)mem_mmap_alloc(piece_length); if (!entry->data) { add_request_to_bittorrent_piece_cache(peer->bittorrent, request); return BITTORRENT_STATE_OK;