X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FMarshal%2FUtils.hs;h=5ae677a19d05e37e568c3a938159cc5c2a59540e;hb=41e8fba828acbae1751628af50849f5352b27873;hp=4aa0e74cb2fc6b7f02bc9a8b55ae88c236ecd64d;hpb=10de2c656f74562b662c22928be85e1b3ccda796;p=ghc-base.git diff --git a/Foreign/Marshal/Utils.hs b/Foreign/Marshal/Utils.hs index 4aa0e74..5ae677a 100644 --- a/Foreign/Marshal/Utils.hs +++ b/Foreign/Marshal/Utils.hs @@ -1,4 +1,5 @@ -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-} + ----------------------------------------------------------------------------- -- | -- Module : Foreign.Marshal.Utils @@ -53,7 +54,6 @@ import Foreign.C.Types ( CSize ) import Foreign.Marshal.Alloc ( malloc, alloca ) #ifdef __GLASGOW_HASKELL__ -import GHC.IOBase import GHC.Real ( fromIntegral ) import GHC.Num import GHC.Base @@ -114,7 +114,7 @@ toBool = (/= 0) -- marshalling of Maybe values -- --------------------------- --- |Allocate storage and marshall a storable value wrapped into a 'Maybe' +-- |Allocate storage and marshal a storable value wrapped into a 'Maybe' -- -- * the 'nullPtr' is used to represent 'Nothing' -- @@ -159,14 +159,14 @@ withMany withFoo (x:xs) f = withFoo x $ \x' -> -- first (destination); the copied areas may /not/ overlap -- copyBytes :: Ptr a -> Ptr a -> Int -> IO () -copyBytes dest src size = do memcpy dest src (fromIntegral size) +copyBytes dest src size = do _ <- memcpy dest src (fromIntegral size) return () -- |Copies the given number of bytes from the second area (source) into the -- first (destination); the copied areas /may/ overlap -- moveBytes :: Ptr a -> Ptr a -> Int -> IO () -moveBytes dest src size = do memmove dest src (fromIntegral size) +moveBytes dest src size = do _ <- memmove dest src (fromIntegral size) return ()