From 4aa644a2561fb100f0b80a6a2094f8707ad5f919 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 17 Jun 2010 01:48:39 -0400 Subject: [PATCH 1/3] vm: fix compile warnings on Windows and add /WX to Nmakefile to report warnings as errors so that mason can catch these in the future --- Nmakefile | 2 +- vm/contexts.cpp | 8 ++++---- vm/gc_info.cpp | 2 +- vm/gc_info.hpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Nmakefile b/Nmakefile index a8b7e103ec..5297e49171 100755 --- a/Nmakefile +++ b/Nmakefile @@ -5,7 +5,7 @@ BOOTIMAGE_VERSION = latest !IF DEFINED(PLATFORM) LINK_FLAGS = /nologo shell32.lib -CL_FLAGS = /nologo /O2 /W3 /D_CRT_SECURE_NO_WARNINGS +CL_FLAGS = /nologo /O2 /WX /W3 /D_CRT_SECURE_NO_WARNINGS !IF DEFINED(DEBUG) LINK_FLAGS = $(LINK_FLAGS) /DEBUG diff --git a/vm/contexts.cpp b/vm/contexts.cpp index 8ec3363662..8359e09307 100644 --- a/vm/contexts.cpp +++ b/vm/contexts.cpp @@ -62,14 +62,14 @@ void context::scrub_stacks(gc_info *info, cell index) { cell base = info->scrub_d_base(index); - for(cell loc = 0; loc < info->scrub_d_count; loc++) + for(int loc = 0; loc < info->scrub_d_count; loc++) { if(bitmap_p(bitmap,base + loc)) { #ifdef DEBUG_GC_MAPS std::cout << "scrubbing datastack location " << loc << std::endl; #endif - ((cell *)datastack)[-loc] = 0; + *((cell *)datastack - loc) = 0; } } } @@ -77,14 +77,14 @@ void context::scrub_stacks(gc_info *info, cell index) { cell base = info->scrub_r_base(index); - for(cell loc = 0; loc < info->scrub_r_count; loc++) + for(int loc = 0; loc < info->scrub_r_count; loc++) { if(bitmap_p(bitmap,base + loc)) { #ifdef DEBUG_GC_MAPS std::cout << "scrubbing retainstack location " << loc << std::endl; #endif - ((cell *)retainstack)[-loc] = 0; + *((cell *)retainstack - loc) = 0; } } } diff --git a/vm/gc_info.cpp b/vm/gc_info.cpp index b937d0a6ef..9a3252aa2c 100644 --- a/vm/gc_info.cpp +++ b/vm/gc_info.cpp @@ -7,7 +7,7 @@ int gc_info::return_address_index(cell return_address) { u32 *return_address_array = return_addresses(); - for(cell i = 0; i < return_address_count; i++) + for(int i = 0; i < return_address_count; i++) { if(return_address == return_address_array[i]) return i; diff --git a/vm/gc_info.hpp b/vm/gc_info.hpp index d5229a19a5..dbbe11b9d7 100644 --- a/vm/gc_info.hpp +++ b/vm/gc_info.hpp @@ -2,10 +2,10 @@ namespace factor { struct gc_info { - u32 scrub_d_count; - u32 scrub_r_count; - u32 gc_root_count; - u32 return_address_count; + int scrub_d_count; + int scrub_r_count; + int gc_root_count; + int return_address_count; cell total_bitmap_size() { From 174463e156a550a198aa54580e594efa5140e836 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 17 Jun 2010 01:04:03 -0500 Subject: [PATCH 2/3] vm: fix another compile warning on 32-bit Windows --- vm/slot_visitor.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 vm/slot_visitor.hpp diff --git a/vm/slot_visitor.hpp b/vm/slot_visitor.hpp old mode 100644 new mode 100755 index 4223f94a57..d4479ee102 --- a/vm/slot_visitor.hpp +++ b/vm/slot_visitor.hpp @@ -303,14 +303,14 @@ struct call_frame_slot_visitor { cell base = info->spill_slot_base(index); cell *stack_pointer = (cell *)(parent->frame_successor(frame) + 1); - for(cell spill_slot = 0; spill_slot < info->gc_root_count; spill_slot++) + for(int spill_slot = 0; spill_slot < info->gc_root_count; spill_slot++) { if(bitmap_p(bitmap,base + spill_slot)) { #ifdef DEBUG_GC_MAPS std::cout << "visiting spill slot " << spill_slot << std::endl; #endif - visitor->visit_handle(&stack_pointer[spill_slot]); + visitor->visit_handle(stack_pointer + spill_slot); } } } From e34a736b63a6c6cb80fef871e20c6a6d201ae0f4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 16 Jun 2010 23:42:51 -0400 Subject: [PATCH 3/3] tools.disassembler.udis: fix tests on 32-bit Windows --- basis/tools/disassembler/udis/udis-tests.factor | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/basis/tools/disassembler/udis/udis-tests.factor b/basis/tools/disassembler/udis/udis-tests.factor index 522893f368..55e113e1bd 100644 --- a/basis/tools/disassembler/udis/udis-tests.factor +++ b/basis/tools/disassembler/udis/udis-tests.factor @@ -2,7 +2,14 @@ IN: tools.disassembler.udis.tests USING: tools.disassembler.udis tools.test alien.c-types system combinators kernel ; { - { [ cpu x86.32? ] [ [ 604 ] [ ud heap-size ] unit-test ] } + { + [ cpu x86.32? ] + [ + os windows? + [ [ 624 ] [ ud heap-size ] unit-test ] + [ [ 604 ] [ ud heap-size ] unit-test ] if + ] + } { [ cpu x86.64? ] [ [ 672 ] [ ud heap-size ] unit-test ] } [ ] } cond \ No newline at end of file