From cd937c2be2900b8f13506d9ae7c731ad43d74e05 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 11 Sep 2007 17:34:24 +0000 Subject: allow setting off GSL default error handler --- lib/GSL/Special/Internal.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/GSL/Special') diff --git a/lib/GSL/Special/Internal.hs b/lib/GSL/Special/Internal.hs index c7455d9..ad1aaa2 100644 --- a/lib/GSL/Special/Internal.hs +++ b/lib/GSL/Special/Internal.hs @@ -25,7 +25,7 @@ module GSL.Special.Internal ( where import Foreign -import Data.Packed.Internal.Common(check,(//)) +import Data.Packed.Internal(check,(//)) data Precision = PrecDouble | PrecSingle | PrecApprox @@ -39,10 +39,10 @@ type Gsl_mode_t = Int ---------------------------------------------------------------- -- | access to a sf_result -createSFR :: Storable a => t -> (Ptr a -> IO Int) -> (a, a) +createSFR :: Storable a => String -> (Ptr a -> IO Int) -> (a, a) createSFR s f = unsafePerformIO $ do p <- mallocArray 2 - f p // check "createSFR" [] + f p // check s [] [val,err] <- peekArray 2 p free p return (val,err) @@ -52,12 +52,12 @@ createSFR s f = unsafePerformIO $ do -- the sf_result_e10 contains two doubles and the exponent -- | acces to sf_result_e10 -createSFR_E10 :: (Storable t2, Storable t3, Storable t1) => t -> (Ptr a -> IO Int) -> (t1, t2, t3) +createSFR_E10 :: (Storable t2, Storable t3, Storable t1) => String -> (Ptr a -> IO Int) -> (t1, t2, t3) createSFR_E10 s f = unsafePerformIO $ do let sd = sizeOf (0::Double) let si = sizeOf (0::Int) p <- mallocBytes (2*sd + si) - f p // check "createSFR_E10" [] + f p // check s [] val <- peekByteOff p 0 err <- peekByteOff p sd expo <- peekByteOff p (2*sd) -- cgit v1.2.3