Skip to content

Commit 40e89b2

Browse files
authored
Fix remaining warnings (#251)
1 parent d469768 commit 40e89b2

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

sdl2.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ flag recent-ish
6363
manual: False
6464

6565
library
66-
-- ghc-options: -Wall
66+
-- ghc-options: -Wall -Werror
6767

6868
exposed-modules:
6969
SDL

src/SDL/Event.hs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ import Data.Text (Text)
9292
import Data.Typeable
9393
import Foreign hiding (throwIfNeg_)
9494
import Foreign.C
95-
import Foreign.Marshal.Array
9695
import GHC.Generics (Generic)
9796
import SDL.Vect
9897
import SDL.Input.Joystick
@@ -684,9 +683,9 @@ convertRaw (Raw.JoyDeviceEvent t ts a) =
684683
convertRaw (Raw.ControllerAxisEvent _ ts a b c) =
685684
return (Event ts (ControllerAxisEvent (ControllerAxisEventData a b c)))
686685
convertRaw (Raw.ControllerButtonEvent t ts a b _) =
687-
return (Event ts
686+
return (Event ts
688687
(ControllerButtonEvent
689-
(ControllerButtonEventData a
688+
(ControllerButtonEventData a
690689
(fromNumber $ fromIntegral b)
691690
(fromNumber t))))
692691
convertRaw (Raw.ControllerDeviceEvent t ts a) =
@@ -755,9 +754,9 @@ pollEvent =
755754
if n == 0
756755
then return Nothing
757756
else alloca $ \e -> do
758-
n <- Raw.pollEvent e
757+
n' <- Raw.pollEvent e
759758
-- Checking 0 again doesn't hurt and it's good to be safe.
760-
if n == 0
759+
if n' == 0
761760
then return Nothing
762761
else fmap Just (peek e >>= convertRaw)
763762

@@ -766,7 +765,7 @@ pollEvent =
766765
-- Like 'pollEvent' this function should only be called in the OS thread which
767766
-- set the video mode.
768767
pollEvents :: MonadIO m => m [Event]
769-
pollEvents = liftIO $ do
768+
pollEvents = liftIO $ do
770769
Raw.pumpEvents
771770
peepAllEvents >>= mapM convertRaw where
772771
peepAllEvents = do
@@ -872,7 +871,7 @@ registerEvent registeredEventDataToEvent eventToRegisteredEventData = do
872871
0 -> return $ EventPushFiltered
873872
_ -> EventPushFailure <$> getError
874873

875-
getEv (Event ts (UserEvent (UserEventData typ mWin code d1 d2))) =
874+
getEv (Event ts (UserEvent (UserEventData _typ mWin code d1 d2))) =
876875
registeredEventDataToEvent (RegisteredEventData mWin code d1 d2) ts
877876
getEv _ = return Nothing
878877

@@ -921,6 +920,6 @@ delEventWatch = liftIO . runEventWatchRemoval
921920

922921
-- | Checks raw Windows for null references.
923922
getWindowFromID :: MonadIO m => Word32 -> m (Maybe Window)
924-
getWindowFromID id = do
925-
rawWindow <- Raw.getWindowFromID id
923+
getWindowFromID windowId = do
924+
rawWindow <- Raw.getWindowFromID windowId
926925
return $ if rawWindow == nullPtr then Nothing else Just $ Window rawWindow

src/SDL/Raw/Enum.hsc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{-# LANGUAGE ScopedTypeVariables #-}
22
{-# LANGUAGE PatternSynonyms #-}
3+
4+
{-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-}
5+
36
module SDL.Raw.Enum (
47
-- * Enumerations
58

src/SDL/Video.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import Control.Monad.IO.Class (MonadIO, liftIO)
8282
import Data.Bits
8383
import Data.Data (Data)
8484
import Data.Foldable
85-
import Data.Maybe (isJust, fromMaybe)
85+
import Data.Maybe (fromMaybe)
8686
import Data.Monoid (First(..))
8787
import Data.Text (Text)
8888
import Data.Typeable

src/SDL/Video/Renderer.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ module SDL.Video.Renderer
122122
) where
123123

124124
import Control.Monad.IO.Class (MonadIO, liftIO)
125-
import Control.Exception (catch, throw, SomeException, uninterruptibleMask_)
126125
import Data.Bits
127126
import Data.Data (Data)
128127
import Data.Foldable

0 commit comments

Comments
 (0)