Skip to content
Browse files

Fix build warnings in Git.Pack, Git.PackIndex

  • Loading branch information...
1 parent 8d47a1a commit d51cb8678f23a41f694454bc94d4dc0d93e0b874 @kfish committed May 11, 2011
Showing with 7 additions and 8 deletions.
  1. +3 −2 Git/Pack.hs
  2. +4 −6 Git/PackIndex.hs
View
5 Git/Pack.hs
@@ -86,8 +86,9 @@ packReadObject' off = do
n <- I.heads "PACK"
if (n == 4)
then do
- _ver <- fromIntegral <$> endianRead4 MSB
- _num <- fromIntegral <$> endianRead4 MSB
+ -- TODO: verify this is a known version, error otherwise
+ -- _ver <- fromIntegral <$> endianRead4 MSB
+ -- _num <- fromIntegral <$> endianRead4 MSB
I.seek off
packObjectRead
else return Nothing
View
10 Git/PackIndex.hs
@@ -10,9 +10,7 @@ module Git.PackIndex (
) where
import Control.Applicative ((<$>))
-import Control.Monad (forM_)
import qualified Data.ByteString as BS
-import Data.Ord
import Data.Word (Word32)
import Foreign.Ptr
import Foreign.Storable
@@ -126,7 +124,7 @@ idxFind idx sha = idxFind' 0 (idxSize idx)
LT -> idxFind' lo i
GT -> idxFind' i hi
where
- i = floor ((fromIntegral (lo + hi)) / 2.0)
+ i = floor ((fromIntegral (lo + hi)) / 2.0 :: Double)
findInPackIdxs :: BS.ByteString -> IO ()
findInPackIdxs sha = do
@@ -183,7 +181,7 @@ idxHeader = 0xff744f63
readIdx :: FilePath -> IO IDX
readIdx fp = do
- (ptr, rawsize, offset, size) <- mmapFilePtr fp ReadOnly Nothing
+ (ptr, _rawsize, offset, size) <- mmapFilePtr fp ReadOnly Nothing
let start :: Ptr (BigEndian Word32)
start = ptr `plusPtr` offset
BE hdr <- peek start
@@ -202,7 +200,7 @@ dumpRawPackIndex fp = do
return "Woot"
mkIDX1 :: FilePath -> Ptr (BigEndian Word32) -> Int -> IO IDX
-mkIDX1 fp start size = do
+mkIDX1 fp start _size = do
let pack = replaceExtension fp ".pack"
fanout = start
BE n <- peekElemOff fanout 255
@@ -211,7 +209,7 @@ mkIDX1 fp start size = do
return (IDX1 pack n' fanout offsets)
mkIDX2 :: FilePath -> Ptr (BigEndian Word32) -> Int -> IO IDX
-mkIDX2 fp start size = do
+mkIDX2 fp start _size = do
let pack = replaceExtension fp ".pack"
fanout = start `plusPtr` (2 * 4)
BE n <- peekElemOff fanout 255

0 comments on commit d51cb86

Please sign in to comment.
Something went wrong with that request. Please try again.