[Gdal-dev] Re: SWIG / TestCapability / Ruby

Charlie Savage cfis at interserv.com
Sun Oct 2 15:01:15 EDT 2005


Yes.  But do you think there would be any issues in this case? SWIG 
supports the bool datatype.  From the SWIG documentation:

"The bool datatype is cast to and from an integer value of 0 and 1 
unless the target language provides a special boolean type."

The reason for this change is so that target developers can use the 
target language's native boolean type.  If you can't do that then using 
the GDAL api will feel a bit unnatural.

Charlie

s duclos wrote:
> Nightmare are made of these 
> 
> In "Code Complete" Steve McConnell (p. 369) use:
> 
> #define TRUE (1==1)
> #define FALSE (!TRUE)
> 
> So your a bit more abstract.
> 
> C99 (and C++) has true/false already and bool type
> 
> 
> The fun start when mixing things:
> _Bool/bool/BOOL/../true/True/TRUE/etc.
> 
> 
> Sylvain.
> 
> 
> 
> --- Frank Warmerdam <warmerdam at pobox.com> wrote:
> 
>> On 10/1/05, Ari Jolma <ari.jolma at tkk.fi> wrote:
>>> Charlie Savage kirjoitti:
>>>
>>>> I would like to change the SWIG wrapper code so
>> that all the
>>>> testcapability methods return booleans.  I think
>> this is ok, since the
>>>> bindings are built using SWIG's C++ mode, so
>> boolean is a supported
>>>> data type.  That way I don't have to put in a
>> separate mapping for
>>>> these methods just in the Ruby bindings.
>>>
>>> Seems ok to me also. Note that there might be
>> other methods too subject
>>> to this change, e.g. int GDALDataTypeIsComplex(
>> GDALDataType ); in gdal.i
>>
>> Guys,
>>
>> I think this is a reasonable idea too.  Note that I
>> deliberately avoid
>> use of the boolean type in my code due to nightmares
>> in the past
>> with generically named boolean types and conflicts
>> in their
>> definition in different packages.
>>
>> Best regards,
>> --
>>
> ---------------------------------------+--------------------------------------
>> I set the clouds in motion - turn up   | Frank
>> Warmerdam, warmerdam at pobox.com
>> light and sound - activate the windows |
>> http://pobox.com/~warmerdam
>> and watch the world go round - Rush    | Geospatial
>> Programmer for Rent
>>
>> _______________________________________________
>> Gdal-dev mailing list
>> Gdal-dev at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/gdal-dev
>>
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com





More information about the Gdal-dev mailing list