Hi there,

In some of my testing on GEOS SVN/PostGIS SVN I've noticed some warnings
on calls to GEOSPreparedGeom_destroy. The reason for this is that the
GEOSPrepare() constructor returns a "const PreparedGeometry *" whereas
GEOSPreparedGeom_destroy() currently accepts a "PreparedGeometry *". The
attached patch adds the missing const qualifier to
GEOSPreparedGeom_destroy which removes the warnings in PostGIS.


ATB,

Mark.
*** geos_c.h.orig	2008-10-13 12:40:38.000000000 +0100
--- geos_c.h	2008-10-13 12:44:34.000000000 +0100
***************
*** 332,338 ****
   */
  extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);
  
! extern void GEOS_DLL GEOSPreparedGeom_destroy(GEOSPreparedGeometry* g);
  
  extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
  extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
--- 332,338 ----
   */
  extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);
  
! extern void GEOS_DLL GEOSPreparedGeom_destroy(const GEOSPreparedGeometry* g);
  
  extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
  extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
*** geos_c.cpp.orig	2008-10-13 12:38:54.000000000 +0100
--- geos_c.cpp	2008-10-13 12:39:29.000000000 +0100
***************
*** 2348,2354 ****
  }
  
  void
! GEOSPreparedGeom_destroy(geos::geom::prep::PreparedGeometry *a)
  {
  	try
  	{
--- 2348,2354 ----
  }
  
  void
! GEOSPreparedGeom_destroy(const geos::geom::prep::PreparedGeometry *a)
  {
  	try
  	{
_______________________________________________
geos-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to