Permalink
Browse files

Fixed signed int storage.

  • Loading branch information...
1 parent 5a86437 commit 24d323b83e0cdbf8aad71b26ca5f6acb5c3d828d @whitequark committed Apr 12, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/furnace-avm2/binary/record.rb
@@ -260,7 +260,7 @@ def write_vint32(io, value, options)
end
def length_vint32(value, options)
- length_vint(value)
+ length_vint(value, true)
end
# vuint32
@@ -270,11 +270,11 @@ def read_vuint32(io, options)
end
def write_vuint32(io, value, options)
- write_vint(io, value, true)
+ write_vint(io, value, false)
end
def length_vuint32(value, options)
- length_vint(value)
+ length_vint(value, false)
end
# vuint30
@@ -284,11 +284,11 @@ def read_vuint30(io, options)
end
def write_vuint30(io, value, options)
- write_vint(io, value, true)
+ write_vint(io, value, false)
end
def length_vuint30(value, options)
- length_vint(value)
+ length_vint(value, false)
end
# vstring
@@ -468,7 +468,9 @@ def write_vint(io, value, signed)
io.write bytes.pack("C*")
end
- def length_vint(value)
+ def length_vint(value, signed)
+ value = value & 0xffffffff
+
length = 0
begin

0 comments on commit 24d323b

Please sign in to comment.