@@ -44,23 +44,23 @@ import Data.Bits (FiniteBits(..),testBit,
4444import Control.Monad.State
4545import qualified Debug.Trace
4646
47- data IfaceGetState = IfaceGetState
47+ newtype IfaceGetState = IfaceGetState
4848 { useLEB128 :: Bool -- ^ Use LEB128 encoding for numbers
4949 }
5050
5151type Get a = StateT IfaceGetState G. Get a
5252
53- enable_debug :: Bool
54- enable_debug = False
53+ enableDebug :: Bool
54+ enableDebug = False
5555
5656traceGet :: String -> Get ()
5757traceGet s
58- | enable_debug = Debug.Trace. trace s (return () )
58+ | enableDebug = Debug.Trace. trace s (return () )
5959 | otherwise = return ()
6060
6161traceShow :: Show a => String -> Get a -> Get a
6262traceShow s g
63- | not enable_debug = g
63+ | not enableDebug = g
6464 | otherwise = do
6565 a <- g
6666 traceGet (s ++ " " ++ show a)
@@ -187,7 +187,7 @@ getDictionary ptr = do
187187 return dict
188188
189189getCachedBS :: Dictionary -> Get ByteString
190- getCachedBS d = go =<< ( traceShow " Dict index:" getWord32be)
190+ getCachedBS d = go =<< traceShow " Dict index:" getWord32be
191191 where
192192 go i =
193193 case unDictionary d V. !? fromIntegral i of
@@ -609,7 +609,7 @@ getULEB128 =
609609 go shift w = do
610610 b <- getWord8
611611 let ! hasMore = testBit b 7
612- let ! val = w .|. (( clearBit (fromIntegral b) 7 ) `unsafeShiftL` shift) :: a
612+ let ! val = w .|. (clearBit (fromIntegral b) 7 `unsafeShiftL` shift) :: a
613613 if hasMore
614614 then do
615615 go (shift+ 7 ) val
@@ -631,7 +631,7 @@ getSLEB128 = do
631631 let ! more = testBit byte 7
632632 let ! shift' = shift+ 7
633633 if more
634- then go ( shift') val'
634+ then go shift' val'
635635 else do
636636 let ! signed = testBit byte 6
637637 return (val',shift',signed)
0 commit comments