Patches item #1900830, was opened at 2008-02-24 13:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=745326&aid=1900830&group_id=140042
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: doc_bacardi (doc_bacardi)
Assigned to: Nobody/Anonymous (nobody)
Summary: BUILTIN_CAST breaks bitlib on windows
Initial Comment:
bitlib on windows does not work with numbers >0x80000000. It claims to support
32 bits though:
> print(bit.bits)
32
But it truncates numbers >0x80000000:
> print(string.format("%08X", bit.cast(0x40000000)))
40000000
> print(string.format("%08X", bit.cast(0x80000000)))
80000000
> print(string.format("%08X", bit.cast(0xffffffff)))
80000000
This explains strange results like this:
> print(bit.band(0xffffffff, 0x40000000))
0
This is a windows-only bug. The linux version works. Numbers are not truncated
and above "band" operation results in 0x40000000.
The attached patch fixes the problem for MSVC 7.10 .
Details:
bitlib needs to convert lua numbers to integer and offers 2 ways to do this. If
BUILTIN_CAST is defined, it uses the builtin conversion from lua, otherwise a
custom routine is used. wxLua always uses the builtin cast, and this seems to
be the source of the problem. The patch selects the custom conversion routine
if '__VISUALC__' is defined.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=745326&aid=1900830&group_id=140042
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users