diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-06-04 23:04:17 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-06-04 23:04:17 +0300 |
commit | 0fa40a7127129321a69719dcb8b8b38bf44c1982 (patch) | |
tree | eef6abfc705119e1d3e0ef7b1ab62508ec0acdb3 /cord | |
parent | 20193940e91019398b6c557b748660700dbd66ef (diff) | |
download | bdwgc-0fa40a7127129321a69719dcb8b8b38bf44c1982.tar.gz |
Eliminate 'cast between incompatible function types' compiler warning
* cord/cordxtra.c (refill_cache): Add GC_CALLBACK; change return type
from char to void*; change argument type from refill_data* to void*;
add necessary casts to client_data and the return expression.
* cord/cordxtra.c (CORD_lf_func): Do not cast refill_cache.
* os_dep.c [MPROTECT_VDB] (GC_write_fault_handler,
GC_mprotect_dirty_init): Cast SIG_DFL, SIG_IGN and oldact.sa_handler
to SIG_HNDLR_PTR via signed_word type.
* os_dep.c [MPROTECT_VDB && !MSWIN32 && !MSWINCE]
(GC_write_fault_handler): Cast old_handler to PLAIN_HNDLR_PTR via
signed_word type.
Diffstat (limited to 'cord')
-rw-r--r-- | cord/cordxtra.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cord/cordxtra.c b/cord/cordxtra.c index d29f3444..62b1f830 100644 --- a/cord/cordxtra.c +++ b/cord/cordxtra.c @@ -527,14 +527,14 @@ typedef struct { } refill_data; /* Executed with allocation lock. */ -static char refill_cache(refill_data * client_data) +static void * GC_CALLBACK refill_cache(void * client_data) { - lf_state * state = client_data -> state; - size_t file_pos = client_data -> file_pos; + lf_state * state = ((refill_data *)client_data) -> state; + size_t file_pos = ((refill_data *)client_data) -> file_pos; FILE *f = state -> lf_file; size_t line_start = LINE_START(file_pos); size_t line_no = DIV_LINE_SZ(MOD_CACHE_SZ(file_pos)); - cache_line * new_cache = client_data -> new_cache; + cache_line * new_cache = ((refill_data *)client_data) -> new_cache; if (line_start != state -> lf_current && fseek(f, (long)line_start, SEEK_SET) != 0) { @@ -550,7 +550,7 @@ static char refill_cache(refill_data * client_data) GC_end_stubborn_change((/* no volatile */ void *)(state -> lf_cache + line_no)); state -> lf_current = line_start + LINE_SZ; - return(new_cache->data[MOD_LINE_SZ(file_pos)]); + return (void *)((GC_word)new_cache->data[MOD_LINE_SZ(file_pos)]); } char CORD_lf_func(size_t i, void * client_data) @@ -568,8 +568,7 @@ char CORD_lf_func(size_t i, void * client_data) rd.file_pos = i; rd.new_cache = GC_NEW_ATOMIC(cache_line); if (rd.new_cache == 0) OUT_OF_MEMORY; - return((char)(GC_word) - GC_call_with_alloc_lock((GC_fn_type) refill_cache, &rd)); + return (char)((GC_word)GC_call_with_alloc_lock(refill_cache, &rd)); } return(cl -> data[MOD_LINE_SZ(i)]); } |