on master help sign in
Rename unsafeAsCString to asCStringUnsafe
commitdf6750bb1951f3b720324fb1ec682a8c33ff9dd3 authorAdithya Kumar <adithya@composewell.com> dateSun 6 Feb 2022, 05:53 (5 years ago) parent064b1d9
2 files changed+4−4
src/Streamly/Internal/Data/Array/Foreign.hs+3−3 src/Streamly/Internal/FileSystem/Event/Linux.hs+1−1
src/Streamly/Internal/Data/Array/Foreign.hs+3−3
@@ -93,7 +93,7 @@ module Streamly.Internal.Data.Array.Foreign
9393 , asBytes
9494 , castUnsafe
9595 , asPtrUnsafe
96− , unsafeAsCString -- asCStringUnsafe?
96+ , asCStringUnsafe
9797 , A.unsafeFreeze -- asImmutableUnsafe?
9898 , A.unsafeThaw -- asMutableUnsafe?
9999
@@ -562,8 +562,8 @@ cast arr =
562562--
563563-- /Pre-release/
564564--
565−unsafeAsCString :: Array a -> (CString -> IO b) -> IO b
566−unsafeAsCString arr act = do
565+asCStringUnsafe :: Array a -> (CString -> IO b) -> IO b
566+asCStringUnsafe arr act = do
567567 let arr1 = asBytes arr <> A.fromList [0]
568568 asPtrUnsafe arr1 $ \ptr -> act (castPtr ptr)
569569
src/Streamly/Internal/FileSystem/Event/Linux.hs+1−1
@@ -727,7 +727,7 @@ addToWatch cfg@Config{..} watch0@(Watch handle wdMap) root0 path0 = do
727727 --
728728 -- XXX The file may have even got deleted and then recreated which we will
729729 -- never get to know, document this.
730− wd <- A.unsafeAsCString absPath $ \pathPtr ->
730+ wd <- A.asCStringUnsafe absPath $ \pathPtr ->
731731 throwErrnoIfMinus1 ("addToWatch: " ++ utf8ToString absPath) $
732732 c_inotify_add_watch (fdFD fd) pathPtr (CUInt createFlags)
733733