[project @ 2003-09-12 16:16:43 by sof]
[ghc-hetmet.git] / ghc / rts / RtsAPI.c
index b92794c..3236d1e 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.43 2003/03/18 10:28:15 simonmar Exp $
+ * $Id: RtsAPI.c,v 1.45 2003/08/28 16:33:42 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2001
  *
@@ -29,7 +29,7 @@ rts_mkChar (HsChar c)
 {
   StgClosure *p = (StgClosure *)allocate(CONSTR_sizeW(0,1));
   SET_HDR(p, Czh_con_info, CCS_SYSTEM);
-  p->payload[0]  = (StgClosure *)(StgChar)c;
+  p->payload[0]  = (StgClosure *)(StgWord)(StgChar)c;
   return p;
 }
 
@@ -179,7 +179,6 @@ rts_mkFunPtr (HsFunPtr a)
   return p;
 }
 
-#ifdef COMPILER /* GHC has em, Hugs doesn't */
 HaskellObj
 rts_mkBool (HsBool b)
 {
@@ -195,7 +194,6 @@ rts_mkString (char *s)
 {
   return rts_apply((StgClosure *)unpackCString_closure, rts_mkPtr(s));
 }
-#endif /* COMPILER */
 
 HaskellObj
 rts_apply (HaskellObj f, HaskellObj arg)
@@ -260,7 +258,7 @@ rts_getInt32 (HaskellObj p)
     // See comment above:
     // ASSERT(p->header.info == I32zh_con_info ||
     //        p->header.info == I32zh_static_info);
-    return (HsInt32)(p->payload[0]);
+    return (HsInt32)(HsInt)(p->payload[0]);
 }
 
 HsInt64
@@ -306,7 +304,7 @@ rts_getWord32 (HaskellObj p)
     // See comment above:
     // ASSERT(p->header.info == W32zh_con_info ||
     //        p->header.info == W32zh_static_info);
-    return (HsWord32)(p->payload[0]);
+    return (HsWord32)(HsWord)(p->payload[0]);
 }
 
 
@@ -366,7 +364,6 @@ rts_getFunPtr (HaskellObj p)
     return (void *)(p->payload[0]);
 }
 
-#ifdef COMPILER /* GHC has em, Hugs doesn't */
 HsBool
 rts_getBool (HaskellObj p)
 {
@@ -378,7 +375,6 @@ rts_getBool (HaskellObj p)
     barf("rts_getBool: not a Bool");
   }
 }
-#endif /* COMPILER */
 
 /* ----------------------------------------------------------------------------
    Evaluating Haskell expressions