on master help sign in
Avoid a char/int warning
dd28678Neil Mitchell
gen/Lib.hs+2−2
@@ -102,8 +102,8 @@ implies known x = all (fromCharSet x) poss
102
102
103charSetC :: [CharSet] -> ([String], CharSet -> String)
103charSetC :: [CharSet] -> ([String], CharSet -> String)
104charSetC sets =
104charSetC sets =
105− (["static const char internal_parse_table[256] = {" ++ intercalate "," ("0":map disp chars) ++ "};"]
105+ (["static const char table[256] = {" ++ intercalate "," ("0":map disp chars) ++ "};"]
106− ,\x -> fromMaybe ("internal_parse_table[*p] & " ++ showBit (bit $ fromJust $ elemIndex x hard)) $ simple x)
106+ ,\x -> fromMaybe ("table[(int) *p] & " ++ showBit (bit $ fromJust $ elemIndex x hard)) $ simple x)
107 where
107 where
108 showBit x = "0x" ++ showHex (x :: Int) ""
108 showBit x = "0x" ++ showHex (x :: Int) ""
109 disp c = showBit $ foldr (.|.) 0 [bit i | (i, h) <- zip [0..] hard, fromCharSet h c]
109 disp c = showBit $ foldr (.|.) 0 [bit i | (i, h) <- zip [0..] hard, fromCharSet h c]