[internal] update convert4To32 to prevent an issue on ghc 7.0 and 7.4

This commit is contained in:
Vincent Hanquez 2015-05-07 13:54:05 +01:00
parent e82c0524e4
commit ac16029f07
2 changed files with 4 additions and 3 deletions

View File

@ -58,8 +58,9 @@ byteswap32Prim w =
#endif
-- | combine 4 word8 [a,b,c,d] to a word32 representing [a,b,c,d]
convert4To32 :: (# Word#, Word#, Word#, Word# #) -> Word#
convert4To32 (# a, b, c, d #) = or# (or# c1 c2) (or# c3 c4)
convert4To32 :: Word# -> Word# -> Word# -> Word#
-> Word#
convert4To32 a b c d = or# (or# c1 c2) (or# c3 c4)
where
#ifdef ARCH_IS_LITTLE_ENDIAN
!c1 = uncheckedShiftL# a 24#

View File

@ -87,7 +87,7 @@ toHexadecimal4 bout bin n = loop 0
loop (i+2)
convertByte4 :: Word# -> Word# -> Word#
convertByte4 a b = convert4To32 (# b2, b1, a2, a1 #)
convertByte4 a b = convert4To32 b2 b1 a2 a1
where
!(# a1, a2 #) = convertByte a
!(# b1, b2 #) = convertByte b