on master help sign in
Fix warnings reported by GHC HEAD.

--HG-- extra : convert_revision : 3e96a9507556e44f8972cffbf995cf707e6af9b3

commit7ecbb50142855c213a7b9a8240d8ebc587f2d900 authorBryan O'Sullivan <bos@serpentine.com> dateTue 17 Nov 2009, 06:12 (17 years ago) parent6bf5915
7 files changed+29−32
Data/Text/Array.hs+5−6 Data/Text/Encoding/Fusion.hs−1 Data/Text/Encoding/Utf16.hs+4−4 Data/Text/Encoding/Utf8.hs+18−18 Data/Text/Lazy.hs+1−1 Data/Text/Lazy/Internal.hs+1−1 Data/Text/Lazy/Search.hs−1
Data/Text/Array.hs+5−6
@@ -56,10 +56,10 @@ if (_k_) < 0 || (_k_) >= (_len_) then error ("Data.Text.Array." ++ (_func_) ++ "
5656#if defined(__GLASGOW_HASKELL__)
5757#include "MachDeps.h"
5858
59−import GHC.Base (ByteArray#, MutableByteArray#, Int(..), indexIntArray#,
60− indexWord16Array#, newByteArray#, readIntArray#,
61− readWord16Array#, unsafeCoerce#, writeIntArray#,
62− writeWord16Array#, (+#), (*#))
59+import GHC.Base (ByteArray#, MutableByteArray#, Int(..),
60+ indexWord16Array#, newByteArray#,
61+ readWord16Array#, unsafeCoerce#,
62+ writeWord16Array#, (*#))
6363import GHC.Prim (Int#)
6464import GHC.ST (ST(..), runST)
6565import GHC.Word (Word16(..))
@@ -78,7 +78,6 @@ import Hugs.ST (ST(..), runST)
7878
7979import Control.Exception (assert)
8080import Data.Typeable (Typeable1(..), Typeable2(..), TyCon, mkTyCon, mkTyConApp)
81−import Data.Word (Word16)
8281import Prelude hiding (length, read)
8382
8483#include "Typeable.h"
@@ -167,7 +166,7 @@ unsafeFreeze :: MArray s e -> ST s (Array e)
167166#if defined(__GLASGOW_HASKELL__)
168167
169168wORD16_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
171170
172171-- | Create an uninitialized mutable array.
173172unsafeNew :: 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
3232 ) where
3333
3434import Control.Exception (assert)
35−import Data.ByteString as B
3635import Data.ByteString.Internal (ByteString(..), mallocByteString, memcpy)
3736import Data.Text.Fusion (Step(..), Stream(..))
3837import Data.Text.Fusion.Size
Data/Text/Encoding/Utf16.hs+4−4
@@ -26,10 +26,10 @@ import GHC.Word (Word16(..))
2626chr2 :: Word16 -> Word16 -> Char
2727chr2 (W16# a#) (W16# b#) = C# (chr# (upper# +# lower# +# 0x10000#))
2828 where
29− x# = word2Int# a#
30− y# = word2Int# b#
31− upper# = uncheckedIShiftL# (x# -# 0xD800#) 10#
32− lower# = y# -# 0xDC00#
29+ !x# = word2Int# a#
30+ !y# = word2Int# b#
31+ !upper# = uncheckedIShiftL# (x# -# 0xD800#) 10#
32+ !lower# = y# -# 0xDC00#
3333{-# INLINE chr2 #-}
3434
3535validate1 :: Word16 -> Bool
Data/Text/Encoding/Utf8.hs+18−18
@@ -73,35 +73,35 @@ ord4 c = assert (n >= 0x10000) (x1,x2,x3,x4)
7373chr2 :: Word8 -> Word8 -> Char
7474chr2 (W8# x1#) (W8# x2#) = C# (chr# (z1# +# z2#))
7575 where
76− y1# = word2Int# x1#
77− y2# = word2Int# x2#
78− z1# = uncheckedIShiftL# (y1# -# 0xC0#) 6#
79− z2# = y2# -# 0x80#
76+ !y1# = word2Int# x1#
77+ !y2# = word2Int# x2#
78+ !z1# = uncheckedIShiftL# (y1# -# 0xC0#) 6#
79+ !z2# = y2# -# 0x80#
8080{-# INLINE chr2 #-}
8181
8282chr3 :: Word8 -> Word8 -> Word8 -> Char
8383chr3 (W8# x1#) (W8# x2#) (W8# x3#) = C# (chr# (z1# +# z2# +# z3#))
8484 where
85− y1# = word2Int# x1#
86− y2# = word2Int# x2#
87− y3# = word2Int# x3#
88− z1# = uncheckedIShiftL# (y1# -# 0xE0#) 12#
89− z2# = uncheckedIShiftL# (y2# -# 0x80#) 6#
90− z3# = y3# -# 0x80#
85+ !y1# = word2Int# x1#
86+ !y2# = word2Int# x2#
87+ !y3# = word2Int# x3#
88+ !z1# = uncheckedIShiftL# (y1# -# 0xE0#) 12#
89+ !z2# = uncheckedIShiftL# (y2# -# 0x80#) 6#
90+ !z3# = y3# -# 0x80#
9191{-# INLINE chr3 #-}
9292
9393chr4 :: Word8 -> Word8 -> Word8 -> Word8 -> Char
9494chr4 (W8# x1#) (W8# x2#) (W8# x3#) (W8# x4#) =
9595 C# (chr# (z1# +# z2# +# z3# +# z4#))
9696 where
97− y1# = word2Int# x1#
98− y2# = word2Int# x2#
99− y3# = word2Int# x3#
100− y4# = word2Int# x4#
101− z1# = uncheckedIShiftL# (y1# -# 0xF0#) 18#
102− z2# = uncheckedIShiftL# (y2# -# 0x80#) 12#
103− z3# = uncheckedIShiftL# (y3# -# 0x80#) 6#
104− z4# = y4# -# 0x80#
97+ !y1# = word2Int# x1#
98+ !y2# = word2Int# x2#
99+ !y3# = word2Int# x3#
100+ !y4# = word2Int# x4#
101+ !z1# = uncheckedIShiftL# (y1# -# 0xF0#) 18#
102+ !z2# = uncheckedIShiftL# (y2# -# 0x80#) 12#
103+ !z3# = uncheckedIShiftL# (y3# -# 0x80#) 6#
104+ !z4# = y4# -# 0x80#
105105{-# INLINE chr4 #-}
106106
107107validate1 :: Word8 -> Bool
Data/Text/Lazy.hs+1−1
@@ -163,7 +163,7 @@ module Data.Text.Lazy
163163 -- , sort
164164 ) where
165165
166−import Prelude (Char, Bool(..), Int, Maybe(..), String,
166+import Prelude (Char, Bool(..), Maybe(..), String,
167167 Eq(..), Ord(..), Read(..), Show(..),
168168 (&&), (+), (-), (.), ($), (++),
169169 div, flip, fromIntegral, not, otherwise)
Data/Text/Lazy/Internal.hs+1−1
@@ -31,7 +31,7 @@ module Data.Text.Lazy.Internal
3131 ) where
3232
3333import qualified Data.Text.Internal as T
34−import qualified Data.Text as T
34+import Data.Text ()
3535import Data.Typeable (Typeable)
3636import Data.Word (Word16)
3737import Foreign.Storable (sizeOf)
Data/Text/Lazy/Search.hs−1
@@ -23,7 +23,6 @@ import qualified Data.Text.Array as A
2323import Data.Int (Int64)
2424import Data.Word (Word16, Word64)
2525import qualified Data.Text.Internal as T
26−import qualified Data.Text as T
2726import Data.Text.Fusion.Internal (PairS(..))
2827import Data.Text.Lazy.Internal (Text(..), foldlChunks)
2928import Data.Bits ((.|.), (.&.))