Permalink
Browse files

fix low level pointer stuff

c2hs changes? GHC changes? Who knows?
  • Loading branch information...
1 parent 01994c7 commit 997b9904a1f2a188e933716d765ca79fde9a60fc @0xdaf 0xdaf committed Dec 10, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 GI/Internal/CallableInfo.chs
@@ -40,13 +40,14 @@ callableInfoReturnAttributes :: CallableInfoClass call => call -> [(String, Stri
callableInfoReturnAttributes ci = unsafePerformIO $ do
allocaBytes {# sizeof GIAttributeIter #} $ \iter -> do
zero {# sizeof GIAttributeIter #} (castPtr iter)
- loop iter []
+ loop (castPtr iter) []
where -- XXX: There's probably a simpler way to do this.
zero :: Int -> Ptr Word8 -> IO ()
zero 0 _ = return ()
zero n p = poke p 0 >> zero (n - 1) (plusPtr p 1)
+ loop :: Ptr a -> [(String, String)] -> IO [(String, String)]
loop iter acc = do
name <- new nullPtr
value <- new nullPtr

0 comments on commit 997b990

Please sign in to comment.