Skip to content

Commit

Permalink
Remove the sign extension hack now that nine++ fixed it
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 12, 2018
1 parent fd7f8b6 commit 7718271
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/core/Buf.pm6
Expand Up @@ -131,23 +131,20 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is

# for simplicity's sake, these are not multis
method read-int8( int $offset, Endian $? --> int) is raw {
my \unsigned := nqp::readint(self,$offset,
nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_8_BIT,BINARY_ENDIAN_NATIVE));
unsigned >= 1 +< 7 ?? unsigned - 1 +< 8 !! unsigned
}
method read-int16(
int $offset, Endian $endian = NativeEndian --> int
) is raw {
my \unsigned := nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_16_BIT,$endian));
unsigned >= 1 +< 15 ?? unsigned - 1 +< 16 !! unsigned
nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_16_BIT,$endian))
}
method read-int32(
int $offset, Endian $endian = NativeEndian --> int
) is raw {
my \unsigned := nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_32_BIT,$endian));
unsigned >= 1 +< 31 ?? unsigned - 1 +< 32 !! unsigned
nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_32_BIT,$endian))
}
method read-int64(
int $offset, Endian $endian = NativeEndian --> int
Expand Down

0 comments on commit 7718271

Please sign in to comment.