Permalink
Browse files

Get rid of some easily nuked warnings.

  • Loading branch information...
1 parent fb36be6 commit fb29ef4ec5621a76cb2e3d3e285ea72bf76fade4 @bos bos committed May 12, 2010
Showing with 9 additions and 10 deletions.
  1. +1 −2 src/System/Event/Array.hs
  2. +7 −7 src/System/Event/Manager.hs
  3. +1 −1 src/System/Event/Signal.hsc
@@ -24,8 +24,7 @@ module System.Event.Array
) where
import Control.Monad (when)
-import Data.IORef (IORef, atomicModifyIORef, mkWeakIORef, newIORef, readIORef,
- writeIORef)
+import Data.IORef (IORef, atomicModifyIORef, newIORef, readIORef, writeIORef)
import Foreign.C.Types (CSize)
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import Foreign.Ptr (Ptr, nullPtr, plusPtr)
@@ -187,14 +187,14 @@ newWith be = do
when (st /= Finished) $ do
I.delete be
closeControl ctrl
- finished <- newEmptyMVar
+ fini <- newEmptyMVar
let mgr = EventManager { emBackend = be
, emFds = iofds
, emTimeouts = timeouts
, emState = state
, emUniqueSource = us
, emControl = ctrl
- , emFinished = finished
+ , emFinished = fini
}
_ <- registerFd_ mgr (handleControlEvent mgr) (controlReadFd ctrl) evtRead
_ <- registerFd_ mgr (handleControlEvent mgr) (wakeupReadFd ctrl) evtRead
@@ -211,7 +211,7 @@ finished :: EventManager -> IO Bool
finished mgr = (== Finished) `liftM` readIORef (emState mgr)
cleanup :: EventManager -> IO ()
-cleanup mgr@EventManager{..} = do
+cleanup EventManager{..} = do
writeIORef emState Finished
I.delete emBackend
closeControl emControl
@@ -233,16 +233,16 @@ loop mgr@EventManager{..} = do
when running $ go q'
init :: EventManager -> IO ()
-init mgr@EventManager{..} = do
+init EventManager{..} = do
state <- atomicModifyIORef emState $ \s -> case s of
Created -> (Running, s)
_ -> (s, s)
when (state /= Created) .
error $ "System.Event.Manager.init: state is already " ++ show state
step :: EventManager -> TimeoutQueue -> IO (Bool, TimeoutQueue)
-step mgr@EventManager{..} q = do
- (timeout, q') <- mkTimeout q
+step mgr@EventManager{..} tq = do
+ (timeout, q') <- mkTimeout tq
I.poll emBackend timeout (onFdEvent mgr)
state <- readIORef emState
state `seq` return (state == Running, q')
@@ -253,7 +253,7 @@ step mgr@EventManager{..} q = do
mkTimeout :: TimeoutQueue -> IO (Timeout, TimeoutQueue)
mkTimeout q = do
now <- getCurrentTime
- newTimeouts <- atomicModifyIORef emTimeouts $ \q -> ([], q)
+ newTimeouts <- atomicModifyIORef emTimeouts $ \q' -> ([], q')
let (expired, q') = Q.atMost now (applyTimeoutEdits q newTimeouts)
sequence_ $ map Q.value expired
let timeout = case Q.minView q' of
@@ -70,7 +70,7 @@ blockAllSignals = do
sigProcMask sigSetMask blocked nullPtr
loop :: SignalManager -> IO ()
-loop mgr@SignalManager{..} =
+loop SignalManager{..} =
runInBoundThread $ do
withForeignPtr smThread c_thread_self
alloca $ alloca . go

0 comments on commit fb29ef4

Please sign in to comment.