Re: [Pyobjc-dev] Re: NSAnyEventMask as unsigned?
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2003-10-29 19:09:34
|
On Oct 29, 2003, at 2:03 PM, Ronald Oussoren wrote: > > On 29 okt 2003, at 19:50, Bob Ippolito wrote: > >> >> On Oct 29, 2003, at 1:43 PM, Ronald Oussoren wrote: >> >>> >>> On 29 okt 2003, at 19:09, Bob Ippolito wrote: >>>> >>>> In any case, because this is Python, any sort of bit flag or mask=20= >>>> really needs to treated as if it were unsigned or else bad things=20= >>>> start happening and warnings get thrown all over the place (or=20 >>>> probably break in 2.4). >>> >>> There won't be warnings because we create the int/long objects from=20= >>> C, but things might still break in 2.4. >> >> Before I committed the fix, I got an exception when I used=20 >> NSAnyEventMask > > That's probably because you used NSAnyEventMask as an unsigned, and=20 > PyObjC doesn't like that. That has nothing to do with the int/long=20 > integration process (e.g. the warning you get when typing 0xFFFFFFFF=20= > in a python script). No, I used NSAnyEventMask as-is from AppKit, which was -1 (signed). =20 The problem is that the signature of =96[NSApplication=20 nextEventMatchingMask:untilDate:inMode:dequeue:] says that=20 nextEventMatchingMask is an unsigned (as would be expected for a set of=20= bit flags). I meant to mention that in my last email, but I hit send=20 before I remembered. > I'm currently updating the code generator script to detect 'Mask'=20 > values and convert those as 'unsigned int' values. That should take=20 > care of this problem. Excellent. -bob |