summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-07-31 18:43:11 +0100
committerIan Lynagh <ian@well-typed.com>2013-07-31 19:42:50 +0100
commitef739635a8c2646112d2a1fa4c8715704aff1f1f (patch)
tree684650b2d0120de1eb8d50b94cdfface6ffd4d37 /compiler/utils
parent4e7eb3a0e32080acada355eae657e4e27465bc7e (diff)
downloadhaskell-ef739635a8c2646112d2a1fa4c8715704aff1f1f.tar.gz
Add NegativeLiterals extension
I'd been meaning to do this for some time, but finally got around to it due to the overflowing literals warning. With that enabled, we were getting a warning for -128 :: Int8 as that is parsed as negate (fromInteger 128) which just happens to do the right thing, as negate (fromInteger 128) = negate (-128) = -128
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Util.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index e2fd0aa093..6d42ce7dfe 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -1095,7 +1095,7 @@ charToC w =
hashString :: String -> Int32
hashString = foldl' f golden
where f m c = fromIntegral (ord c) * magic + hashInt32 m
- magic = 0xdeadbeef
+ magic = fromIntegral (0xdeadbeef :: Word32)
golden :: Int32
golden = 1013904242 -- = round ((sqrt 5 - 1) * 2^32) :: Int32