[geos-devel] C-API Header diversion

Markus Schaber schabi at logix-tt.com
Thu Oct 26 07:17:55 EDT 2006


Hi, Strk,

strk at refractions.net wrote:

>> In order to automatically capture diversions between capi/geos_c.cpp and
>> capi/geos_c.h, I applied the attached patch to geos.
>>
>> Apart from being an ugly hack that I don't want to see applied
>> permanently, it tells us that most remaining differences seem to be
>> signed vs. unsigned char, and const declaration.
>>
>> Should those be fixed? And can we come up with a better scheme to
>> automatically catch diversions of those files?
> 
> I'd rather see this applied permanently, unless you see any
> drawback (I assume you also get rid of all prototypes in the
> .cpp file).

Yes, getting rid of all those prototypes would be worth the effort, I think.

But we will need get more intrusive this way, including some
preprocessor magic in geos_c.h, to avoid
geos_c.h:72: error: expected unqualified-id before '{' token

This is the first error that's spit out. This and the '#define's are the
main cause why I regard that patch as an ugly hack. :-)

> I think we can fix const vs. unconst and signed vs. unsigned,
> witout fear of breaks. IIRC the problem with signed vs. unsigned
> was with function returning -1 on exception. Those would force
> callers to cast to signed for checking...

We should fix geos_c.cpp to provide whatever geos_c.h tells, to keep
compatibility with clients, possibly using (ugly) casts in geos_c.cpp.

C++ is more picky about those issues than C, I'm afraid.

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20061026/4945d041/signature.bin


More information about the geos-devel mailing list