diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-07-13 10:00:15 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-07-13 10:00:15 +0100 |
commit | c888396e96976cd9818d49430f1596d621046b38 (patch) | |
tree | c71043f29b9206796e26ee59b1edd91ae45593c7 /libraries/base/GHC/ForeignPtr.hs | |
parent | 657153aeb615703dc2982f5ba68bd22eeae0b61c (diff) | |
download | haskell-c888396e96976cd9818d49430f1596d621046b38.tar.gz |
fix warnings
Diffstat (limited to 'libraries/base/GHC/ForeignPtr.hs')
-rw-r--r-- | libraries/base/GHC/ForeignPtr.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/base/GHC/ForeignPtr.hs b/libraries/base/GHC/ForeignPtr.hs index f3ce527485..244e0fd14e 100644 --- a/libraries/base/GHC/ForeignPtr.hs +++ b/libraries/base/GHC/ForeignPtr.hs @@ -189,12 +189,12 @@ mallocForeignPtrBytes (I# size) = do -- size and alignment of the memory required is given explicitly as numbers of -- bytes. mallocForeignPtrAlignedBytes :: Int -> Int -> IO (ForeignPtr a) -mallocForeignPtrAlignedBytes size alignment | size < 0 = +mallocForeignPtrAlignedBytes size _align | size < 0 = error "mallocForeignPtrAlignedBytes: size must be >= 0" -mallocForeignPtrAlignedBytes (I# size) (I# alignment) = do +mallocForeignPtrAlignedBytes (I# size) (I# align) = do r <- newIORef (NoFinalizers, []) IO $ \s -> - case newAlignedPinnedByteArray# size alignment s of { (# s', mbarr# #) -> + case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) -> (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#)) (MallocPtr mbarr# r) #) } @@ -243,10 +243,10 @@ mallocPlainForeignPtrBytes (I# size) = IO $ \s -> -- finalizer is used. Attempts to add a finalizer will cause an -- exception to be thrown. mallocPlainForeignPtrAlignedBytes :: Int -> Int -> IO (ForeignPtr a) -mallocPlainForeignPtrAlignedBytes size alignment | size < 0 = +mallocPlainForeignPtrAlignedBytes size _align | size < 0 = error "mallocPlainForeignPtrAlignedBytes: size must be >= 0" -mallocPlainForeignPtrAlignedBytes (I# size) (I# alignment) = IO $ \s -> - case newAlignedPinnedByteArray# size alignment s of { (# s', mbarr# #) -> +mallocPlainForeignPtrAlignedBytes (I# size) (I# align) = IO $ \s -> + case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) -> (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#)) (PlainPtr mbarr#) #) } |