remove compiler warnings

This commit is contained in:
Hideyuki Tanaka 2010-05-05 04:28:04 +09:00
parent dbe760d6e2
commit 2f12e6c3d0
5 changed files with 8 additions and 12 deletions

View File

@ -297,7 +297,7 @@ foreign import ccall "msgpack_pack_raw_body_wrap" msgpack_pack_raw_body ::
-- | Pack a single byte stream. It calls 'packRAW' and 'packRAWBody'.
packRAW' :: Packer -> ByteString -> IO Int
packRAW' pc bs = do
packRAW pc (BS.length bs)
_ <- packRAW pc (BS.length bs)
packRAWBody pc bs
type Unpacker = ForeignPtr ()
@ -475,7 +475,7 @@ peekObject ptr = do
(#const MSGPACK_OBJECT_MAP) ->
peekObjectMap ptr
_ ->
fail "peekObject: unknown object type"
fail $ "peekObject: unknown object type (" ++ show typ ++ ")"
peekObjectBool :: Ptr a -> IO Object
peekObjectBool ptr = do
@ -541,11 +541,11 @@ packObject pc (ObjectDouble d) = packDouble pc d >> return ()
packObject pc (ObjectRAW bs) = packRAW' pc bs >> return ()
packObject pc (ObjectArray ls) = do
packArray pc (length ls)
_ <- packArray pc (length ls)
mapM_ (packObject pc) ls
packObject pc (ObjectMap ls) = do
packMap pc (length ls)
_ <- packMap pc (length ls)
mapM_ (\(a, b) -> packObject pc a >> packObject pc b) ls
data UnpackReturn =

View File

@ -27,7 +27,6 @@ module Data.MessagePack.Class(
import Control.Monad.Error
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as C8
import Data.Either
import Data.MessagePack.Base

View File

@ -21,7 +21,6 @@ module Data.MessagePack.Feed(
feederFromString,
) where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Data.IORef
@ -37,9 +36,9 @@ feederFromHandle h = return $ do
if BS.length bs > 0
then do return $ Just bs
else do
bs <- BS.hGet h 1
if BS.length bs > 0
then do return $ Just bs
c <- BS.hGet h 1
if BS.length c > 0
then do return $ Just c
else do
hClose h
return Nothing

View File

@ -79,7 +79,7 @@ packToString :: MonadIO m => PackerT m r -> m ByteString
packToString m = do
sb <- liftIO $ newSimpleBuffer
pc <- liftIO $ newPacker sb
runPackerT m pc
_ <- runPackerT m pc
liftIO $ simpleBufferData sb
-- | Execcute given serializer and write byte sequence to Handle.

View File

@ -19,9 +19,7 @@ module Data.MessagePack.Stream(
unpackObjectsFromString,
) where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import System.IO
import System.IO.Unsafe