-
Notifications
You must be signed in to change notification settings - Fork 2
Use lua_Number for integer numbers when lua_Integer is 32 bit. #4
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
Use lua_Number for integer numbers when lua_Integer is 32 bit. #4
Conversation
The problem occurs when lua_Number is double and lua_Integer is int32 In this case `mp.unpack(mp.pack(0xFFFFFFFF)) == -1`
Thanks! Great work getting all the CI stuff working too. I've merged your commits and the travis results are showing up at https://travis-ci.org/mattsta/lua-cmsgpack I did change your Feel free to re-run the tests on your 32 bit system and report back if I broke anything. |
oops. In fact prior Lua 5.3 there only lua_Number and we can use only it. But in this case we also should implement conversion from int64/int32 to lua_Number (C conversion is sufficient). |
I think you lost this. :) |
Yeah, it kinda vanished. The tests we added to check the fix actually pass before the commit on my system (and the CI system), so we need a better test to check for the problem. The intended target environment for this package is 64 bit Unix systems, so maybe we should just maintain a different branch to satisfy 32 bit Windows requirements? |
My usecase includes also Win2k3 x32. So this is critical for me. |
PS. This is also related to all platforms with |
This is the solution to #4 but rewritten to use compile-time pointer size determination.
This is the solution to #4 but rewritten to use compile-time pointer size determination.
This is the solution to #4 but rewritten to use compile-time pointer size determination.
This is the solution to #4 but rewritten to use compile-time pointer size determination.
Finally got this added in 3f29140! Thanks for the fix (even though it took a while)! Also, I updated the TravisCI scripts to run from the latest 5.3.0-beta (instead of work2) and from luarocks 2.2 (instead of 2.1), but that broke other things in testing (see the two broken results at https://travis-ci.org/mattsta/lua-cmsgpack/builds/41987808). If you know how to fix those issues, go ahead :) I think one issue is the new luarocks doesn't remember the |
If you want I can create PR tomorrow but it quite trivial. |
This is the solution to #4 but rewritten to use compile-time pointer size determination.
Fixed! All tests are passing for all versions: https://travis-ci.org/mattsta/lua-cmsgpack Thanks! |
I tested on WinXP x86 with Lua 5.1/5.2/5.3.beta all tests pass. |
I test on Windows XP x32.
Also I add Travis/Coveralls.io files for testing.