[project @ 1999-07-15 16:11:29 by panne]
authorpanne <unknown>
Thu, 15 Jul 1999 16:11:29 +0000 (16:11 +0000)
committerpanne <unknown>
Thu, 15 Jul 1999 16:11:29 +0000 (16:11 +0000)
We have to be very careful with numeric literals in the C part, in
this case 0xff (of type int = 4 bytes on Alpha) was shifted left 56
times => always zero  :-{  Using an L or UL suffix is not always
practical, because the needed size depends on conditional typedefs
somewhere else. Solution: Cast!  :-P  ghc/includes contains some more
suspicious literals, but I did not have a look at them yet.

ghc/includes/StgTypes.h

index 3470d70..da20c33 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.5 1999/03/02 19:44:21 sof Exp $
+ * $Id: StgTypes.h,v 1.6 1999/07/15 16:11:29 panne Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -132,7 +132,7 @@ typedef StgWord64          LW_;
  */
 typedef StgWord            StgStablePtr;
 
-#define STABLEPTR_WEIGHT_MASK   (0xff << ((sizeof(StgWord)-1) * BITS_PER_BYTE))
+#define STABLEPTR_WEIGHT_MASK   ((StgWord)0xff << ((sizeof(StgWord)-1) * BITS_PER_BYTE))
 #define STABLEPTR_WEIGHT_SHIFT  (BITS_IN(StgWord) - 8)
 
 /*