BitMask32 -- Long int too large to convert to int

Hi All,

I’ve been noticing a little glitch in sceneEditor.py that triggers a type
conversion error.

… /SceneEditor /seSelection.py", Line 457, in collideWithWidget
mask.setWord(0x80000000)
File “BitMask32”, line 254, in setWord
OverflowError: long Int too large to convert to int

Found this while I was patching up my copy of 1.0.3 that I built with
ppremake and it still occurs in 1.0.5 built with makepanda. I was hoping
that the new build would fix it.

If anyone else is getting this, I think you’ll see the same thing in
DirectSession.py.

Maybe this is a Python 2.4 - GCC thing. But I noticed a guy had to change
BitMask32 stuff on Visual C back in May to stop warnings. Thats in topic…

discourse.panda3d.org/viewtopic.php?t=427

As a temporary workaround, I simply changed the bitmask to (0x023C49F0)
to give it an arbitrary smaller number to work with and this fixes the
crash.

Any Ideas?

Thanks,

Robert

BTW: 0x023C49F0 is “my age” * “my shoe size” * “my postal zip code” in hex.

This is indeed a Python 2.4 thing. This is one of the little things that we have already fixed in the CVS trunk, and it will be released along with our official support of Python 2.4.

David

Thanks David,

So is support for python2.4 a long way off? Just curious.

Robert

No; in fact, there are just a handful of little things like this, which are already fixed. We are using Python 2.4 within Disney now. This will all be part of the next major release of Panda.

David

Oh, and let me suggest an alternate workaround to your hack. Instead of:


        mask.setWord(0x80000000)

Try:


        mask.setBit(31)

This sets the intended bit without having to pass a large unsigned integer.

David