Skip to content

Commit

Permalink
Merge pull request #44 from vis256/master
Browse files Browse the repository at this point in the history
Update pack_long struct format from unsigned to signed long long
  • Loading branch information
tybug authored Oct 9, 2024
2 parents 8ccc360 + c48972c commit c27814f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions osrparse/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def unpack_int(self):
return self.unpack_once("<I")

def unpack_long(self):
return self.unpack_once("<Q")
return self.unpack_once("<q")

def unpack_once(self, specifier):
unpacked = struct.unpack_from(specifier, self.replay_data, self.offset)
Expand Down Expand Up @@ -193,7 +193,7 @@ def pack_int(self, data):
return struct.pack("<I", data)

def pack_long(self, data):
return struct.pack("<Q", data)
return struct.pack("<q", data)

def pack_ULEB128(self, data):
# https://github.com/mohanson/leb128
Expand Down
3 changes: 2 additions & 1 deletion osrparse/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def ints():
return integers(0, 2 ** 32 - 1)

def longs():
return integers(0, 2 ** 64 - 1)
r = 2**63 - 1
return integers(-r, r)

def representable_floats():
# lzma format only allows sane floats, ie no nan or inf.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "osrparse"
version = "7.0.0"
version = "7.0.1"
description = "Parser for osr files and lzma replay streams for osu!"
readme = "README.md"
keywords = ["osu!", "osr", "replay", "replays", "parsing", "parser", "python"]
Expand Down

0 comments on commit c27814f

Please sign in to comment.