hPutChar handle c = do
handle_ <- wantWriteableHandle "hPutChar" handle
let fo = haFO__ handle_
- rc <- mayBlock fo (_ccall_ filePutc fo (ord c)) -- ConcHask: UNSAFE, may block.
+ rc <- mayBlock fo (_ccall_ filePutc fo c) -- ConcHask: UNSAFE, may block.
writeHandle handle handle_
if rc == 0
then return ()
#endif
writeChars fo "" = return ()
writeChars fo (c:cs) = do
- rc <- mayBlock fo (_ccall_ filePutc fo (ord c)) -- ConcHask: UNSAFE, may block.
+ rc <- mayBlock fo (_ccall_ filePutc fo c) -- ConcHask: UNSAFE, may block.
if rc == 0
then writeChars fo cs
else constructErrorAndFail "writeChars"
hUngetChar :: Handle -> Char -> IO ()
hUngetChar handle c = do
handle_ <- wantReadableHandle "hLookAhead" handle
- rc <- _ccall_ ungetChar (haFO__ handle_) (ord c) -- ConcHask: SAFE, won't block
+ rc <- _ccall_ ungetChar (haFO__ handle_) c -- ConcHask: SAFE, won't block
writeHandle handle handle_
if rc == (-1)
then constructErrorAndFail "hUngetChar"
return c;
}
- rc = ungetChar(ptr,c);
+ rc = ungetChar(ptr,(char)c);
if ( rc < 0 ) {
return rc;
} else {
StgInt
ungetChar(ptr,c)
StgForeignObj ptr;
-StgInt c;
+StgChar c;
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc = 0, sz = 0;
StgInt
filePutc(ptr, c)
StgForeignObj ptr;
-StgInt c;
+StgChar c;
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc = 0;
/* fileLookAhead.lc */
StgInt fileLookAhead PROTO((StgForeignObj));
-StgInt ungetChar PROTO((StgForeignObj,StgInt));
+StgInt ungetChar PROTO((StgForeignObj,StgChar));
/* fileObject.lc */
void setBufFlags PROTO((StgForeignObj, StgInt));
StgInt setFilePosn PROTO((StgForeignObj, StgInt));
/* filePutc.lc */
-StgInt filePutc PROTO((StgForeignObj, StgInt));
+StgInt filePutc PROTO((StgForeignObj, StgChar));
/* fileSize.lc */
StgInt fileSize PROTO((StgForeignObj, StgByteArray));