[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] SIP and unsigned int
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2006-01-25 18:31:07
Message-ID: 200601251831.07976.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Tuesday 24 January 2006 4:12 pm, Ulrich Berning wrote:
> Hi,
>
> SIP (tested with snapshot-20060120) doesn't handle unsigned int
> correctly. SIP treats unsigned int the same as signed int and I think,
> this is wrong.
> While 4294967295 (0xffffffff) is a legal unsigned int value (on machines
> where the size of int is 32 bit of course), it is not a legal signed int
> value. The maximum legal signed int value is 2147483647 (0x7fffffff).
>
> How should I wrap a function/method, that takes/returns unsigned int's
> in the full range?
> I could replace every occurence of unsigned int with unsigned long, but
> if you are wrapping a large number of functions/methods, this is
> annoying. If you have functions/methods that take pointers to unsigned
> int, you have lost. Changing unsigned int* to unsigned long* gives me
> compiler errors.
>
> See the attached code:
>
> uinttest.h contains the definition of the class Test containing two
> member functions.
> uinttest.cpp contains the implementation
> uinttest.sip is the SIP file (look at the comments there)
> test.py is a test script
>
> I think unsigned int should be handled like unsigned long, but I can't
> say, if this would break existing code.

I don't think it should break things. Leave it with me - SIP is lying in 
pieces on the floor at the moment as I'm reimplementing the signal/slot 
support.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic