projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7a1ac0c
)
Fixing uses of fromIntegral for Windows
author
dimitris@microsoft.com
<unknown>
Wed, 17 Nov 2010 18:33:51 +0000
(18:33 +0000)
committer
dimitris@microsoft.com
<unknown>
Wed, 17 Nov 2010 18:33:51 +0000
(18:33 +0000)
GHC/IO/FD.hs
patch
|
blob
|
history
diff --git
a/GHC/IO/FD.hs
b/GHC/IO/FD.hs
index
4c3e117
..
d873a4e
100644
(file)
--- a/
GHC/IO/FD.hs
+++ b/
GHC/IO/FD.hs
@@
-1,4
+1,5
@@
-{-# OPTIONS_GHC -XNoImplicitPrelude -XBangPatterns #-}
+{-# OPTIONS_GHC -XNoImplicitPrelude -XBangPatterns -fno-warn-identities #-}
+-- Whether there are identities depends on the platform
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
@@
-395,13
+396,14
@@
setRaw fd raw = System.Posix.Internals.setCooked (fdFD fd) (not raw)
fdRead :: FD -> Ptr Word8 -> Int -> IO Int
fdRead fd ptr bytes
fdRead :: FD -> Ptr Word8 -> Int -> IO Int
fdRead fd ptr bytes
- = readRawBufferPtr "GHC.IO.FD.fdRead" fd ptr 0 (fromIntegral bytes)
+ = do { r <- readRawBufferPtr "GHC.IO.FD.fdRead" fd ptr 0 (fromIntegral bytes)
+ ; return (fromIntegral r) }
fdReadNonBlocking :: FD -> Ptr Word8 -> Int -> IO (Maybe Int)
fdReadNonBlocking fd ptr bytes = do
r <- readRawBufferPtrNoBlock "GHC.IO.FD.fdReadNonBlocking" fd ptr
0 (fromIntegral bytes)
fdReadNonBlocking :: FD -> Ptr Word8 -> Int -> IO (Maybe Int)
fdReadNonBlocking fd ptr bytes = do
r <- readRawBufferPtrNoBlock "GHC.IO.FD.fdReadNonBlocking" fd ptr
0 (fromIntegral bytes)
- case r of
+ case fromIntegral r of
(-1) -> return (Nothing)
n -> return (Just n)
(-1) -> return (Nothing)
n -> return (Just n)