Fix C/Haskell type mismatches
authorIan Lynagh <igloo@earth.li>
Wed, 4 Apr 2007 00:34:25 +0000 (00:34 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 4 Apr 2007 00:34:25 +0000 (00:34 +0000)
compat/cbits/rawSystem.c
compiler/ghci/ByteCodeGen.lhs
compiler/main/GHC.hs
includes/RtsExternal.h
rts/Schedule.c

index 00b8c49..917594f 100644 (file)
@@ -56,7 +56,7 @@
 /* -------------------- WINDOWS VERSION --------------------- */
 
 HsInt
 /* -------------------- WINDOWS VERSION --------------------- */
 
 HsInt
-rawSystem(HsAddr cmd)
+rawSystem(char *cmd)
 {
   STARTUPINFO sInfo;
   PROCESS_INFORMATION pInfo;
 {
   STARTUPINFO sInfo;
   PROCESS_INFORMATION pInfo;
@@ -90,7 +90,7 @@ rawSystem(HsAddr cmd)
 /* -------------------- UNIX VERSION --------------------- */
 
 HsInt
 /* -------------------- UNIX VERSION --------------------- */
 
 HsInt
-rawSystem(HsAddr cmd, HsAddr args)
+rawSystem(char *cmd, char **args)
 {
     int pid;
     int wstat;
 {
     int pid;
     int wstat;
index 0c668b9..72586ab 100644 (file)
@@ -50,7 +50,7 @@ import Constants
 import Data.List       ( intersperse, sortBy, zip4, zip6, partition )
 import Foreign         ( Ptr, castPtr, mallocBytes, pokeByteOff, Word8,
                          withForeignPtr, castFunPtrToPtr )
 import Data.List       ( intersperse, sortBy, zip4, zip6, partition )
 import Foreign         ( Ptr, castPtr, mallocBytes, pokeByteOff, Word8,
                          withForeignPtr, castFunPtrToPtr )
-import Foreign.C       ( CInt )
+import Foreign.C
 import Control.Exception       ( throwDyn )
 
 import GHC.Exts                ( Int(..), ByteArray# )
 import Control.Exception       ( throwDyn )
 
 import GHC.Exts                ( Int(..), ByteArray# )
@@ -1119,7 +1119,7 @@ pushAtom d p other
               (pprCoreExpr (deAnnotate (undefined, other)))
 
 foreign import ccall unsafe "memcpy"
               (pprCoreExpr (deAnnotate (undefined, other)))
 
 foreign import ccall unsafe "memcpy"
- memcpy :: Ptr a -> Ptr b -> CInt -> IO ()
+ memcpy :: Ptr a -> Ptr b -> CSize -> IO ()
 
 
 -- -----------------------------------------------------------------------------
 
 
 -- -----------------------------------------------------------------------------
index c5740d2..d34b0f3 100644 (file)
@@ -2206,6 +2206,9 @@ sandboxIO thing = do
 foreign import "rts_evalStableIO"  {- safe -}
   rts_evalStableIO :: StablePtr (IO a) -> Ptr (StablePtr a) -> IO CInt
   -- more informative than the C type!
 foreign import "rts_evalStableIO"  {- safe -}
   rts_evalStableIO :: StablePtr (IO a) -> Ptr (StablePtr a) -> IO CInt
   -- more informative than the C type!
+
+XXX the type of rts_evalStableIO no longer matches the above
+
 -}
 
 
 -}
 
 
index 3a3626b..6e23a9c 100644 (file)
 /* The standard FFI interface */
 #include "HsFFI.h"
 
 /* The standard FFI interface */
 #include "HsFFI.h"
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 /* -----------------------------------------------------------------------------
    Functions exported by the RTS for use in Stg code
    -------------------------------------------------------------------------- */
 /* -----------------------------------------------------------------------------
    Functions exported by the RTS for use in Stg code
    -------------------------------------------------------------------------- */
@@ -36,7 +40,7 @@ extern int genericRaise(int sig);
 extern int cmp_thread(StgPtr tso1, StgPtr tso2);
 extern int rts_getThreadId(StgPtr tso);
 extern int forkOS_createThread ( HsStablePtr entry );
 extern int cmp_thread(StgPtr tso1, StgPtr tso2);
 extern int rts_getThreadId(StgPtr tso);
 extern int forkOS_createThread ( HsStablePtr entry );
-extern StgInt forkProcess(HsStablePtr *entry);
+extern pid_t forkProcess(HsStablePtr *entry);
 extern HsBool rtsSupportsBoundThreads(void);
 extern StgInt newSpark (StgRegTable *reg, StgClosure *p);
 
 extern HsBool rtsSupportsBoundThreads(void);
 extern StgInt newSpark (StgRegTable *reg, StgClosure *p);
 
index fa8a651..3d87003 100644 (file)
@@ -2111,7 +2111,7 @@ scheduleDoGC (Capability *cap, Task *task USED_IF_THREADS, rtsBool force_major)
  * Singleton fork(). Do not copy any running threads.
  * ------------------------------------------------------------------------- */
 
  * Singleton fork(). Do not copy any running threads.
  * ------------------------------------------------------------------------- */
 
-StgInt
+pid_t
 forkProcess(HsStablePtr *entry
 #ifndef FORKPROCESS_PRIMOP_SUPPORTED
            STG_UNUSED
 forkProcess(HsStablePtr *entry
 #ifndef FORKPROCESS_PRIMOP_SUPPORTED
            STG_UNUSED