Skip to content

Commit

Permalink
The endianness parameter of read-int8/uint8 is meaningless
Browse files Browse the repository at this point in the history
So ignore its value and just go for native
  • Loading branch information
lizmat committed Dec 11, 2018
1 parent 4f14d71 commit 011c6f1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/core/Buf.pm6
Expand Up @@ -129,11 +129,9 @@ 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 $endian = native-endian --> int
) is raw {
method read-int8( int $offset, Endian $? --> int) is raw {
nqp::readint(self,$offset,
nqp::bitor_i(BINARY_SIZE_8_BIT,$endian))
nqp::bitor_i(BINARY_SIZE_8_BIT,BINARY_ENDIAN_NATIVE))
}
method read-int16(
int $offset, Endian $endian = native-endian --> int
Expand All @@ -154,11 +152,9 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
nqp::bitor_i(BINARY_SIZE_64_BIT,$endian))
}

method read-uint8(
int $offset, Endian $endian = native-endian --> uint
) is raw {
method read-uint8(int $offset, Endian $? --> uint) is raw {
nqp::readuint(self,$offset,
nqp::bitor_i(BINARY_SIZE_8_BIT,$endian))
nqp::bitor_i(BINARY_SIZE_8_BIT,BINARY_ENDIAN_NATIVE))
}
method read-uint16(
int $offset, Endian $endian = native-endian --> uint
Expand Down

0 comments on commit 011c6f1

Please sign in to comment.