[Qgis-developer] QgsRasterBlock.setColor(size_t, QRgb) in SIP

Martin Dobias wonder.sk at gmail.com
Wed Oct 30 02:50:55 PDT 2013


On Wed, Oct 30, 2013 at 4:10 PM, Radim Blazek <radim.blazek at gmail.com> wrote:
>> We should probably try to compile and run a tiny program (during CMake
>> configure phase) that will return the value of sizeof(size_t) and from
>> that generate a helper .sip file with correct definition for size_t.
>
> Is it enough to check only size? I think that unsigned and signed have
> also be distinguished.

Yes, size_t should be unsigned integer, at least 16-bit long.
http://stackoverflow.com/questions/1089176/is-size-t-always-unsigned


>> But maybe there's a better way I am not aware of...
>
> Maybe the easiest would be to define our own
>
>    typedef unsigned long qgs_size_t;

Assuming that "unsigned long" is typically 32-bit, and it is not
expected that images would not have more than 2^32 (~4E9) pixels, then
yes, why not. I would just refrain from calling it anything similar to
"size_t" to avoid confusion.

Martin


More information about the Qgis-developer mailing list