summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2012-04-26 20:40:26 -0400
committerClint Adams <clint@debian.org>2012-04-26 20:40:26 -0400
commit00dad0cfc02fdd78abe425aa29b41855a22dea1a (patch)
tree1d2129886b5e1dc6ef620e6a7a6ae023994a019a
parent8c34729c62ba64c810fbfa73719ae7f7110c0fbe (diff)
Make hlint happy.
-rw-r--r--Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs2
-rw-r--r--Data/Digest/CRC24.hs14
2 files changed, 8 insertions, 8 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs
index 313c3bc..e3f6c34 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs
@@ -17,7 +17,7 @@ multipartMerge as = go as (Armor ArmorMessage [] BL.empty)
17 where 17 where
18 go :: [Armor] -> Armor -> Armor 18 go :: [Armor] -> Armor -> Armor
19 go [] state = state 19 go [] state = state
20 go ((Armor at hs bs):as) state = go as (go' at hs bs state) 20 go (Armor at hs bs:as) state = go as (go' at hs bs state)
21 go' :: ArmorType -> [(String,String)] -> ByteString -> Armor -> Armor 21 go' :: ArmorType -> [(String,String)] -> ByteString -> Armor -> Armor
22 go' (ArmorSplitMessage _ _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs) 22 go' (ArmorSplitMessage _ _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs)
23 go' (ArmorSplitMessageIndefinite _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs) 23 go' (ArmorSplitMessageIndefinite _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs)
diff --git a/Data/Digest/CRC24.hs b/Data/Digest/CRC24.hs
index 4586177..87b3bc9 100644
--- a/Data/Digest/CRC24.hs
+++ b/Data/Digest/CRC24.hs
@@ -14,17 +14,17 @@ import qualified Data.ByteString as B
14import qualified Data.ByteString.Lazy as BL 14import qualified Data.ByteString.Lazy as BL
15import Data.Word (Word8, Word32) 15import Data.Word (Word8, Word32)
16 16
17crc24_init :: Word32 17crc24Init :: Word32
18crc24_init = 0xB704CE 18crc24Init = 0xB704CE
19 19
20crc24_poly :: Word32 20crc24Poly :: Word32
21crc24_poly = 0x1864CFB 21crc24Poly = 0x1864CFB
22 22
23crc24_update :: Word32 -> Word8 -> Word32 23crc24Update :: Word32 -> Word8 -> Word32
24crc24_update c b = (last . take 9 $ iterate (\x -> if (shiftL x 1) .&. 0x1000000 == 0x1000000 then shiftL x 1 `xor` crc24_poly else shiftL x 1) (c `xor` shiftL (fromIntegral b) 16)) .&. 0xFFFFFF 24crc24Update c b = (last . take 9 $ iterate (\x -> if shiftL x 1 .&. 0x1000000 == 0x1000000 then shiftL x 1 `xor` crc24Poly else shiftL x 1) (c `xor` shiftL (fromIntegral b) 16)) .&. 0xFFFFFF
25 25
26crc24 :: B.ByteString -> Word32 26crc24 :: B.ByteString -> Word32
27crc24 bs = crc24Lazy . BL.fromChunks $ [bs] 27crc24 bs = crc24Lazy . BL.fromChunks $ [bs]
28 28
29crc24Lazy :: ByteString -> Word32 29crc24Lazy :: ByteString -> Word32
30crc24Lazy bs = BL.foldl crc24_update crc24_init bs 30crc24Lazy = BL.foldl crc24Update crc24Init