]> granicus.if.org Git - postgis/commitdiff
Move lwgeom_summary to liblwgeom (#1446)
authorSandro Santilli <strk@keybit.net>
Mon, 16 Jan 2012 12:33:16 +0000 (12:33 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 16 Jan 2012 12:33:16 +0000 (12:33 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8838 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/Makefile.in
liblwgeom/lwgeom_debug.c [moved from postgis/lwgeom_debug.c with 86% similarity]
postgis/Makefile.in

index e7a52a1c2e5e5c088da0de795d2c00d5958647a7..02a2776a1e5530459d166e9e31ba7b1dd3ee31b6 100644 (file)
@@ -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 \
similarity index 86%
rename from postgis/lwgeom_debug.c
rename to liblwgeom/lwgeom_debug.c
index 5a08aeb09278eea6a37a05f1165c3d8942c13eaa..a01f113b4a64a1e54fe934bc3cee5256cdd47afe 100644 (file)
@@ -10,7 +10,7 @@
  *
  **********************************************************************/
 
-#include "lwgeom_pg.h"
+#include "lwgeom_log.h"
 #include "liblwgeom.h"
 
 #include <stdio.h>
@@ -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
+}
index 570de451352f25895123e4a4b4451a6192dd6766..8e60013dc09c4d583f82c1320cc016fac83e6a39 100644 (file)
@@ -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 \