Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6 from bgamari/master

Various fixes for GHC 7.5
  • Loading branch information...
commit 23716ee06e56a2fe2d4eaf59174fdcc279ee2926 2 parents 451b347 + 0b57510
@phonohawk authored
View
3  OpenSSL/DSA.hsc
@@ -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
View
3  OpenSSL/EVP/Base64.hsc
@@ -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
View
3  OpenSSL/EVP/Digest.hsc
@@ -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
View
3  OpenSSL/EVP/Internal.hsc
@@ -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)
View
3  OpenSSL/EVP/Open.hsc
@@ -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
View
3  OpenSSL/RSA.hsc
@@ -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
View
4 OpenSSL/Utils.hs
@@ -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)
@@ -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
View
3  OpenSSL/X509.hsc
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.