summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/codeGen/CgHpc.hs2
-rw-r--r--compiler/deSugar/DsForeign.lhs2
-rw-r--r--compiler/main/BreakArray.hs4
-rw-r--r--compiler/main/SysTools.lhs11
-rw-r--r--compiler/parser/Lexer.x2
-rw-r--r--compiler/utils/Pretty.lhs2
-rw-r--r--compiler/utils/StringBuffer.lhs2
7 files changed, 16 insertions, 9 deletions
diff --git a/compiler/codeGen/CgHpc.hs b/compiler/codeGen/CgHpc.hs
index 6da243b804..811029bb18 100644
--- a/compiler/codeGen/CgHpc.hs
+++ b/compiler/codeGen/CgHpc.hs
@@ -48,7 +48,7 @@ hpcTable this_mod (HpcInfo hpc_tickCount _) = do
emitData Data $ [ CmmDataLabel (mkHpcTicksLabel this_mod)
] ++
[ CmmStaticLit (CmmInt 0 I64)
- | _ <- take hpc_tickCount [0..]
+ | _ <- take hpc_tickCount [0::Int ..]
]
where
module_name_str = moduleNameString (Module.moduleName this_mod)
diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs
index 6c58176f25..e7d5c394af 100644
--- a/compiler/deSugar/DsForeign.lhs
+++ b/compiler/deSugar/DsForeign.lhs
@@ -448,7 +448,7 @@ mkFExportCBits c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
MachRep)] -- the MachRep
arg_info = [ (text ('a':show n), showStgType ty, ty,
typeMachRep (getPrimTyOf ty))
- | (ty,n) <- zip arg_htys [1..] ]
+ | (ty,n) <- zip arg_htys [1::Int ..] ]
-- add some auxiliary args; the stable ptr in the wrapper case, and
-- a slot for the dummy return address in the wrapper + ccall case
diff --git a/compiler/main/BreakArray.hs b/compiler/main/BreakArray.hs
index dbae88a112..50a1170975 100644
--- a/compiler/main/BreakArray.hs
+++ b/compiler/main/BreakArray.hs
@@ -26,8 +26,8 @@ import Constants
data BreakArray = BA (MutableByteArray# RealWorld)
breakOff, breakOn :: Word
-breakOn = fromIntegral 1
-breakOff = fromIntegral 0
+breakOn = 1
+breakOff = 0
-- XXX crude
showBreakArray :: BreakArray -> IO ()
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index e58270d582..64e7b7803f 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -579,7 +579,8 @@ newTempName dflags extn
= do d <- getTempDir dflags
x <- getProcessID
findTempName (d ++ "/ghc" ++ show x ++ "_") 0
- where
+ where
+ findTempName :: FilePath -> Integer -> IO FilePath
findTempName prefix x
= do let filename = (prefix ++ show x) `joinFileExt` extn
b <- doesFileExist filename
@@ -596,6 +597,8 @@ getTempDir dflags@(DynFlags{tmpDir=tmp_dir})
Nothing ->
do x <- getProcessID
let prefix = tmp_dir ++ "/ghc" ++ show x ++ "_"
+ let
+ mkTempDir :: Integer -> IO FilePath
mkTempDir x
= let dirname = prefix ++ show x
in do createDirectory dirname
@@ -719,7 +722,11 @@ builderMainLoop dflags filter_fn pgm real_args mb_env = do
hSetBuffering hStdErr LineBuffering
forkIO (readerProc chan hStdOut filter_fn)
forkIO (readerProc chan hStdErr filter_fn)
- rc <- loop chan hProcess 2 1 ExitSuccess
+ -- we don't want to finish until 2 streams have been completed
+ -- (stdout and stderr)
+ -- nor until 1 exit code has been retrieved.
+ rc <- loop chan hProcess (2::Integer) (1::Integer) ExitSuccess
+ -- after that, we're done here.
hClose hStdIn
hClose hStdOut
hClose hStdErr
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 8b637da740..96f1ad2eba 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -774,7 +774,7 @@ multiline_doc_comment span buf _len = withLexedDocType (worker "")
nested_comment :: P (Located Token) -> Action
nested_comment cont span _str _len = do
input <- getInput
- go 1 input
+ go (1::Int) input
where
go 0 input = do setInput input; cont
go n input = case alexGetChar input of
diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index 96ea1fbfc5..51ecf31845 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -446,7 +446,7 @@ int n = text (show n)
integer n = text (show n)
float n = text (show n)
double n = text (show n)
-rational n = text (show (fromRat n))
+rational n = text (show (fromRat n :: Double))
--rational n = text (show (fromRationalX n)) -- _showRational 30 n)
quotes p = char '`' <> p <> char '\''
diff --git a/compiler/utils/StringBuffer.lhs b/compiler/utils/StringBuffer.lhs
index 18359456be..e02a3ba0d5 100644
--- a/compiler/utils/StringBuffer.lhs
+++ b/compiler/utils/StringBuffer.lhs
@@ -113,7 +113,7 @@ hGetStringBufferBlock handle wanted
withForeignPtr buf $ \ptr ->
do r <- if size == 0 then return 0 else hGetBuf handle ptr size
if r /= size
- then ioError (userError $ "short read of file: "++show(r,size,fromIntegral size_i,handle))
+ then ioError (userError $ "short read of file: "++show(r,size,size_i,handle))
else do pokeArray (ptr `plusPtr` size :: Ptr Word8) [0,0,0]
return (StringBuffer buf size 0)