Skip to content

Commit

Permalink
fix incorrect asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Janus Heide committed Nov 10, 2017
1 parent 40e7d15 commit b85cdd7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/endian/stream_reader.hpp
Expand Up @@ -47,7 +47,7 @@ class stream_reader : public stream
template<uint8_t Bytes, class ValueType>
void read_bytes(ValueType& value)
{
assert(sizeof(ValueType) <= remaining_size() &&
assert(Bytes <= remaining_size() &&
"Reading over the end of the underlying buffer");

// Get the value at the current position
Expand Down Expand Up @@ -113,8 +113,7 @@ class stream_reader : public stream
template<uint8_t Bytes, class ValueType>
void peek_bytes(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
assert(Bytes <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");

const uint8_t* data_position = remaining_data() + offset;
Expand All @@ -130,7 +129,6 @@ class stream_reader : public stream
template<class ValueType>
void peek(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");

Expand All @@ -145,7 +143,6 @@ class stream_reader : public stream
template<class ValueType>
ValueType peek(uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");

Expand Down

0 comments on commit b85cdd7

Please sign in to comment.