Hi,

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?


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
Index: capi/geos_c.cpp
===================================================================
--- capi/geos_c.cpp     (revision 1879)
+++ capi/geos_c.cpp     (working copy)
@@ -50,6 +50,12 @@
 #include <string>
 #include <memory>
 
+// Some extra magic to make type declarations in geos_c.h work - for 
cross-checking of types in header.
+#define GEOSGeom_t geos::geom::Geometry
+#define GEOSCoordSeq_t geos::geom::CoordinateSequence
+#define GEOSGeomTypes geos::geom::GeometryTypeId
+#include "geos_c.h"
+
 /// Define this if you want operations triggering Exceptions to
 /// be printed (will use the NOTIFY channel - only implemented for GEOSUnion 
so far)
 ///
geos_c.h:72: error: expected unqualified-id before '{' token
geos_c.cpp:95: error: declaration of C function 'geos::geom::Geometry* 
GEOSGeomFromWKB_buf(const char*, size_t)' conflicts with
geos_c.h:131: error: previous declaration 'geos::geom::Geometry* 
GEOSGeomFromWKB_buf(const unsigned char*, size_t)' here
geos_c.cpp:96: error: declaration of C function 'geos::geom::Geometry* 
GEOSGeomFromHEX_buf(const char*, size_t)' conflicts with
geos_c.h:134: error: previous declaration 'geos::geom::Geometry* 
GEOSGeomFromHEX_buf(const unsigned char*, size_t)' here
geos_c.cpp:97: error: declaration of C function 'char* GEOSGeomToWKT(const 
geos::geom::Geometry*)' conflicts with
geos_c.h:115: error: previous declaration 'char* 
GEOSGeomToWKT(geos::geom::Geometry*)' here
geos_c.cpp:98: error: declaration of C function 'char* GEOSGeomToWKB_buf(const 
geos::geom::Geometry*, size_t*)' conflicts with
geos_c.h:132: error: previous declaration 'unsigned char* 
GEOSGeomToWKB_buf(geos::geom::Geometry*, size_t*)' here
geos_c.cpp:99: error: declaration of C function 'char* GEOSGeomToHEX_buf(const 
geos::geom::Geometry*, size_t*)' conflicts with
geos_c.h:135: error: previous declaration 'unsigned char* 
GEOSGeomToHEX_buf(geos::geom::Geometry*, size_t*)' here
geos_c.cpp:107: error: declaration of C function 'char* GEOSRelate(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:248: error: previous declaration 'char* 
GEOSRelate(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:108: error: declaration of C function 'char GEOSRelatePattern(const 
geos::geom::Geometry*, const geos::geom::Geometry*, const char*)' conflicts with
geos_c.h:263: error: previous declaration 'char 
GEOSRelatePattern(geos::geom::Geometry*, geos::geom::Geometry*, const char*)' 
here
geos_c.cpp:109: error: declaration of C function 'char GEOSDisjoint(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:264: error: previous declaration 'char 
GEOSDisjoint(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:110: error: declaration of C function 'char GEOSTouches(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:265: error: previous declaration 'char 
GEOSTouches(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:111: error: declaration of C function 'char GEOSIntersects(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:266: error: previous declaration 'char 
GEOSIntersects(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:112: error: declaration of C function 'char GEOSCrosses(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:267: error: previous declaration 'char 
GEOSCrosses(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:113: error: declaration of C function 'char GEOSWithin(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:268: error: previous declaration 'char 
GEOSWithin(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:114: error: declaration of C function 'char GEOSContains(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:269: error: previous declaration 'char 
GEOSContains(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:115: error: declaration of C function 'char GEOSOverlaps(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:270: error: previous declaration 'char 
GEOSOverlaps(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:118: error: declaration of C function 'char GEOSisValid(const 
geos::geom::Geometry*)' conflicts with
geos_c.h:282: error: previous declaration 'char 
GEOSisValid(geos::geom::Geometry*)' here
geos_c.cpp:119: error: declaration of C function 'char GEOSisEmpty(const 
geos::geom::Geometry*)' conflicts with
geos_c.h:281: error: previous declaration 'char 
GEOSisEmpty(geos::geom::Geometry*)' here
geos_c.cpp:128: error: declaration of C function 'const geos::geom::Geometry* 
GEOSGetGeometryN(geos::geom::Geometry*, int)' conflicts with
geos_c.h:313: error: previous declaration 'geos::geom::Geometry* const 
GEOSGetGeometryN(geos::geom::Geometry*, unsigned int)' here
geos_c.cpp:129: error: declaration of C function 'const geos::geom::Geometry* 
GEOSGetExteriorRing(geos::geom::Geometry*)' conflicts with
geos_c.h:333: error: previous declaration 'geos::geom::Geometry* const 
GEOSGetExteriorRing(geos::geom::Geometry*)' here
geos_c.cpp:130: error: declaration of C function 'const geos::geom::Geometry* 
GEOSGetInteriorRingN(geos::geom::Geometry*, int)' conflicts with
geos_c.h:326: error: previous declaration 'geos::geom::Geometry* const 
GEOSGetInteriorRingN(geos::geom::Geometry*, unsigned int)' here
geos_c.cpp:134: error: declaration of C function 'int 
GEOSGetNumGeometries(geos::geom::Geometry*)' conflicts with
geos_c.h:306: error: previous declaration 'unsigned int 
GEOSGetNumGeometries(geos::geom::Geometry*)' here
geos_c.cpp:136: error: declaration of C function 'char GEOSEquals(const 
geos::geom::Geometry*, const geos::geom::Geometry*)' conflicts with
geos_c.h:271: error: previous declaration 'char 
GEOSEquals(geos::geom::Geometry*, geos::geom::Geometry*)' here
geos_c.cpp:137: error: declaration of C function 'char GEOSEqualsExact(const 
geos::geom::Geometry*, const geos::geom::Geometry*, double)' conflicts with
geos_c.h:272: error: previous declaration 'char 
GEOSEqualsExact(geos::geom::Geometry*, geos::geom::Geometry*, double)' here
geos_c.cpp:141: error: declaration of C function 
'geos::geom::CoordinateSequence* GEOSGeom_getCoordSeq(geos::geom::Geometry*)' 
conflicts with
geos_c.h:342: error: previous declaration 'geos::geom::CoordinateSequence* 
const GEOSGeom_getCoordSeq(geos::geom::Geometry*)' here
geos_c.cpp:143: error: declaration of C function 'int GEOSArea(const 
geos::geom::Geometry*, double*)' conflicts with
geos_c.h:356: error: previous declaration 'int GEOSArea(geos::geom::Geometry*, 
double*)' here
geos_c.cpp:144: error: declaration of C function 'int GEOSLength(const 
geos::geom::Geometry*, double*)' conflicts with
geos_c.h:357: error: previous declaration 'int 
GEOSLength(geos::geom::Geometry*, double*)' here
geos_c.cpp:146: error: declaration of C function 'int GEOSDistance(const 
geos::geom::Geometry*, const geos::geom::Geometry*, double*)' conflicts with
geos_c.h:359: error: previous declaration 'int 
GEOSDistance(geos::geom::Geometry*, geos::geom::Geometry*, double*)' here
geos_c.cpp:159: error: declaration of C function 'bool 
GEOSHasZ(geos::geom::Geometry*)' conflicts with
geos_c.h:285: error: previous declaration 'char 
GEOSHasZ(geos::geom::Geometry*)' here
geos_c.cpp:161: error: declaration of C function 'geos::geom::Geometry* 
GEOSPolygonize(geos::geom::Geometry**, unsigned int)' conflicts with
geos_c.h:250: error: previous declaration 'geos::geom::Geometry* 
GEOSPolygonize(geos::geom::Geometry* const*, unsigned int)' here
geos_c.cpp:164: error: declaration of C function 'int 
GEOSGeom_getDimensions(const geos::geom::Geometry*)' conflicts with
geos_c.h:347: error: previous declaration 'unsigned int 
GEOSGeom_getDimensions(geos::geom::Geometry*)' here
geos_c.cpp:165: error: declaration of C function 'int 
GEOSGetNumCoordinates(const geos::geom::Geometry*)' conflicts with
geos_c.h:336: error: previous declaration 'int 
GEOSGetNumCoordinates(geos::geom::Geometry*)' here

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
geos-devel mailing list
geos-devel@geos.refractions.net
http://geos.refractions.net/mailman/listinfo/geos-devel

Reply via email to