aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Terminal
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2013-10-12 23:49:25 +0200
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2013-10-12 23:49:25 +0200
commite968172cb0c9f4fc653c775faf3ecb661f5b1948 (patch)
tree14451b438f7aa84a75c4f1f94cceb2bea3959ffc /System/Posix/Terminal
parent7b9044abd826ef1e0f91a1ce5922ed1303e1f2a0 (diff)
Make `-Wall` clean and drop `-fno-warn-unused-imports`
CPP conditional code sections have been carefully taken into account while performing this warning cleanup. Most `OPTIONS_GHC` declarations could be dropped (now only a lonely `{-# OPTIONS_GHC -fno-cse #-}` remains in `Posix.Signals`). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'System/Posix/Terminal')
-rw-r--r--System/Posix/Terminal/ByteString.hsc11
-rw-r--r--System/Posix/Terminal/Common.hsc14
2 files changed, 8 insertions, 17 deletions
diff --git a/System/Posix/Terminal/ByteString.hsc b/System/Posix/Terminal/ByteString.hsc
index a667c8a..ad2dd26 100644
--- a/System/Posix/Terminal/ByteString.hsc
+++ b/System/Posix/Terminal/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
@@ -75,8 +74,10 @@ module System.Posix.Terminal.ByteString (
import Foreign
import System.Posix.Types
import System.Posix.Terminal.Common
-import System.Posix.IO.ByteString
-import Data.ByteString.Char8 as B
+#ifndef HAVE_OPENPTY
+import System.Posix.IO.ByteString (defaultFileFlags, openFd, noctty, OpenMode(ReadWrite))
+import Data.ByteString.Char8 as B ( pack, )
+#endif
import Foreign.C hiding (
throwErrnoPath,
@@ -185,9 +186,9 @@ foreign import ccall unsafe "__hsunix_unlockpt"
c_unlockpt :: CInt -> IO CInt
#else
c_grantpt :: CInt -> IO CInt
-c_grantpt _ = return (fromIntegral 0)
+c_grantpt _ = return (fromIntegral (0::Int))
c_unlockpt :: CInt -> IO CInt
-c_unlockpt _ = return (fromIntegral 0)
+c_unlockpt _ = return (fromIntegral (0::Int))
#endif /* HAVE_PTSNAME */
#endif /* !HAVE_OPENPTY */
diff --git a/System/Posix/Terminal/Common.hsc b/System/Posix/Terminal/Common.hsc
index 2a07e28..4075ba3 100644
--- a/System/Posix/Terminal/Common.hsc
+++ b/System/Posix/Terminal/Common.hsc
@@ -1,4 +1,3 @@
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
@@ -69,22 +68,13 @@ module System.Posix.Terminal.Common (
import Data.Bits
import Data.Char
-import Foreign.C.Error ( errnoToIOError, throwErrnoIfMinus1,
- throwErrnoIfMinus1_, throwErrnoIfNull )
-#ifndef HAVE_PTSNAME
-import Foreign.C.Error ( eNOSYS )
-#endif
-import Foreign.C.String ( CString, peekCString, withCString )
+import Foreign.C.Error ( throwErrnoIfMinus1, throwErrnoIfMinus1_ )
import Foreign.C.Types
import Foreign.ForeignPtr ( ForeignPtr, withForeignPtr, mallocForeignPtrBytes )
-import Foreign.Marshal.Alloc ( alloca )
import Foreign.Marshal.Utils ( copyBytes )
-import Foreign.Ptr ( Ptr, nullPtr, plusPtr )
+import Foreign.Ptr ( Ptr, plusPtr )
import Foreign.Storable ( Storable(..) )
-import System.IO.Error ( ioError )
import System.IO.Unsafe ( unsafePerformIO )
-import System.Posix.IO ( OpenFileFlags(..), OpenMode(..), defaultFileFlags,
- openFd )
import System.Posix.Types
-- -----------------------------------------------------------------------------