]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: fix compilation
authorSlava Pestov <slava@factorcode.org>
Thu, 22 Oct 2009 10:38:02 +0000 (06:38 -0400)
committerSlava Pestov <slava@factorcode.org>
Thu, 22 Oct 2009 10:38:02 +0000 (06:38 -0400)
vm/os-genunix.hpp
vm/os-macosx-ppc.hpp
vm/os-macosx-x86.32.hpp
vm/os-macosx-x86.64.hpp
vm/os-unix.cpp
vm/vm.hpp

index 626d399a275ceb75c7492d693c8e00b7ea881867..ff5d29ecd715169681fa809244d71e5e697ba7c1 100644 (file)
@@ -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<typename Type> Type align_stack_pointer(Type sp)
 {
        return sp;
 }
index 70fa18142acd2e1dc7c08a86886453c0be33f8f0..30fd4b2081bc9624dd553a668688673894518afe 100644 (file)
@@ -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<typename Type> Type align_stack_pointer(Type sp)
 {
        return sp;
 }
index 4bdc68ff7214d3d9a2b8a7d5b15689bc8e77826f..a6fe8e27034d255056171e840882acb8da66c424 100644 (file)
@@ -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<typename Type> 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)
index b923674cd1da218a6afad5a070487a429ed36cc5..cb1980ddbf66cb0056ebe9e29cb174d0fb508044 100644 (file)
@@ -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<typename Type> 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)
index 0f2570b1836ea21b60d51a3ce5f39cff07fc4db7..cd885411369fc83c6b4715e4f349b60442edca82 100644 (file)
@@ -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;
 }
 
index 4b115ecd3f6749beeb70ae94f8ef6d50937ab1ee..2c85b8ec490dd15f626cf009972e79de29e7e49d 100755 (executable)
--- 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__