} 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) {
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)
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)]);
}
}
# endif
- if (old_handler == (SIG_HNDLR_PTR)SIG_DFL) {
+ if (old_handler == (SIG_HNDLR_PTR)(signed_word)SIG_DFL) {
# if !defined(MSWIN32) && !defined(MSWINCE)
ABORT_ARG1("Unexpected bus error or segmentation fault",
" at %p", (void *)addr);
((SIG_HNDLR_PTR)old_handler) (sig, si, raw_sc);
else
/* FIXME: should pass nonstandard args as well. */
- ((PLAIN_HNDLR_PTR)old_handler) (sig);
+ ((PLAIN_HNDLR_PTR)(signed_word)old_handler)(sig);
return;
# endif
}
GC_old_segv_handler = oldact.sa_sigaction;
GC_old_segv_handler_used_si = TRUE;
} else {
- GC_old_segv_handler = (SIG_HNDLR_PTR)oldact.sa_handler;
+ GC_old_segv_handler = (SIG_HNDLR_PTR)(signed_word)oldact.sa_handler;
GC_old_segv_handler_used_si = FALSE;
}
- if (GC_old_segv_handler == (SIG_HNDLR_PTR)SIG_IGN) {
+ if (GC_old_segv_handler == (SIG_HNDLR_PTR)(signed_word)SIG_IGN) {
WARN("Previously ignored segmentation violation!?\n", 0);
- GC_old_segv_handler = (SIG_HNDLR_PTR)SIG_DFL;
+ GC_old_segv_handler = (SIG_HNDLR_PTR)(signed_word)SIG_DFL;
}
- if (GC_old_segv_handler != (SIG_HNDLR_PTR)SIG_DFL) {
+ if (GC_old_segv_handler != (SIG_HNDLR_PTR)(signed_word)SIG_DFL) {
GC_VERBOSE_LOG_PRINTF("Replaced other SIGSEGV handler\n");
}
# if defined(HPUX) || defined(LINUX) || defined(HURD) \
GC_old_bus_handler_used_si = TRUE;
# endif
} else {
- GC_old_bus_handler = (SIG_HNDLR_PTR)oldact.sa_handler;
+ GC_old_bus_handler = (SIG_HNDLR_PTR)(signed_word)oldact.sa_handler;
# if !defined(LINUX)
GC_old_bus_handler_used_si = FALSE;
# endif
}
- if (GC_old_bus_handler == (SIG_HNDLR_PTR)SIG_IGN) {
+ if (GC_old_bus_handler == (SIG_HNDLR_PTR)(signed_word)SIG_IGN) {
WARN("Previously ignored bus error!?\n", 0);
# if !defined(LINUX)
- GC_old_bus_handler = (SIG_HNDLR_PTR)SIG_DFL;
+ GC_old_bus_handler = (SIG_HNDLR_PTR)(signed_word)SIG_DFL;
# else
/* GC_old_bus_handler is not used by GC_write_fault_handler. */
# endif
- } else if (GC_old_bus_handler != (SIG_HNDLR_PTR)SIG_DFL) {
+ } else if (GC_old_bus_handler != (SIG_HNDLR_PTR)(signed_word)SIG_DFL) {
GC_VERBOSE_LOG_PRINTF("Replaced other SIGBUS handler\n");
}
# endif /* HPUX || LINUX || HURD || (FREEBSD && SUNOS5SIGS) */
if (GC_old_segv_handler != NULL) {
GC_COND_LOG_PRINTF("Replaced other UnhandledExceptionFilter\n");
} else {
- GC_old_segv_handler = SIG_DFL;
+ GC_old_segv_handler = (signed_word)SIG_DFL;
}
# elif defined(MSWINCE)
/* MPROTECT_VDB is unsupported for WinCE at present. */
/* sa.sa_restorer is deprecated and should not be initialized. */
if (sigaction(SIGBUS, &sa, &oldsa) < 0)
ABORT("sigaction failed");
- if ((SIG_HNDLR_PTR)oldsa.sa_handler != SIG_DFL) {
+ if (oldsa.sa_handler != (SIG_HNDLR_PTR)(signed_word)SIG_DFL) {
GC_VERBOSE_LOG_PRINTF("Replaced other SIGBUS handler\n");
}
}