diff --git a/vm/os-genunix.hpp b/vm/os-genunix.hpp index 626d399a27..ff5d29ecd7 100644 --- a/vm/os-genunix.hpp +++ b/vm/os-genunix.hpp @@ -10,7 +10,7 @@ void early_init(); const char *vm_executable_path(); const char *default_image_path(); -inline static cell align_stack_pointer(cell sp) +template Type align_stack_pointer(Type sp) { return sp; } diff --git a/vm/os-macosx-ppc.hpp b/vm/os-macosx-ppc.hpp index 70fa18142a..30fd4b2081 100644 --- a/vm/os-macosx-ppc.hpp +++ b/vm/os-macosx-ppc.hpp @@ -62,7 +62,7 @@ inline static unsigned int uap_fpu_status(void *uap) return mach_fpu_status(UAP_FS(uap)); } -inline static cell align_stack_pointer(cell sp) +template Type align_stack_pointer(Type sp) { return sp; } diff --git a/vm/os-macosx-x86.32.hpp b/vm/os-macosx-x86.32.hpp index 4bdc68ff72..a6fe8e2703 100644 --- a/vm/os-macosx-x86.32.hpp +++ b/vm/os-macosx-x86.32.hpp @@ -64,9 +64,9 @@ inline static unsigned int uap_fpu_status(void *uap) return mach_fpu_status(UAP_FS(uap)); } -inline static cell align_stack_pointer(cell sp) +template Type align_stack_pointer(Type sp) { - return ((sp + 4) & ~15) - 4; + return (Type)((((cell)sp + 4) & ~15) - 4); } inline static void mach_clear_fpu_status(i386_float_state_t *float_state) diff --git a/vm/os-macosx-x86.64.hpp b/vm/os-macosx-x86.64.hpp index b923674cd1..cb1980ddbf 100644 --- a/vm/os-macosx-x86.64.hpp +++ b/vm/os-macosx-x86.64.hpp @@ -62,9 +62,9 @@ inline static unsigned int uap_fpu_status(void *uap) return mach_fpu_status(UAP_FS(uap)); } -inline static cell align_stack_pointer(cell sp) +template Type align_stack_pointer(Type sp) { - return ((sp + 8) & ~15) - 8; + return (Type)((((cell)sp + 8) & ~15) - 8); } inline static void mach_clear_fpu_status(x86_float_state64_t *float_state) diff --git a/vm/os-unix.cpp b/vm/os-unix.cpp index 0f2570b183..cd88541136 100644 --- a/vm/os-unix.cpp +++ b/vm/os-unix.cpp @@ -127,7 +127,7 @@ void factor_vm::dispatch_signal(void *uap, void (handler)()) else signal_callstack_top = NULL; - UAP_STACK_POINTER(uap) = (void *)align_stack_pointer((cell)UAP_STACK_POINTER(uap)); + UAP_STACK_POINTER(uap) = align_stack_pointer(UAP_STACK_POINTER(uap)); UAP_PROGRAM_COUNTER(uap) = (cell)handler; } diff --git a/vm/vm.hpp b/vm/vm.hpp index 4b115ecd3f..2c85b8ec49 100755 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -694,7 +694,7 @@ struct factor_vm LONG exception_handler(PEXCEPTION_POINTERS pe); #endif #else // UNIX - void factor_vm::dispatch_signal(void *uap, void (handler)()); + void dispatch_signal(void *uap, void (handler)()); #endif #ifdef __APPLE__