Commit 78c109c5 authored by Paul Ramsey's avatar Paul Ramsey

Complete the pfree_ to lwfree_ renaming.

git-svn-id: http://svn.osgeo.org/postgis/[email protected] b70326c6-7e19-0410-871a-916f4a2858ee
parent d7bafd67
......@@ -79,7 +79,7 @@ int main()
/* Free all of the allocated items */
lwfree(lwg_unparser_result.wkoutput);
lwfree(serialized_lwgeom);
free_point(testpoint);
lwfree_point(testpoint);
lwfree(dpa);
......
......@@ -1666,7 +1666,7 @@ compute_serialized_box3d(uchar *srl)
LWDEBUG(3, "compute_serialized_box3d: bbox found");
free_point(pt);
lwfree_point(pt);
return result;
}
......
......@@ -300,7 +300,7 @@ lwpoint_deserialize(uchar *serialized_form)
return result;
}
void free_point (LWPOINT *pt)
void lwfree_point (LWPOINT *pt)
{
lwfree_pointarray(pt->point);
lwfree(pt);
......
......@@ -899,7 +899,7 @@ InsertLineString()
for (u = 0; u < obj->nParts; u++)
{
pfree_line(lwgeom_as_lwline(lwmultilinestrings[u]));
lwfree_line(lwgeom_as_lwline(lwmultilinestrings[u]));
lwfree(dpas[u]);
}
......@@ -1190,7 +1190,7 @@ InsertPolygon(void)
/* Cycle through each polygon, freeing everything we need... */
for (u = 0; u < polygon_total; u++)
pfree_polygon(lwgeom_as_lwpoly(lwpolygons[u]));
lwfree_polygon(lwgeom_as_lwpoly(lwpolygons[u]));
/* Free the pointer arrays */
lwfree(pas);
......@@ -1281,7 +1281,7 @@ InsertPoint(void)
for (u = 0; u < obj->nVertices; u++)
{
free_point(lwgeom_as_lwpoint(lwmultipoints[u]));
lwfree_point(lwgeom_as_lwpoint(lwmultipoints[u]));
lwfree(dpas[u]);
}
......
......@@ -379,7 +379,7 @@ Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
1);
point = lwpoint_construct(line->SRID, 0, opa);
srl = lwpoint_serialize(point);
free_point(point);
lwfree_point(point);
PG_RETURN_POINTER(PG_LWGEOM_construct(srl, line->SRID, 0));
}
......@@ -414,7 +414,7 @@ Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
1);
point = lwpoint_construct(line->SRID, 0, opa);
srl = lwpoint_serialize(point);
free_point(point);
lwfree_point(point);
PG_RETURN_POINTER(PG_LWGEOM_construct(srl, line->SRID, 0));
}
tlength += slength;
......@@ -429,7 +429,7 @@ Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
1);
point = lwpoint_construct(line->SRID, 0, opa);
srl = lwpoint_serialize(point);
free_point(point);
lwfree_point(point);
PG_RETURN_POINTER(PG_LWGEOM_construct(srl, line->SRID, 0));
}
/***********************************************************************
......
......@@ -288,7 +288,7 @@ lwgeom_nrings_recursive(uchar *serialized)
}
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
return nrings;
}
......@@ -356,7 +356,7 @@ Datum LWGEOM_area_polygon(PG_FUNCTION_ARGS)
POSTGIS_DEBUGF(3, " LWGEOM_area_polygon found a poly (%f)", area);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_FLOAT8(area);
......@@ -389,7 +389,7 @@ Datum LWGEOM_length2d_linestring(PG_FUNCTION_ARGS)
POSTGIS_DEBUGF(3, " LWGEOM_length2d found a line (%f)", dist);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_FLOAT8(dist);
......@@ -418,7 +418,7 @@ Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS)
dist += lwgeom_pointarray_length(line->points);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_FLOAT8(dist);
......@@ -447,7 +447,7 @@ Datum LWGEOM_perimeter_poly(PG_FUNCTION_ARGS)
ret += lwgeom_polygon_perimeter(poly);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_FLOAT8(ret);
......@@ -476,7 +476,7 @@ Datum LWGEOM_perimeter2d_poly(PG_FUNCTION_ARGS)
ret += lwgeom_polygon_perimeter2d(poly);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_FLOAT8(ret);
......@@ -701,7 +701,7 @@ lwgeom_force2d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
LWDEBUGF(3, "lwgeom_force2d_recursive: added elem %d size: %d (tot: %d)",
i, size, totsize);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
LWDEBUG(3, "lwgeom_force2d_recursive returning");
......@@ -889,7 +889,7 @@ lwgeom_force3dz_recursive(uchar *serialized, uchar *optr, size_t *retsize)
LWDEBUGF(3, " elem %d size: %d (tot: %d)", i, size, totsize);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
*retsize = totsize;
}
......@@ -1111,7 +1111,7 @@ lwgeom_force3dm_recursive(uchar *serialized, uchar *optr, size_t *retsize)
LWDEBUGF(3, "lwgeom_force3dm_recursive: added elem %d size: %d (tot: %d)",
i, size, totsize);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
LWDEBUG(3, "lwgeom_force3dm_recursive returning");
......@@ -1297,7 +1297,7 @@ lwgeom_force4d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
LWDEBUGF(3, " elem %d size: %d (tot: %d)", i, size, totsize);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
*retsize = totsize;
}
......@@ -3258,7 +3258,7 @@ lwgeom_affine_recursive(uchar *serialized,
xoff, yoff, zoff);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
}
/*affine transform geometry */
......
......@@ -470,7 +470,7 @@ asgeojson_multipoint_buf(LWGEOM_INSPECTED *insp, char *srs, char *output, BOX3D
if (i) ptr += sprintf(ptr, ",");
point=lwgeom_getpoint_inspected(insp, i);
ptr += pointArray_to_geojson(point->point, ptr, precision);
free_point(point);
lwfree_point(point);
}
ptr += sprintf(ptr, "]}");
......@@ -538,7 +538,7 @@ asgeojson_multiline_buf(LWGEOM_INSPECTED *insp, char *srs, char *output, BOX3D *
ptr += pointArray_to_geojson(line->points, ptr, precision);
ptr += sprintf(ptr, "]");
pfree_line(line);
lwfree_line(line);
}
ptr += sprintf(ptr, "]}");
......@@ -614,7 +614,7 @@ asgeojson_multipolygon_buf(LWGEOM_INSPECTED *insp, char *srs, char *output, BOX3
ptr += sprintf(ptr, "]");
}
ptr += sprintf(ptr, "]");
pfree_polygon(poly);
lwfree_polygon(poly);
}
ptr += sprintf(ptr, "]}");
......@@ -658,7 +658,7 @@ asgeojson_collection_size(LWGEOM_INSPECTED *insp, char *srs, BOX3D *bbox, int pr
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
size += asgeojson_inspected_size(subinsp, bbox, precision);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
size += sizeof(",") * i;
size += sizeof("]}");
......@@ -685,7 +685,7 @@ asgeojson_collection_buf(LWGEOM_INSPECTED *insp, char *srs, char *output, BOX3D
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
ptr += asgeojson_inspected_buf(subinsp, ptr, bbox, precision);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
ptr += sprintf(ptr, "]}");
......@@ -721,19 +721,19 @@ asgeojson_inspected_size(LWGEOM_INSPECTED *insp, BOX3D *bbox, int precision)
case POINTTYPE:
point=lwgeom_getpoint_inspected(insp, 0);
size = asgeojson_point_size(point, NULL, bbox, precision);
free_point(point);
lwfree_point(point);
break;
case LINETYPE:
line=lwgeom_getline_inspected(insp, 0);
size = asgeojson_line_size(line, NULL, bbox, precision);
pfree_line(line);
lwfree_line(line);
break;
case POLYGONTYPE:
poly=lwgeom_getpoly_inspected(insp, 0);
size = asgeojson_poly_size(poly, NULL, bbox, precision);
pfree_polygon(poly);
lwfree_polygon(poly);
break;
case MULTIPOINTTYPE:
......@@ -776,19 +776,19 @@ asgeojson_inspected_buf(LWGEOM_INSPECTED *insp, char *output, BOX3D *bbox, int p
case POINTTYPE:
point=lwgeom_getpoint_inspected(insp, 0);
ptr += asgeojson_point_buf(point, NULL, ptr, bbox, precision);
free_point(point);
lwfree_point(point);
break;
case LINETYPE:
line=lwgeom_getline_inspected(insp, 0);
ptr += asgeojson_line_buf(line, NULL, ptr, bbox, precision);
pfree_line(line);
lwfree_line(line);
break;
case POLYGONTYPE:
poly=lwgeom_getpoly_inspected(insp, 0);
ptr += asgeojson_poly_buf(poly, NULL, ptr, bbox, precision);
pfree_polygon(poly);
lwfree_polygon(poly);
break;
case MULTIPOINTTYPE:
......
......@@ -324,24 +324,24 @@ asgml2_inspected_size(LWGEOM_INSPECTED *insp, char *srs)
if ((point=lwgeom_getpoint_inspected(insp, i)))
{
size += asgml2_point_size(point, 0);
free_point(point);
lwfree_point(point);
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
size += asgml2_line_size(line, 0);
pfree_line(line);
lwfree_line(line);
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
size += asgml2_poly_size(poly, 0);
pfree_polygon(poly);
lwfree_polygon(poly);
}
else
{
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
size += asgml2_inspected_size(subinsp, 0);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......@@ -384,21 +384,21 @@ asgml2_inspected_buf(LWGEOM_INSPECTED *insp, char *srs, char *output)
{
ptr += sprintf(ptr, "<gml:pointMember>");
ptr += asgml2_point_buf(point, 0, ptr);
free_point(point);
lwfree_point(point);
ptr += sprintf(ptr, "</gml:pointMember>");
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
ptr += sprintf(ptr, "<gml:lineStringMember>");
ptr += asgml2_line_buf(line, 0, ptr);
pfree_line(line);
lwfree_line(line);
ptr += sprintf(ptr, "</gml:lineStringMember>");
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
ptr += sprintf(ptr, "<gml:polygonMember>");
ptr += asgml2_poly_buf(poly, 0, ptr);
pfree_polygon(poly);
lwfree_polygon(poly);
ptr += sprintf(ptr, "</gml:polygonMember>");
}
else
......@@ -406,7 +406,7 @@ asgml2_inspected_buf(LWGEOM_INSPECTED *insp, char *srs, char *output)
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
ptr += asgml2_inspected_buf(subinsp, 0, ptr);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......@@ -681,24 +681,24 @@ asgml3_inspected_size(LWGEOM_INSPECTED *insp, char *srs)
if ((point=lwgeom_getpoint_inspected(insp, i)))
{
size += asgml3_point_size(point, 0);
free_point(point);
lwfree_point(point);
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
size += asgml3_line_size(line, 0);
pfree_line(line);
lwfree_line(line);
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
size += asgml3_poly_size(poly, 0);
pfree_polygon(poly);
lwfree_polygon(poly);
}
else
{
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
size += asgml3_inspected_size(subinsp, 0);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......@@ -741,21 +741,21 @@ asgml3_inspected_buf(LWGEOM_INSPECTED *insp, char *srs, char *output)
{
ptr += sprintf(ptr, "<gml:pointMember>");
ptr += asgml3_point_buf(point, 0, ptr);
free_point(point);
lwfree_point(point);
ptr += sprintf(ptr, "</gml:pointMember>");
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
ptr += sprintf(ptr, "<gml:curveMember>");
ptr += asgml3_line_buf(line, 0, ptr);
pfree_line(line);
lwfree_line(line);
ptr += sprintf(ptr, "</gml:curveMember>");
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
ptr += sprintf(ptr, "<gml:surfaceMember>");
ptr += asgml3_poly_buf(poly, 0, ptr);
pfree_polygon(poly);
lwfree_polygon(poly);
ptr += sprintf(ptr, "</gml:surfaceMember>");
}
else
......@@ -763,7 +763,7 @@ asgml3_inspected_buf(LWGEOM_INSPECTED *insp, char *srs, char *output)
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
ptr += asgml3_inspected_buf(subinsp, 0, ptr);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......
......@@ -284,24 +284,24 @@ askml2_inspected_size(LWGEOM_INSPECTED *insp)
if ((point=lwgeom_getpoint_inspected(insp, i)))
{
size += askml2_point_size(point);
free_point(point);
lwfree_point(point);
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
size += askml2_line_size(line);
pfree_line(line);
lwfree_line(line);
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
size += askml2_poly_size(poly);
pfree_polygon(poly);
lwfree_polygon(poly);
}
else
{
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
size += askml2_inspected_size(subinsp);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......@@ -334,24 +334,24 @@ askml2_inspected_buf(LWGEOM_INSPECTED *insp, char *output)
if ((point=lwgeom_getpoint_inspected(insp, i)))
{
ptr += askml2_point_buf(point, ptr);
free_point(point);
lwfree_point(point);
}
else if ((line=lwgeom_getline_inspected(insp, i)))
{
ptr += askml2_line_buf(line, ptr);
pfree_line(line);
lwfree_line(line);
}
else if ((poly=lwgeom_getpoly_inspected(insp, i)))
{
ptr += askml2_poly_buf(poly, ptr);
pfree_polygon(poly);
lwfree_polygon(poly);
}
else
{
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
ptr += askml2_inspected_buf(subinsp, ptr);
pfree_inspected(subinsp);
lwfree_inspected(subinsp);
}
}
......
......@@ -207,12 +207,12 @@ lwgeom_numpoints_linestring_recursive(const uchar *serialized)
npoints = lwgeom_numpoints_linestring_recursive(subgeom);
if ( npoints == -1 ) continue;
pfree_inspected(inspected);
lwfree_inspected(inspected);
return npoints;
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
return -1;
}
......@@ -354,7 +354,7 @@ lwgeom_dimension_recursive(const uchar *serialized)
{
subgeom = lwgeom_getsubgeometry_inspected(inspected, i);
if ( subgeom == NULL ) {
pfree_inspected(inspected);
lwfree_inspected(inspected);
return -2;
}
......@@ -362,13 +362,13 @@ lwgeom_dimension_recursive(const uchar *serialized)
}
if ( dims == 2 ) { /* nothing can be higher */
pfree_inspected(inspected);
lwfree_inspected(inspected);
return 2;
}
if ( dims > ret ) ret = dims;
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
return ret;
}
......@@ -493,7 +493,7 @@ Datum LWGEOM_numinteriorrings_polygon(PG_FUNCTION_ARGS)
if ( tmp == NULL ) {
PG_FREE_IF_COPY(geom, 0);
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_RETURN_NULL();
}
......@@ -516,11 +516,11 @@ Datum LWGEOM_numinteriorrings_polygon(PG_FUNCTION_ARGS)
else
{
PG_FREE_IF_COPY(geom, 0);
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_RETURN_NULL();
}
PG_FREE_IF_COPY(geom, 0);
if(inspected != NULL) pfree_inspected(inspected);
if(inspected != NULL) lwfree_inspected(inspected);
lwgeom_release((LWGEOM *)tmp);
PG_RETURN_INT32(result);
......@@ -654,7 +654,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
}
if ( tmp == NULL ) {
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_NULL();
}
......@@ -663,12 +663,12 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
curve = (LWCURVE *)tmp;
if(wanted_index > curve->points->npoints)
{
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
lwgeom_release(tmp);
PG_RETURN_NULL();
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
pts = pointArray_construct(getPoint_internal(
curve->points,
......@@ -682,12 +682,12 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
/* Ok, now we have a line. Let's see if it has enough points. */
if ( wanted_index > line->points->npoints )
{
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
lwgeom_release(tmp);
PG_RETURN_NULL();
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
/* Construct a point array */
pts = pointArray_construct(getPoint_internal(line->points,
......@@ -696,7 +696,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
}
else
{
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
lwgeom_release(tmp);
PG_RETURN_NULL();
......@@ -925,7 +925,7 @@ Datum LWGEOM_endpoint_linestring(PG_FUNCTION_ARGS)
line = lwgeom_getline_inspected(inspected, i);
if ( line ) break;
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
if ( line == NULL ) {
PG_FREE_IF_COPY(geom, 0);
......@@ -1254,7 +1254,7 @@ Datum LWGEOM_isclosed_linestring(PG_FUNCTION_ARGS)
!line_is_closed((LWLINE *)sub))
{
lwgeom_release(sub);
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_BOOL(FALSE);
}
......@@ -1262,7 +1262,7 @@ Datum LWGEOM_isclosed_linestring(PG_FUNCTION_ARGS)
!curve_is_closed((LWCURVE *)sub))
{
lwgeom_release(sub);
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_BOOL(FALSE);
}
......@@ -1270,14 +1270,14 @@ Datum LWGEOM_isclosed_linestring(PG_FUNCTION_ARGS)
!compound_is_closed((LWCOMPOUND *)sub))
{
lwgeom_release(sub);
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_FREE_IF_COPY(geom, 0);
PG_RETURN_BOOL(FALSE);
}
lwgeom_release(sub);
linesfound++;
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
if ( ! linesfound ) {
PG_FREE_IF_COPY(geom, 0);
......
......@@ -402,7 +402,7 @@ Datum LWGEOM_length2d_ellipsoid_linestring(PG_FUNCTION_ARGS)
dist);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_RETURN_FLOAT8(dist);
}
......@@ -440,7 +440,7 @@ Datum LWGEOM_length_ellipsoid_linestring(PG_FUNCTION_ARGS)
dist);
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
PG_RETURN_FLOAT8(dist);
}
......
......@@ -727,20 +727,20 @@ lwgeom_transform_recursive(uchar *geom, PJ *inpj, PJ *outpj)
{
if (!lwgeom_transform_recursive(subgeom, inpj, outpj))
{
pfree_inspected(inspected);
lwfree_inspected(inspected);
return 0;
}
continue;
}
else
{
pfree_inspected(inspected);
lwfree_inspected(inspected);
lwerror("lwgeom_getsubgeometry_inspected returned NULL");
return 0;
}
}
pfree_inspected(inspected);
lwfree_inspected(inspected);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment