Skip to content

Instantly share code, notes, and snippets.

@victoredwardocallaghan
Created February 4, 2013 11:04
Show Gist options
  • Save victoredwardocallaghan/4706154 to your computer and use it in GitHub Desktop.
Save victoredwardocallaghan/4706154 to your computer and use it in GitHub Desktop.
XReadBitmapFile fix binding types?
diff --git a/Graphics/X11/Xlib/Misc.hsc b/Graphics/X11/Xlib/Misc.hsc
index a4b75a0..fde4e7a 100644
--- a/Graphics/X11/Xlib/Misc.hsc
+++ b/Graphics/X11/Xlib/Misc.hsc
@@ -781,13 +781,13 @@ readBitmapFile display d filename =
m_y_hot | y_hot == -1 = Nothing
| otherwise = Just y_hot
case rv of
- 0 -> return $ Right (fromIntegral width, fromIntegral height, bitmap, m_x_hot, m_y_hot)
+ 0 -> return $ Right (width, height, bitmap, m_x_hot, m_y_hot)
1 -> return $ Left "readBitmapFile: BitmapOpenFailed"
2 -> return $ Left "readBitmapFile: BitmapFileInvalid"
3 -> return $ Left "readBitmapFile: BitmapNoMemory"
_ -> return $ Left "readBitmapFile: BitmapUnknownError"
foreign import ccall unsafe "X11/Xlib.h XReadBitmapFile"
- xReadBitmapFile :: Display -> Drawable -> CString -> Ptr CInt -> Ptr CInt
+ xReadBitmapFile :: Display -> Drawable -> CString -> Ptr Dimension -> Ptr Dimension
-> Ptr Pixmap -> Ptr CInt -> Ptr CInt -> IO CInt
-- XCreateBitmapFromData omitted (awkward looking type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment