Skip to content
Snippets Groups Projects
Commit a22ec93b authored by Jens Nolte's avatar Jens Nolte
Browse files

Fix warnings

parent 3f441d02
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ module Quasar.Wayland.Client.JuicyPixels (
) where
import Codec.Picture
import Data.Bits( unsafeShiftL, unsafeShiftR, (.|.), (.&.) )
import Foreign
import Quasar.Prelude
import Quasar.Wayland.Client.Buffer
......@@ -24,7 +23,7 @@ toImageBuffer shm image = do
width = imageWidth image
height = imageHeight image
withForeignPtr ptr \ptr' -> forM [(x, y) | x <- [0 .. width - 1], y <- [0 .. height - 1]] \(x, y) -> do
withForeignPtr ptr \ptr' -> forM_ [(x, y) | x <- [0 .. width - 1], y <- [0 .. height - 1]] \(x, y) -> do
pokeByteOff ptr' ((x + (y * width)) * 4) (pixelRgba8ToWlARGB (pixelAt image x y))
pure buffer
......@@ -37,5 +36,8 @@ pixelRgba8ToWlARGB (PixelRGBA8 r g b a) =
(fi g `unsafeShiftL` (1 * bitCount)) .|.
(fi r `unsafeShiftL` (2 * bitCount)) .|.
(fi a `unsafeShiftL` (3 * bitCount))
where fi = fromIntegral
bitCount = 8
where
fi :: Pixel8 -> Word32
fi = fromIntegral
bitCount :: Int
bitCount = 8
......@@ -77,7 +77,7 @@ connectionThread connection work = asyncWithUnmask' \unmask -> unmask work `catc
where
traceAndDisposeConnection :: SomeException -> IO ()
traceAndDisposeConnection (isCancelAsync -> True) = pure ()
-- TODO this logs- and then discard exceptions. Ensure this is the desired behavior?
-- NOTE this logs- and then discards exceptions (might need to be reworked later)
traceAndDisposeConnection ex = traceIO (displayException ex) >> disposeEventuallyIO_ connection
sendThread :: WaylandConnection s -> IO ()
......
......@@ -37,7 +37,7 @@ module Quasar.Wayland.Protocol (
Version,
interfaceVersion,
Side(..),
IsSide,
IsSide(MessageHandler),
IsInterfaceSide,
-- * For wl_display
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment