Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
binary
Commits
b2244101
Commit
b2244101
authored
Nov 02, 2020
by
Moritz Angermann
Browse files
[CmmSized] adjust
parent
dfaf7805
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Data/Binary/Get.hs
View file @
b2244101
...
...
@@ -233,13 +233,28 @@ import qualified Data.Binary.Get.Internal as I
#
if
defined
(
__GLASGOW_HASKELL__
)
&&
!
defined
(
__HADDOCK__
)
-- needed for (# unboxing #) with magic hash
import
GHC.Base
import
GHC.Base
hiding
(
narrowWord16
#
,
extendWord16
#
)
import
GHC.Word
#
endif
-- needed for casting words to float/double
import
Data.Binary.FloatCast
(
wordToFloat
,
wordToDouble
)
#
if
MIN_VERSION_base
(
4
,
16
,
0
)
import
GHC.Exts
(
extendWord16
#
,
narrowWord16
#
)
#
else
extendWord16
#
,
extendWord32
#
::
Word
#
->
Word
#
narrowWord16
#
,
narrowWord32
#
::
Word
#
->
Word
#
extendWord16
#
w
=
w
extendWord32
#
w
=
w
narrowWord16
#
w
=
w
narrowWord32
#
w
=
w
{-# INLINE narrowWord16# #-}
{-# INLINE extendWord16# #-}
{-# INLINE narrowWord32# #-}
{-# INLINE extendWord32# #-}
#
endif
-- $lazyinterface
-- The lazy interface consumes a single lazy 'L.ByteString'. It's the easiest
-- interface to get started with, but it doesn't support interleaving I\/O and
...
...
@@ -660,8 +675,8 @@ shiftl_w32 :: Word32 -> Int -> Word32
shiftl_w64
::
Word64
->
Int
->
Word64
#
if
defined
(
__GLASGOW_HASKELL__
)
&&
!
defined
(
__HADDOCK__
)
shiftl_w16
(
W16
#
w
)
(
I
#
i
)
=
W16
#
(
w
`
uncheckedShiftL
#
`
i
)
shiftl_w32
(
W32
#
w
)
(
I
#
i
)
=
W32
#
(
w
`
uncheckedShiftL
#
`
i
)
shiftl_w16
(
W16
#
w
)
(
I
#
i
)
=
W16
#
(
narrowWord16
#
((
extendWord16
#
w
)
`
uncheckedShiftL
#
`
i
)
)
shiftl_w32
(
W32
#
w
)
(
I
#
i
)
=
W32
#
(
narrowWord32
#
((
extendWord32
#
w
)
`
uncheckedShiftL
#
`
i
)
)
#
if
WORD_SIZE_IN_BITS
<
64
shiftl_w64
(
W64
#
w
)
(
I
#
i
)
=
W64
#
(
w
`
uncheckedShiftL64
#
`
i
)
...
...
John Ericson
@Ericson2314
mentioned in commit
84e99e66
·
Feb 17, 2021
mentioned in commit
84e99e66
mentioned in commit 84e99e6683d9acc1171c78b2fb75a0ae2879d3fc
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment