[project @ 2000-07-07 10:35:32 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgTypes.h
index 19e377c..e6b87f9 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.8 2000/04/04 13:40:27 panne Exp $
+ * $Id: StgTypes.h,v 1.12 2000/06/12 11:04:12 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -17,7 +17,7 @@
        StgInt                  Signed version of StgWord
        StgAddr                 Generic address type
        
-
+ * WARNING: Keep this file and HsFFI.h in synch!
  *
  * ---------------------------------------------------------------------------*/
 
@@ -112,7 +112,7 @@ typedef StgWord            StgOffset;        /* byte offset within closure */
                            
 typedef struct StgTSO_*    StgTSOPtr;
 
-typedef void *             StgForeignPtr;
+typedef void*              StgForeignPtr;
 
 typedef StgInt             StgStackOffset;   /* offset in words! */
 
@@ -130,8 +130,12 @@ typedef StgWord64         LW_;
 /* Stable Pointers:  A stable pointer is represented as an index into
  * the stable pointer table in the low 24 bits with a weight in the
  * upper 8 bits.
+ * SUP: StgStablePtr used to be a synonym for StgWord, but stable pointers
+ * are guaranteed to be void* on the C-side, so we have to do some occasional
+ * casting. Size is not a matter, because StgWord is always the same size as
+ * a void*.
  */
-typedef StgWord            StgStablePtr;
+typedef void*             StgStablePtr;
 
 #define STABLEPTR_WEIGHT_MASK   ((StgWord)0xff << ((sizeof(StgWord)-1) * BITS_PER_BYTE))
 #define STABLEPTR_WEIGHT_SHIFT  (BITS_IN(StgWord) - 8)
@@ -156,7 +160,7 @@ typedef StgFunPtr StgFun(void);
 typedef union {
     StgWord        w;
     StgAddr        a;
-    StgChar        c;
+    StgWord        c;
     StgFloat       f;
     StgInt         i;
     StgPtr         p;
@@ -194,5 +198,4 @@ typedef StgClosurePtr   L_;
 
 #define stgCast(ty,e) ((ty)(e))
 
-#endif STGTYPES_H
-
+#endif /* STGTYPES_H */