]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: fix compile warnings on Windows and add /WX to Nmakefile to report warnings as...
authorSlava Pestov <slava@factorcode.org>
Thu, 17 Jun 2010 05:48:39 +0000 (01:48 -0400)
committerSlava Pestov <slava@factorcode.org>
Thu, 17 Jun 2010 05:48:39 +0000 (01:48 -0400)
Nmakefile
vm/contexts.cpp
vm/gc_info.cpp
vm/gc_info.hpp

index a8b7e103ec21b312b3d862cc57a65671a615c3fb..5297e491713e2f482add4e0821095fbf6208c133 100755 (executable)
--- 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
index 8ec3363662652c3c194d4d3b9f4be7668f97d6e8..8359e09307057aac03a7f3ed02de9a98219568f4 100644 (file)
@@ -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;
                        }
                }
        }
index b937d0a6effdd6d1579fd3546a8017a8410ea730..9a3252aa2cdcfff4c4dcea357109ce204e85b92d 100644 (file)
@@ -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;
index d5229a19a5584414dba78a89b5de02cba555229b..dbbe11b9d79c52caac342defd6b7d582c1a2e66a 100644 (file)
@@ -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()
        {