Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from bgamari/master
Browse files Browse the repository at this point in the history
Various fixes for GHC 7.5
  • Loading branch information
depressed-pho committed Mar 4, 2012
2 parents 451b347 + 0b57510 commit 23716ee
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion OpenSSL/DSA.hsc
Expand Up @@ -34,7 +34,8 @@ module OpenSSL.DSA
import Control.Monad
import qualified Data.ByteString as BS
import Data.Typeable
import Foreign
import Foreign hiding (unsafePerformIO)
import System.IO.Unsafe (unsafePerformIO)
import Foreign.C (CString)
import Foreign.C.Types
import OpenSSL.BN
Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/EVP/Base64.hsc
Expand Up @@ -22,8 +22,9 @@ import qualified Data.ByteString.Lazy.Internal as L8Internal
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
import Data.List
import Foreign
import Foreign hiding (unsafePerformIO)
import Foreign.C
import System.IO.Unsafe (unsafePerformIO)


-- On encoding, we keep fetching the next block until we get at least
Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/EVP/Digest.hsc
Expand Up @@ -24,7 +24,8 @@ import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
import Control.Applicative ((<$>))
import Foreign
import Foreign hiding (unsafePerformIO)
import System.IO.Unsafe (unsafePerformIO)
import Foreign.C
import OpenSSL.EVP.Internal
import OpenSSL.Objects
Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/EVP/Internal.hsc
Expand Up @@ -61,7 +61,8 @@ import Foreign.Ptr (Ptr, castPtr, FunPtr)
import Foreign.C.String (peekCStringLen)
import Foreign.ForeignPtr (
ForeignPtr, newForeignPtr, withForeignPtr, addForeignPtrFinalizer,
mallocForeignPtrBytes, touchForeignPtr, unsafeForeignPtrToPtr)
mallocForeignPtrBytes, touchForeignPtr)
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
import Foreign.Storable (Storable(..))
import Foreign.Marshal.Alloc (alloca, allocaBytes)
import Foreign.Marshal.Array (allocaArray)
Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/EVP/Open.hsc
Expand Up @@ -12,7 +12,8 @@ module OpenSSL.EVP.Open

import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
import Foreign
import Foreign hiding (unsafePerformIO)
import System.IO.Unsafe (unsafePerformIO)
import Foreign.C
import OpenSSL.EVP.Cipher hiding (cipher)
import OpenSSL.EVP.PKey
Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/RSA.hsc
Expand Up @@ -32,7 +32,8 @@ module OpenSSL.RSA

import Control.Monad
import Data.Typeable
import Foreign
import Foreign hiding (unsafePerformIO)
import System.IO.Unsafe (unsafePerformIO)
import Foreign.C
import OpenSSL.BN
import OpenSSL.Utils
Expand Down
4 changes: 2 additions & 2 deletions OpenSSL/Utils.hs
Expand Up @@ -45,7 +45,7 @@ raiseOpenSSLError :: IO a
raiseOpenSSLError = getError >>= errorString >>= fail

-- | Convert an integer to a hex string
toHex :: (Bits i) => i -> String
toHex :: (Num i, Bits i) => i -> String
toHex = reverse . map hexByte . unfoldr step where
step 0 = Nothing
step i = Just (i .&. 0xf, i `shiftR` 4)
Expand All @@ -69,7 +69,7 @@ toHex = reverse . map hexByte . unfoldr step where
hexByte _ = undefined

-- | Convert a hex string to an integer
fromHex :: (Bits i) => String -> i
fromHex :: (Num i, Bits i) => String -> i
fromHex = foldl step 0 where
step acc hexchar = (acc `shiftL` 4) .|. byteHex hexchar

Expand Down
3 changes: 2 additions & 1 deletion OpenSSL/X509.hsc
Expand Up @@ -53,7 +53,8 @@ module OpenSSL.X509
import Control.Monad
import Data.Time.Clock
import Data.Maybe
import Foreign
import Foreign hiding (unsafeForeignPtrToPtr)
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
import Foreign.C
import OpenSSL.ASN1
import OpenSSL.BIO
Expand Down

0 comments on commit 23716ee

Please sign in to comment.