From: simonm Date: Fri, 19 Feb 1999 10:48:27 +0000 (+0000) Subject: [project @ 1999-02-19 10:48:27 by simonm] X-Git-Tag: Approximately_9120_patches~6529 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=54c13d5cd6703878a9f9ec5ed02fee5c0e01deb9;p=ghc-hetmet.git [project @ 1999-02-19 10:48:27 by simonm] Hack around a couple of explicit uses of the Integer rep. --- diff --git a/ghc/lib/std/PrelHandle.lhs b/ghc/lib/std/PrelHandle.lhs index 10886a0..6fba7e0 100644 --- a/ghc/lib/std/PrelHandle.lhs +++ b/ghc/lib/std/PrelHandle.lhs @@ -23,7 +23,7 @@ import PrelException ( throw, ioError, catchException ) import PrelMaybe ( Maybe(..) ) import PrelAddr ( Addr, nullAddr ) import PrelBounded () -- get at Bounded Int instance. -import PrelNum ( toInteger ) +import PrelNum ( toInteger, toBig ) import PrelWeak ( addForeignFinalizer ) #if __CONCURRENT_HASKELL__ import PrelConc @@ -434,12 +434,12 @@ hFileSize handle = -- For some reason, this fails to typecheck if converted to a do -- expression --SDM _casm_ ``%r = 1;'' >>= \(I# hack#) -> - case int2Integer hack# of - result@(J# _ d#) -> do - rc <- CCALL(fileSize) (haFO__ handle_) d# -- ConcHask: SAFE, won't block + case int2Integer# hack# of + (# s, d #) -> do + rc <- CCALL(fileSize) (haFO__ handle_) d -- ConcHask: SAFE, won't block writeHandle handle handle_ if rc == (0::Int) then - return result + return (J# s d) else constructErrorAndFail "hFileSize" #endif @@ -641,6 +641,7 @@ hSeek handle mode offset = let fo = haFO__ handle_ rc <- mayBlock fo (CCALL(seekFile_int64) fo whence (primIntegerToInt64 offset)) -- ConcHask: UNSAFE, may block #else +hSeek handle mode i@(S# _) = hSeek handle mode (toBig i) hSeek handle mode (J# s# d#) = wantSeekableHandle "hSeek" handle $ \ handle_ -> do let fo = haFO__ handle_