on master help sign in
Fix warnings reported by GHC HEAD.
7ecbb50Bryan O'Sullivan
Data/Text/Array.hs+5−6
@@ -56,10 +56,10 @@ if (_k_) < 0 || (_k_) >= (_len_) then error ("Data.Text.Array." ++ (_func_) ++ "
56#if defined(__GLASGOW_HASKELL__)
56#if defined(__GLASGOW_HASKELL__)
57#include "MachDeps.h"
57#include "MachDeps.h"
58
58
59−import GHC.Base (ByteArray#, MutableByteArray#, Int(..), indexIntArray#,
59+import GHC.Base (ByteArray#, MutableByteArray#, Int(..),
60− indexWord16Array#, newByteArray#, readIntArray#,
60+ indexWord16Array#, newByteArray#,
61− readWord16Array#, unsafeCoerce#, writeIntArray#,
61+ readWord16Array#, unsafeCoerce#,
62− writeWord16Array#, (+#), (*#))
62+ writeWord16Array#, (*#))
63import GHC.Prim (Int#)
63import GHC.Prim (Int#)
64import GHC.ST (ST(..), runST)
64import GHC.ST (ST(..), runST)
65import GHC.Word (Word16(..))
65import GHC.Word (Word16(..))
@@ -78,7 +78,6 @@ import Hugs.ST (ST(..), runST)
78
78
79import Control.Exception (assert)
79import Control.Exception (assert)
80import Data.Typeable (Typeable1(..), Typeable2(..), TyCon, mkTyCon, mkTyConApp)
80import Data.Typeable (Typeable1(..), Typeable2(..), TyCon, mkTyCon, mkTyConApp)
81−import Data.Word (Word16)
82import Prelude hiding (length, read)
81import Prelude hiding (length, read)
83
82
84#include "Typeable.h"
83#include "Typeable.h"
@@ -167,7 +166,7 @@ unsafeFreeze :: MArray s e -> ST s (Array e)
167#if defined(__GLASGOW_HASKELL__)
166#if defined(__GLASGOW_HASKELL__)
168
167
169wORD16_SCALE :: Int# -> Int#
168wORD16_SCALE :: Int# -> Int#
170−wORD16_SCALE n# = scale# *# n# where I# scale# = SIZEOF_WORD16
169+wORD16_SCALE n# = scale# *# n# where !(I# scale#) = SIZEOF_WORD16
171
170
172-- | Create an uninitialized mutable array.
171-- | Create an uninitialized mutable array.
173unsafeNew :: forall s e. Elt e => Int -> ST s (MArray s e)
172unsafeNew :: forall s e. Elt e => Int -> ST s (MArray s e)
Data/Text/Encoding/Fusion.hs−1
@@ -32,7 +32,6 @@ module Data.Text.Encoding.Fusion
32 ) where
32 ) where
33
33
34import Control.Exception (assert)
34import Control.Exception (assert)
35−import Data.ByteString as B
36import Data.ByteString.Internal (ByteString(..), mallocByteString, memcpy)
35import Data.ByteString.Internal (ByteString(..), mallocByteString, memcpy)
37import Data.Text.Fusion (Step(..), Stream(..))
36import Data.Text.Fusion (Step(..), Stream(..))
38import Data.Text.Fusion.Size
37import Data.Text.Fusion.Size
Data/Text/Encoding/Utf16.hs+4−4
@@ -26,10 +26,10 @@ import GHC.Word (Word16(..))
26chr2 :: Word16 -> Word16 -> Char
26chr2 :: Word16 -> Word16 -> Char
27chr2 (W16# a#) (W16# b#) = C# (chr# (upper# +# lower# +# 0x10000#))
27chr2 (W16# a#) (W16# b#) = C# (chr# (upper# +# lower# +# 0x10000#))
28 where
28 where
29− x# = word2Int# a#
29+ !x# = word2Int# a#
30− y# = word2Int# b#
30+ !y# = word2Int# b#
31− upper# = uncheckedIShiftL# (x# -# 0xD800#) 10#
31+ !upper# = uncheckedIShiftL# (x# -# 0xD800#) 10#
32− lower# = y# -# 0xDC00#
32+ !lower# = y# -# 0xDC00#
33{-# INLINE chr2 #-}
33{-# INLINE chr2 #-}
34
34
35validate1 :: Word16 -> Bool
35validate1 :: Word16 -> Bool
Data/Text/Encoding/Utf8.hs+18−18
@@ -73,35 +73,35 @@ ord4 c = assert (n >= 0x10000) (x1,x2,x3,x4)
73chr2 :: Word8 -> Word8 -> Char
73chr2 :: Word8 -> Word8 -> Char
74chr2 (W8# x1#) (W8# x2#) = C# (chr# (z1# +# z2#))
74chr2 (W8# x1#) (W8# x2#) = C# (chr# (z1# +# z2#))
75 where
75 where
76− y1# = word2Int# x1#
76+ !y1# = word2Int# x1#
77− y2# = word2Int# x2#
77+ !y2# = word2Int# x2#
78− z1# = uncheckedIShiftL# (y1# -# 0xC0#) 6#
78+ !z1# = uncheckedIShiftL# (y1# -# 0xC0#) 6#
79− z2# = y2# -# 0x80#
79+ !z2# = y2# -# 0x80#
80{-# INLINE chr2 #-}
80{-# INLINE chr2 #-}
81
81
82chr3 :: Word8 -> Word8 -> Word8 -> Char
82chr3 :: Word8 -> Word8 -> Word8 -> Char
83chr3 (W8# x1#) (W8# x2#) (W8# x3#) = C# (chr# (z1# +# z2# +# z3#))
83chr3 (W8# x1#) (W8# x2#) (W8# x3#) = C# (chr# (z1# +# z2# +# z3#))
84 where
84 where
85− y1# = word2Int# x1#
85+ !y1# = word2Int# x1#
86− y2# = word2Int# x2#
86+ !y2# = word2Int# x2#
87− y3# = word2Int# x3#
87+ !y3# = word2Int# x3#
88− z1# = uncheckedIShiftL# (y1# -# 0xE0#) 12#
88+ !z1# = uncheckedIShiftL# (y1# -# 0xE0#) 12#
89− z2# = uncheckedIShiftL# (y2# -# 0x80#) 6#
89+ !z2# = uncheckedIShiftL# (y2# -# 0x80#) 6#
90− z3# = y3# -# 0x80#
90+ !z3# = y3# -# 0x80#
91{-# INLINE chr3 #-}
91{-# INLINE chr3 #-}
92
92
93chr4 :: Word8 -> Word8 -> Word8 -> Word8 -> Char
93chr4 :: Word8 -> Word8 -> Word8 -> Word8 -> Char
94chr4 (W8# x1#) (W8# x2#) (W8# x3#) (W8# x4#) =
94chr4 (W8# x1#) (W8# x2#) (W8# x3#) (W8# x4#) =
95 C# (chr# (z1# +# z2# +# z3# +# z4#))
95 C# (chr# (z1# +# z2# +# z3# +# z4#))
96 where
96 where
97− y1# = word2Int# x1#
97+ !y1# = word2Int# x1#
98− y2# = word2Int# x2#
98+ !y2# = word2Int# x2#
99− y3# = word2Int# x3#
99+ !y3# = word2Int# x3#
100− y4# = word2Int# x4#
100+ !y4# = word2Int# x4#
101− z1# = uncheckedIShiftL# (y1# -# 0xF0#) 18#
101+ !z1# = uncheckedIShiftL# (y1# -# 0xF0#) 18#
102− z2# = uncheckedIShiftL# (y2# -# 0x80#) 12#
102+ !z2# = uncheckedIShiftL# (y2# -# 0x80#) 12#
103− z3# = uncheckedIShiftL# (y3# -# 0x80#) 6#
103+ !z3# = uncheckedIShiftL# (y3# -# 0x80#) 6#
104− z4# = y4# -# 0x80#
104+ !z4# = y4# -# 0x80#
105{-# INLINE chr4 #-}
105{-# INLINE chr4 #-}
106
106
107validate1 :: Word8 -> Bool
107validate1 :: Word8 -> Bool
Data/Text/Lazy.hs+1−1
@@ -163,7 +163,7 @@ module Data.Text.Lazy
163 -- , sort
163 -- , sort
164 ) where
164 ) where
165
165
166−import Prelude (Char, Bool(..), Int, Maybe(..), String,
166+import Prelude (Char, Bool(..), Maybe(..), String,
167 Eq(..), Ord(..), Read(..), Show(..),
167 Eq(..), Ord(..), Read(..), Show(..),
168 (&&), (+), (-), (.), ($), (++),
168 (&&), (+), (-), (.), ($), (++),
169 div, flip, fromIntegral, not, otherwise)
169 div, flip, fromIntegral, not, otherwise)
Data/Text/Lazy/Internal.hs+1−1
@@ -31,7 +31,7 @@ module Data.Text.Lazy.Internal
31 ) where
31 ) where
32
32
33import qualified Data.Text.Internal as T
33import qualified Data.Text.Internal as T
34−import qualified Data.Text as T
34+import Data.Text ()
35import Data.Typeable (Typeable)
35import Data.Typeable (Typeable)
36import Data.Word (Word16)
36import Data.Word (Word16)
37import Foreign.Storable (sizeOf)
37import Foreign.Storable (sizeOf)
Data/Text/Lazy/Search.hs−1
@@ -23,7 +23,6 @@ import qualified Data.Text.Array as A
23import Data.Int (Int64)
23import Data.Int (Int64)
24import Data.Word (Word16, Word64)
24import Data.Word (Word16, Word64)
25import qualified Data.Text.Internal as T
25import qualified Data.Text.Internal as T
26−import qualified Data.Text as T
27import Data.Text.Fusion.Internal (PairS(..))
26import Data.Text.Fusion.Internal (PairS(..))
28import Data.Text.Lazy.Internal (Text(..), foldlChunks)
27import Data.Text.Lazy.Internal (Text(..), foldlChunks)
29import Data.Bits ((.|.), (.&.))
28import Data.Bits ((.|.), (.&.))