From: Sandro Santilli Date: Mon, 16 Jan 2012 12:33:16 +0000 (+0000) Subject: Move lwgeom_summary to liblwgeom (#1446) X-Git-Tag: 2.0.0alpha1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed2cc838c708d7de1e9017e7e559a21c0133224e;p=postgis Move lwgeom_summary to liblwgeom (#1446) git-svn-id: http://svn.osgeo.org/postgis/trunk@8838 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/Makefile.in b/liblwgeom/Makefile.in index e7a52a1c2..02a2776a1 100644 --- a/liblwgeom/Makefile.in +++ b/liblwgeom/Makefile.in @@ -77,6 +77,7 @@ SA_OBJS = \ lwout_geojson.o \ lwout_svg.o \ lwout_x3d.o \ + lwgeom_debug.o \ lwgeom_geos.o \ lwgeom_geos_clean.o \ lwgeom_geos_node.o \ diff --git a/postgis/lwgeom_debug.c b/liblwgeom/lwgeom_debug.c similarity index 86% rename from postgis/lwgeom_debug.c rename to liblwgeom/lwgeom_debug.c index 5a08aeb09..a01f113b4 100644 --- a/postgis/lwgeom_debug.c +++ b/liblwgeom/lwgeom_debug.c @@ -10,7 +10,7 @@ * **********************************************************************/ -#include "lwgeom_pg.h" +#include "lwgeom_log.h" #include "liblwgeom.h" #include @@ -28,7 +28,7 @@ lwtype_zmflags(uint8_t flags) if ( FLAGS_GET_BBOX(flags) ) tflags[flagno++] = 'B'; tflags[flagno] = '\0'; - POSTGIS_DEBUGF(4, "Flags: %s - returning %p", flags, tflags); + LWDEBUGF(4, "Flags: %s - returning %p", flags, tflags); return tflags; } @@ -43,7 +43,7 @@ lwpoint_summary(LWPOINT *point, int offset) char *pad=""; char *zmflags = lwtype_zmflags(point->flags); - result = palloc(128+offset); + result = (char *)lwalloc(128+offset); sprintf(result, "%*.s%s[%s]\n", offset, pad, lwtype_name(point->type), @@ -58,7 +58,7 @@ lwline_summary(LWLINE *line, int offset) char *pad=""; char *zmflags = lwtype_zmflags(line->flags); - result = palloc(128+offset); + result = (char *)lwalloc(128+offset); sprintf(result, "%*.s%s[%s] with %d points\n", offset, pad, lwtype_name(line->type), @@ -78,9 +78,9 @@ lwcollection_summary(LWCOLLECTION *col, int offset) char *pad=""; char *zmflags = lwtype_zmflags(col->flags); - POSTGIS_DEBUG(2, "lwcollection_summary called"); + LWDEBUG(2, "lwcollection_summary called"); - result = (char *)palloc(size); + result = (char *)lwalloc(size); sprintf(result, "%*.s%s[%s] with %d elements\n", offset, pad, lwtype_name(col->type), @@ -93,13 +93,13 @@ lwcollection_summary(LWCOLLECTION *col, int offset) size += strlen(tmp)+1; result = lwrealloc(result, size); - POSTGIS_DEBUGF(4, "Reallocated %d bytes for result", size); + LWDEBUGF(4, "Reallocated %d bytes for result", size); strcat(result, tmp); lwfree(tmp); } - POSTGIS_DEBUG(3, "lwcollection_summary returning"); + LWDEBUG(3, "lwcollection_summary returning"); return result; } @@ -114,9 +114,9 @@ lwpoly_summary(LWPOLY *poly, int offset) char *pad=""; char *zmflags = lwtype_zmflags(poly->flags); - POSTGIS_DEBUG(2, "lwpoly_summary called"); + LWDEBUG(2, "lwpoly_summary called"); - result = palloc(size); + result = (char *)lwalloc(size); sprintf(result, "%*.s%s[%s] with %i rings\n", offset, pad, lwtype_name(poly->type), @@ -130,7 +130,7 @@ lwpoly_summary(LWPOLY *poly, int offset) strcat(result,tmp); } - POSTGIS_DEBUG(3, "lwpoly_summary returning"); + LWDEBUG(3, "lwpoly_summary returning"); return result; } @@ -157,11 +157,11 @@ lwgeom_summary(const LWGEOM *lwgeom, int offset) case COLLECTIONTYPE: return lwcollection_summary((LWCOLLECTION *)lwgeom, offset); default: - result = palloc(256); + result = (char *)lwalloc(256); sprintf(result, "Object is of unknown type: %d", lwgeom->type); return result; } return NULL; -} \ No newline at end of file +} diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 570de4513..8e60013dc 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -22,7 +22,7 @@ DATA=../spatial_ref_sys.sql SQL_OBJS=postgis.sql.in legacy.sql.in uninstall_legacy.sql.in legacy_compatibility_layer.sql.in # PostgreSQL objects -PG_OBJS=lwgeom_debug.o \ +PG_OBJS= \ postgis_module.o \ lwgeom_accum.o \ lwgeom_spheroid.o \