hashed-storage 0.4.7 → 0.4.8
raw patch · 2 files changed
+8/−7 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Storage/Hashed/Index.hs +7/−6
- hashed-storage.cabal +1/−1
Storage/Hashed/Index.hs view
@@ -152,7 +152,7 @@ (dsc_fp, dsc_start, dsc_len) = toForeignPtr dsc withForeignPtr fp $ \p -> withForeignPtr dsc_fp $ \dsc_p ->- do pokeByteOff p (off + off_dsclen) dsc_len+ do pokeByteOff p (off + off_dsclen) (xlate32 $ fromIntegral dsc_len :: Int32) memcpy (plusPtr p $ off + off_dsc) (plusPtr dsc_p dsc_start) (fromIntegral dsc_len)@@ -206,11 +206,12 @@ mmapIndex :: forall a. FilePath -> Int -> IO (ForeignPtr a, Int) mmapIndex indexpath req_size = do exist <- doesFileExist indexpath- act_size <- if exist then fileSize `fmap` getFileStatus indexpath- else return 0- let size :: Int- size = fromIntegral $- if req_size > 0 then fromIntegral req_size else act_size+ act_size <- fromIntegral `fmap` if exist then fileSize `fmap` getFileStatus indexpath+ else return 0+ let size = case req_size > 0 of+ True -> req_size+ False | act_size >= size_magic -> act_size - size_magic+ | otherwise -> 0 case size of 0 -> return (castForeignPtr nullForeignPtr, size) _ -> do (x, _) <- mmapFileForeignPtr indexpath
hashed-storage.cabal view
@@ -1,5 +1,5 @@ name: hashed-storage-version: 0.4.7+version: 0.4.8 synopsis: Hashed file storage support code. description: Support code for reading and manipulating hashed file storage