diff options
Diffstat (limited to 'lib/Data/Packed/Internal/Common.hs')
-rw-r--r-- | lib/Data/Packed/Internal/Common.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 7305d8c..72a7e26 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs | |||
@@ -73,7 +73,7 @@ app4 f w1 o1 w2 o2 w3 o3 w4 o4 s = ww4 w1 o1 w2 o2 w3 o3 w4 o4 $ | |||
73 | 73 | ||
74 | -- GSL error codes are <= 1024 | 74 | -- GSL error codes are <= 1024 |
75 | -- | error codes for the auxiliary functions required by the wrappers | 75 | -- | error codes for the auxiliary functions required by the wrappers |
76 | errorCode :: Int -> String | 76 | errorCode :: CInt -> String |
77 | errorCode 2000 = "bad size" | 77 | errorCode 2000 = "bad size" |
78 | errorCode 2001 = "bad function code" | 78 | errorCode 2001 = "bad function code" |
79 | errorCode 2002 = "memory problem" | 79 | errorCode 2002 = "memory problem" |
@@ -85,7 +85,7 @@ errorCode 2007 = "not yet supported in this OS" | |||
85 | errorCode n = "code "++show n | 85 | errorCode n = "code "++show n |
86 | 86 | ||
87 | -- | check the error code | 87 | -- | check the error code |
88 | check :: String -> IO Int -> IO () | 88 | check :: String -> IO CInt -> IO () |
89 | check msg f = do | 89 | check msg f = do |
90 | err <- f | 90 | err <- f |
91 | when (err/=0) $ if err > 1024 | 91 | when (err/=0) $ if err > 1024 |
@@ -97,7 +97,7 @@ check msg f = do | |||
97 | return () | 97 | return () |
98 | 98 | ||
99 | -- | description of GSL error codes | 99 | -- | description of GSL error codes |
100 | foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: Int -> IO (Ptr CChar) | 100 | foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: CInt -> IO (Ptr CChar) |
101 | 101 | ||
102 | 102 | ||
103 | {- | conversion of Haskell functions into function pointers that can be used in the C side | 103 | {- | conversion of Haskell functions into function pointers that can be used in the C side |
@@ -112,10 +112,10 @@ foreign import ccall "wrapper" mkfun:: (Double -> Ptr() -> Double) -> IO( FunPtr | |||
112 | ------------------------------------------------ | 112 | ------------------------------------------------ |
113 | type PD = Ptr Double -- | 113 | type PD = Ptr Double -- |
114 | type PC = Ptr (Complex Double) -- | 114 | type PC = Ptr (Complex Double) -- |
115 | type TV = Int -> PD -> IO Int -- | 115 | type TV = Int -> PD -> IO CInt -- |
116 | type TVV = Int -> PD -> TV -- | 116 | type TVV = Int -> PD -> TV -- |
117 | type TVVV = Int -> PD -> TVV -- | 117 | type TVVV = Int -> PD -> TVV -- |
118 | type TM = Int -> Int -> PD -> IO Int -- | 118 | type TM = Int -> Int -> PD -> IO CInt -- |
119 | type TMM = Int -> Int -> PD -> TM -- | 119 | type TMM = Int -> Int -> PD -> TM -- |
120 | type TMMM = Int -> Int -> PD -> TMM -- | 120 | type TMMM = Int -> Int -> PD -> TMM -- |
121 | type TVM = Int -> PD -> TM -- | 121 | type TVM = Int -> PD -> TM -- |
@@ -123,7 +123,7 @@ type TVVM = Int -> PD -> TVM -- | |||
123 | type TMV = Int -> Int -> PD -> TV -- | 123 | type TMV = Int -> Int -> PD -> TV -- |
124 | type TMVM = Int -> Int -> PD -> TVM -- | 124 | type TMVM = Int -> Int -> PD -> TVM -- |
125 | type TMMVM = Int -> Int -> PD -> TMVM -- | 125 | type TMMVM = Int -> Int -> PD -> TMVM -- |
126 | type TCM = Int -> Int -> PC -> IO Int -- | 126 | type TCM = Int -> Int -> PC -> IO CInt -- |
127 | type TCVCM = Int -> PC -> TCM -- | 127 | type TCVCM = Int -> PC -> TCM -- |
128 | type TCMCVCM = Int -> Int -> PC -> TCVCM -- | 128 | type TCMCVCM = Int -> Int -> PC -> TCVCM -- |
129 | type TMCMCVCM = Int -> Int -> PD -> TCMCVCM -- | 129 | type TMCMCVCM = Int -> Int -> PD -> TCMCVCM -- |
@@ -133,7 +133,7 @@ type TVCM = Int -> PD -> TCM -- | |||
133 | type TCMVCM = Int -> Int -> PC -> TVCM -- | 133 | type TCMVCM = Int -> Int -> PC -> TVCM -- |
134 | type TCMCMVCM = Int -> Int -> PC -> TCMVCM -- | 134 | type TCMCMVCM = Int -> Int -> PC -> TCMVCM -- |
135 | type TCMCMCM = Int -> Int -> PC -> TCMCM -- | 135 | type TCMCMCM = Int -> Int -> PC -> TCMCM -- |
136 | type TCV = Int -> PC -> IO Int -- | 136 | type TCV = Int -> PC -> IO CInt -- |
137 | type TCVCV = Int -> PC -> TCV -- | 137 | type TCVCV = Int -> PC -> TCV -- |
138 | type TCVCVCV = Int -> PC -> TCVCV -- | 138 | type TCVCVCV = Int -> PC -> TCVCV -- |
139 | type TCMCV = Int -> Int -> PC -> TCV -- | 139 | type TCMCV = Int -> Int -> PC -> TCV -- |