From 3d5c3935ad8b31c8052e381ac84d9e19f582dac9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 22 Oct 2009 06:38:02 -0400 Subject: [PATCH] vm: fix compilation --- vm/os-genunix.hpp | 2 +- vm/os-macosx-ppc.hpp | 2 +- vm/os-macosx-x86.32.hpp | 4 ++-- vm/os-macosx-x86.64.hpp | 4 ++-- vm/os-unix.cpp | 2 +- vm/vm.hpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) 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__