-
-
Notifications
You must be signed in to change notification settings - Fork 754
Fix wrong data length written in UnsafeBlitFormatter
#1551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This API is added for usage in `UnsafeBlitFormatter`.
|
Just added tests. As expected, the tests failed in master branch and passed in this PR. |
AArnott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. It merits some discussion before merging.
src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackWriter.cs
Outdated
Show resolved
Hide resolved
src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Unity/Extension/UnsafeBlitFormatter.cs
Outdated
Show resolved
Hide resolved
|
By the way, although I highly doubt that it would ever run on a big-endian device, I don't think the byte order reversing code is correct. It seems to be reversing the whole data structure instead of reversing each float value. |
Also move the API from Shipped to Unshipped, because it has not in fact shipped yet.
Closes #1550.
In this PR, I added a public API so that I can get the encoded length of an integer, and then fixed the issue using the first method I mentioned in #1550.
I have yet to look into the test folder and add tests at the time of writing.Just added tests.This is my first PR to this project, so please tell me if I did anything wrong.