on master help sign in
cleanup Storable instance
commit9dff827c1579a0e8bc1c0d5b0b82ba4fdca49000 authoraslatter <aslatter@gmail.com> dateSat 20 Sep 2008, 20:21 (18 years ago) parent60d29a0
1 file changed+2−2
Data/UUID.hs+2−2
Data/UUID.hs+2−2
@@ -68,11 +68,11 @@ instance Typeable UUID where
6868 typeOf _ = mkTyConApp (mkTyCon "Data.UUID.UUID") []
6969
7070instance Storable UUID where
71− sizeOf _ = (16 *) $ alignment (undefined :: CChar)
71+ sizeOf _ = (16 *) $ sizeOf (undefined :: CChar)
7272 alignment _ = alignment (undefined :: CChar)
7373
7474 peek psource = do
75− fp <- mallocForeignPtrArray 16
75+ fp <- mallocForeignPtrArray $ sizeOf (undefined :: UUID)
7676 withForeignPtr fp $ \pdest ->
7777 memcpy pdest psource $ fromIntegral $ sizeOf (undefined :: UUID)
7878 return $ U fp