Skip to content

Commit

Permalink
Hotfixes/int64 size (#24)
Browse files Browse the repository at this point in the history
* Bug fix for integer shift size

* Bumping version
  • Loading branch information
matajoh authored May 28, 2021
1 parent 71f721a commit f1463ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [2021-05-28 - Version 1.4.1](https://github.com/matajoh/libnpy/releases/tag/v1.4.1)

Bug fixes:
- Fixed a bug with integer shifting

## [2021-05-28 - Version 1.4.0](https://github.com/matajoh/libnpy/releases/tag/v1.4.0)

Improvements:
Expand Down
7 changes: 1 addition & 6 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
Improvements:
- Further minor CMake changes to improve ease of use
- NPZ streams now have `is_open` methods to check for successful file opening
- Minor code style changes

Bug fixes:
- NPZ files will now correctly handle PKZIP versions after 2.0, both for reading and writing
- Fixed a bug with integer shifting
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.4.1
8 changes: 4 additions & 4 deletions src/npz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ void write(std::ostream &stream, std::uint64_t value)

std::uint16_t read16(std::istream &stream)
{
std::uint8_t low = stream.get();
std::uint8_t high = stream.get();
std::uint16_t low = stream.get();
std::uint16_t high = stream.get();
return low | (high << 8);
}

Expand All @@ -76,7 +76,7 @@ std::uint32_t read32(std::istream &stream)
int shift = 0;
for (int i = 0; i < 4; ++i, shift += 8)
{
std::uint8_t part = stream.get();
std::uint32_t part = stream.get();
result |= part << shift;
}

Expand All @@ -89,7 +89,7 @@ std::uint64_t read64(std::istream &stream)
int shift = 0;
for(int i=0; i<8; ++i, shift += 8)
{
std::uint8_t part = stream.get();
std::uint64_t part = stream.get();
result |= part << shift;
}

Expand Down

0 comments on commit f1463ef

Please sign in to comment.