From 1994fd1c73b05760bb18393449c29f78d64fd954 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 13 Dec 2009 16:10:30 -0600 Subject: [PATCH 1/4] fix compiler warning on linux --- vm/code_blocks.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/code_blocks.hpp b/vm/code_blocks.hpp index 8aa8b5693f..075fe389b4 100644 --- a/vm/code_blocks.hpp +++ b/vm/code_blocks.hpp @@ -11,7 +11,7 @@ struct code_block bool free_p() const { - return header & 1 == 1; + return (header & 1) == 1; } code_block_type type() const From 8961b69e20b4a5d679651ed43e8410dc42efc2c6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 13 Dec 2009 16:52:36 -0600 Subject: [PATCH 2/4] windows.dinput.constants: use C type symbols rather than strings --- basis/windows/dinput/constants/constants.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 basis/windows/dinput/constants/constants.factor diff --git a/basis/windows/dinput/constants/constants.factor b/basis/windows/dinput/constants/constants.factor old mode 100644 new mode 100755 index 4e97cb0e01..7e4ad39945 --- a/basis/windows/dinput/constants/constants.factor +++ b/basis/windows/dinput/constants/constants.factor @@ -102,8 +102,8 @@ M: array array-base-type first ; : define-joystick-format-constant ( -- ) c_dfDIJoystick2 [ DIDF_ABSAXIS - "DIJOYSTATE2" heap-size - "DIJOYSTATE2" { + DIJOYSTATE2 heap-size + DIJOYSTATE2 { { GUID_XAxis_malloced "lX" 0 { DIDFT_OPTIONAL DIDFT_AXIS DIDFT_ANYINSTANCE } 0 } { GUID_YAxis_malloced "lY" 0 { DIDFT_OPTIONAL DIDFT_AXIS DIDFT_ANYINSTANCE } 0 } { GUID_ZAxis_malloced "lZ" 0 { DIDFT_OPTIONAL DIDFT_AXIS DIDFT_ANYINSTANCE } 0 } @@ -274,8 +274,8 @@ M: array array-base-type first ; : define-mouse-format-constant ( -- ) c_dfDIMouse2 [ DIDF_RELAXIS - "DIMOUSESTATE2" heap-size - "DIMOUSESTATE2" { + DIMOUSESTATE2 heap-size + DIMOUSESTATE2 { { GUID_XAxis_malloced "lX" 0 { DIDFT_ANYINSTANCE DIDFT_AXIS } 0 } { GUID_YAxis_malloced "lY" 0 { DIDFT_ANYINSTANCE DIDFT_AXIS } 0 } { GUID_ZAxis_malloced "lZ" 0 { DIDFT_OPTIONAL DIDFT_ANYINSTANCE DIDFT_AXIS } 0 } From ffe5fb62caeaf9bc92bac4134bdab9152a9d2493 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 13 Dec 2009 16:52:59 -0600 Subject: [PATCH 3/4] vm/os-windows-nt.cpp: fix formatting --- vm/os-windows-nt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 796834a9c4..69df5f666f 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -3,8 +3,9 @@ namespace factor { -THREADHANDLE start_thread(void *(*start_routine)(void *),void *args){ - return (void*) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, args, 0, 0); +THREADHANDLE start_thread(void *(*start_routine)(void *), void *args) +{ + return (void *)CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, args, 0, 0); } DWORD dwTlsIndex; @@ -47,7 +48,7 @@ u64 nano_count() ret = QueryPerformanceFrequency(&frequency); if(ret == 0) fatal_error("QueryPerformanceFrequency", 0); - + return count.QuadPart*(1000000000/frequency.QuadPart); } From f749d14e86a7ef0139942619cdbd580a3e4a1423 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 13 Dec 2009 20:00:02 -0600 Subject: [PATCH 4/4] fix a couple of warnings on win64 --- vm/code_heap.cpp | 2 +- vm/os-windows-nt.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vm/code_heap.cpp b/vm/code_heap.cpp index b7aa9185e8..9e64ff6552 100755 --- a/vm/code_heap.cpp +++ b/vm/code_heap.cpp @@ -5,7 +5,7 @@ namespace factor code_heap::code_heap(cell size) { - if(size > (1L << (sizeof(cell) * 8 - 6))) fatal_error("Heap too large",size); + if(size > ((u64)1 << (sizeof(cell) * 8 - 6))) fatal_error("Heap too large",size); seg = new segment(align_page(size),true); if(!seg) fatal_error("Out of memory in heap allocator",size); allocator = new free_list_allocator(size,seg->start); diff --git a/vm/os-windows-nt.hpp b/vm/os-windows-nt.hpp index 5b55ce1f2b..f8407aeee5 100755 --- a/vm/os-windows-nt.hpp +++ b/vm/os-windows-nt.hpp @@ -23,8 +23,13 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe); // SSE traps raise these exception codes, which are defined in internal NT headers // but not winbase.h +#ifndef STATUS_FLOAT_MULTIPLE_FAULTS #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4 +#endif + +#ifndef STATUS_FLOAT_MULTIPLE_TRAPS #define STATUS_FLOAT_MULTIPLE_TRAPS 0xC00002B5 +#endif typedef HANDLE THREADHANDLE;