[project @ 2005-05-05 13:17:47 by simonmar]
[ghc-hetmet.git] / ghc / rts / GCCompact.h
index c709937..6dece4f 100644 (file)
@@ -1,5 +1,4 @@
 /* -----------------------------------------------------------------------------
- * $Id: GCCompact.h,v 1.3 2003/11/12 17:49:07 sof Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -13,7 +12,7 @@ mark(StgPtr p, bdescr *bd)
     nat offset_within_block = p - bd->start; // in words
     StgPtr bitmap_word = (StgPtr)bd->u.bitmap + 
        (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
-    nat bit_mask = 1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+    StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
     *bitmap_word |= bit_mask;
 }
 
@@ -23,17 +22,17 @@ unmark(StgPtr p, bdescr *bd)
     nat offset_within_block = p - bd->start; // in words
     StgPtr bitmap_word = (StgPtr)bd->u.bitmap + 
        (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
-    nat bit_mask = 1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+    StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
     *bitmap_word &= ~bit_mask;
 }
 
-INLINE_HEADER int
+INLINE_HEADER StgWord
 is_marked(StgPtr p, bdescr *bd)
 {
     nat offset_within_block = p - bd->start; // in words
     StgPtr bitmap_word = (StgPtr)bd->u.bitmap + 
        (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
-    nat bit_mask = 1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+    StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
     return (*bitmap_word & bit_mask);
 }