diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-30 19:44:58 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-30 19:44:58 +0100 |
commit | 731f7dddcbae3c4332beac742605dade2d4a80ad (patch) | |
tree | 0eac898007723182c50eb09af16f7e720610554e /System/Posix/IO | |
parent | 03783d2758d2f35c01a8570da30f508c3b9e019b (diff) |
Add CTYPE annotations to ptr types used for FFI
This avoids incompatible-pointer warnings from the c-compiler when using
`CApiFFI`
Diffstat (limited to 'System/Posix/IO')
-rw-r--r-- | System/Posix/IO/Common.hsc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc index 198b3f1..eb4a721 100644 --- a/System/Posix/IO/Common.hsc +++ b/System/Posix/IO/Common.hsc @@ -320,9 +320,7 @@ getLock (Fd fd) lock = maybeResult (_, (Unlock, _, _, _)) = Nothing maybeResult x = Just x -type CFLock = () - -allocaLock :: FileLock -> (Ptr CFLock -> IO a) -> IO a +allocaLock :: FileLock -> (Ptr Base.CFLock -> IO a) -> IO a allocaLock (lockreq, mode, start, len) io = allocaBytes (#const sizeof(struct flock)) $ \p -> do (#poke struct flock, l_type) p (lockReq2Int lockreq :: CShort) @@ -336,7 +334,7 @@ lockReq2Int ReadLock = (#const F_RDLCK) lockReq2Int WriteLock = (#const F_WRLCK) lockReq2Int Unlock = (#const F_UNLCK) -bytes2ProcessIDAndLock :: Ptr CFLock -> IO (ProcessID, FileLock) +bytes2ProcessIDAndLock :: Ptr Base.CFLock -> IO (ProcessID, FileLock) bytes2ProcessIDAndLock p = do req <- (#peek struct flock, l_type) p mode <- (#peek struct flock, l_whence) p |