From d4d75b773e985dd1afcc89026f2afa483e8a28f3 Mon Sep 17 00:00:00 2001 From: Nikita Orlov Date: Fri, 2 Apr 2021 15:45:55 +0300 Subject: Size type fix --- src/Utils.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Utils.hs') diff --git a/src/Utils.hs b/src/Utils.hs index cffcc11..81c6e8a 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -25,13 +25,13 @@ extractBits x r = fromBits $ toBits x r ------------------------------------------------------------------------------- -- Size Convertion -convertLong :: Word32 -> Word32 -> Word32 +convertLong :: Word32 -> Int -> Word32 convertLong x 1 = x .&. 0x000000FF convertLong x 2 = x .&. 0x0000FFFF convertLong x 4 = x convertLong _ s = error $ "Wrong size (" ++ show s ++ ") of convertLong" -combineLong :: Word32 -> Word32 -> Word32 -> Word32 +combineLong :: Word32 -> Word32 -> Int -> Word32 combineLong update base 1 = base .&. 0xFFFFFF00 .|. (convertLong update 1) combineLong update base 2 = base .&. 0xFFFF0000 .|. (convertLong update 2) combineLong update _ 4 = update -- cgit v1.2.3