[internal] update convert4To32 to prevent an issue on ghc 7.0 and 7.4
This commit is contained in:
parent
e82c0524e4
commit
ac16029f07
@ -58,8 +58,9 @@ byteswap32Prim w =
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
-- | combine 4 word8 [a,b,c,d] to a word32 representing [a,b,c,d]
|
-- | combine 4 word8 [a,b,c,d] to a word32 representing [a,b,c,d]
|
||||||
convert4To32 :: (# Word#, Word#, Word#, Word# #) -> Word#
|
convert4To32 :: Word# -> Word# -> Word# -> Word#
|
||||||
convert4To32 (# a, b, c, d #) = or# (or# c1 c2) (or# c3 c4)
|
-> Word#
|
||||||
|
convert4To32 a b c d = or# (or# c1 c2) (or# c3 c4)
|
||||||
where
|
where
|
||||||
#ifdef ARCH_IS_LITTLE_ENDIAN
|
#ifdef ARCH_IS_LITTLE_ENDIAN
|
||||||
!c1 = uncheckedShiftL# a 24#
|
!c1 = uncheckedShiftL# a 24#
|
||||||
|
|||||||
@ -87,7 +87,7 @@ toHexadecimal4 bout bin n = loop 0
|
|||||||
loop (i+2)
|
loop (i+2)
|
||||||
|
|
||||||
convertByte4 :: Word# -> Word# -> Word#
|
convertByte4 :: Word# -> Word# -> Word#
|
||||||
convertByte4 a b = convert4To32 (# b2, b1, a2, a1 #)
|
convertByte4 a b = convert4To32 b2 b1 a2 a1
|
||||||
where
|
where
|
||||||
!(# a1, a2 #) = convertByte a
|
!(# a1, a2 #) = convertByte a
|
||||||
!(# b1, b2 #) = convertByte b
|
!(# b1, b2 #) = convertByte b
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user