Skip to content

Commit c3d7034

Browse files
authored
Merge pull request #81 from amesgen/ffi-sigs
Correct a few FFI signatures
2 parents 25361be + 76c626a commit c3d7034

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Data/Streaming/Zlib/Lowlevel.hs

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Data.Streaming.Zlib.Lowlevel
2323
, c_call_inflate_set_dictionary
2424
) where
2525

26+
import Data.Functor (void)
2627
import Foreign.C
2728
import Foreign.Ptr
2829
import Codec.Compression.Zlib (WindowBits (WindowBits))
@@ -43,19 +44,19 @@ foreign import ccall unsafe "streaming_commons_create_z_stream"
4344

4445
foreign import ccall unsafe "streaming_commons_deflate_init2"
4546
c_deflateInit2 :: ZStream' -> CInt -> CInt -> CInt -> CInt
46-
-> IO ()
47+
-> IO CInt
4748

4849
deflateInit2 :: ZStream' -> Int -> WindowBits -> Int -> Strategy -> IO ()
49-
deflateInit2 zstream level windowBits memlevel strategy =
50+
deflateInit2 zstream level windowBits memlevel strategy = void $
5051
c_deflateInit2 zstream (fromIntegral level) (wbToInt windowBits)
5152
(fromIntegral memlevel)
5253
(fromIntegral $ fromEnum strategy)
5354

5455
foreign import ccall unsafe "streaming_commons_inflate_init2"
55-
c_inflateInit2 :: ZStream' -> CInt -> IO ()
56+
c_inflateInit2 :: ZStream' -> CInt -> IO CInt
5657

5758
inflateInit2 :: ZStream' -> WindowBits -> IO ()
58-
inflateInit2 zstream wb = c_inflateInit2 zstream (wbToInt wb)
59+
inflateInit2 zstream wb = void $ c_inflateInit2 zstream (wbToInt wb)
5960

6061
foreign import ccall unsafe "&streaming_commons_free_z_stream_inflate"
6162
c_free_z_stream_inflate :: FunPtr (ZStream' -> IO ())
@@ -94,10 +95,10 @@ foreign import ccall unsafe "streaming_commons_call_deflate_full_flush"
9495
c_call_deflate_full_flush :: ZStream' -> IO CInt
9596

9697
foreign import ccall unsafe "streaming_commons_deflate_set_dictionary"
97-
c_call_deflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO ()
98+
c_call_deflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO CInt
9899

99100
foreign import ccall unsafe "streaming_commons_inflate_set_dictionary"
100-
c_call_inflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO ()
101+
c_call_inflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO CInt
101102

102103
wbToInt :: WindowBits -> CInt
103104
wbToInt (WindowBits i) = fromIntegral i

0 commit comments

Comments
 (0)