Skip to content

Commit

Permalink
TABI: added instance VALUE Integer
Browse files Browse the repository at this point in the history
git-svn-id: https://freearc.svn.sourceforge.net/svnroot/freearc@448 3a4f7f31-9599-433d-91b1-573e8b61252c
  • Loading branch information
bulatz committed Jul 24, 2009
1 parent 72e8334 commit e60fbeb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Compression/_TABI/tabi.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ instance Value Int where
peekValue t ptr | t == #{const TABI_INTEGER} = peek (castPtr ptr :: Ptr Int64) >>= return.Just .fromIntegral
| otherwise = return Nothing

instance Value Integer where
typeOf _ = #{const TABI_INTEGER}
pokeValue ptr a = poke (castPtr ptr :: Ptr Int64) (fromIntegral a) >> return doNothing
peekValue t ptr | t == #{const TABI_INTEGER} = peek (castPtr ptr :: Ptr Int64) >>= return.Just .fromIntegral
| otherwise = return Nothing

instance Value CUInt where
typeOf _ = #{const TABI_INTEGER}
pokeValue ptr a = poke (castPtr ptr :: Ptr Int64) (fromIntegral a) >> return doNothing
Expand Down

0 comments on commit e60fbeb

Please sign in to comment.