mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[mem_mmap_alloc] cast
This commit is contained in:
parent
23f1a7cdce
commit
022a066201
4
src/cache/cache.c
vendored
4
src/cache/cache.c
vendored
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user