From: <kr_...@us...> - 2004-09-13 11:12:45
|
Update of /cvsroot/htoolkit/HSQL/src/HSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25888 Modified Files: SQLite.hsc Log Message: Replace Int with CInt in all FFI calls Index: SQLite.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/src/HSQL/SQLite.hsc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SQLite.hsc 10 Feb 2004 11:30:52 -0000 1.2 --- SQLite.hsc 13 Sep 2004 11:12:36 -0000 1.3 *************** *** 28,39 **** type SQLite = Ptr () ! foreign import ccall sqlite_open :: CString -> Int -> Ptr CString -> IO SQLite foreign import ccall sqlite_close :: SQLite -> IO () ! foreign import ccall sqlite_exec :: SQLite -> CString -> FunPtr () -> Ptr () -> Ptr CString -> IO Int ! foreign import ccall sqlite_get_table :: SQLite -> CString -> Ptr (Ptr CString) -> Ptr Int -> Ptr Int -> Ptr CString -> IO Int foreign import ccall sqlite_free_table :: Ptr CString -> IO () foreign import ccall sqlite_freemem :: CString -> IO () ! foreign import ccall "strlen" strlen :: CString -> IO Int ----------------------------------------------------------------------------------------- --- 28,39 ---- type SQLite = Ptr () ! foreign import ccall sqlite_open :: CString -> CInt -> Ptr CString -> IO SQLite foreign import ccall sqlite_close :: SQLite -> IO () ! foreign import ccall sqlite_exec :: SQLite -> CString -> FunPtr () -> Ptr () -> Ptr CString -> IO CInt ! foreign import ccall sqlite_get_table :: SQLite -> CString -> Ptr (Ptr CString) -> Ptr CInt -> Ptr CInt -> Ptr CString -> IO CInt foreign import ccall sqlite_free_table :: Ptr CString -> IO () foreign import ccall sqlite_freemem :: CString -> IO () ! foreign import ccall "strlen" strlen :: CString -> IO CInt ----------------------------------------------------------------------------------------- *************** *** 41,45 **** ----------------------------------------------------------------------------------------- ! handleSqlResult :: Int -> Ptr CString -> IO () handleSqlResult res ppMsg | res == (#const SQLITE_OK) = return () --- 41,45 ---- ----------------------------------------------------------------------------------------- ! handleSqlResult :: CInt -> Ptr CString -> IO () handleSqlResult res ppMsg | res == (#const SQLITE_OK) = return () *************** *** 48,52 **** msg <- peekCString pMsg sqlite_freemem pMsg ! throwDyn (SqlError "E" res msg) ----------------------------------------------------------------------------------------- --- 48,52 ---- msg <- peekCString pMsg sqlite_freemem pMsg ! throwDyn (SqlError "E" (fromIntegral res) msg) ----------------------------------------------------------------------------------------- *************** *** 105,110 **** handleSqlResult res ppMsg pResult <- peek ppResult ! rows <- peek pnRow ! columns <- peek pnColumn defs <- getFieldDefs pResult 0 columns refFalse <- newMVar False --- 105,110 ---- handleSqlResult res ppMsg pResult <- peek ppResult ! rows <- fmap fromIntegral (peek pnRow) ! columns <- fmap fromIntegral (peek pnColumn) defs <- getFieldDefs pResult 0 columns refFalse <- newMVar False *************** *** 153,157 **** else do strLen <- strlen pStr ! mb_value <- f sqlType pStr strLen case mb_value of Just v -> return (Just v) --- 153,157 ---- else do strLen <- strlen pStr ! mb_value <- f sqlType pStr (fromIntegral strLen) case mb_value of Just v -> return (Just v) |