[postgis-tickets] r15565 - [style only] remove trailing blanks

Sandro Santilli strk at kbt.io
Tue Aug 22 05:38:59 PDT 2017


Author: strk
Date: 2017-08-22 05:38:59 -0700 (Tue, 22 Aug 2017)
New Revision: 15565

Modified:
   trunk/liblwgeom/lwcircstring.c
   trunk/liblwgeom/lwgeom.c
Log:
[style only] remove trailing blanks

Modified: trunk/liblwgeom/lwcircstring.c
===================================================================
--- trunk/liblwgeom/lwcircstring.c	2017-08-21 17:15:14 UTC (rev 15564)
+++ trunk/liblwgeom/lwcircstring.c	2017-08-22 12:38:59 UTC (rev 15565)
@@ -65,7 +65,7 @@
 	result = (LWCIRCSTRING*) lwalloc(sizeof(LWCIRCSTRING));
 
 	result->type = CIRCSTRINGTYPE;
-	
+
 	result->flags = points->flags;
 	FLAGS_SET_BBOX(result->flags, bbox?1:0);
 
@@ -98,7 +98,7 @@
 void lwcircstring_free(LWCIRCSTRING *curve)
 {
 	if ( ! curve ) return;
-	
+
 	if ( curve->bbox )
 		lwfree(curve->bbox);
 	if ( curve->points )
@@ -188,7 +188,7 @@
 		ptr += ptsize;
 	}
 	pa = ptarray_construct_reference_data(zmflag&2, zmflag&1, npoints, newpoints);
-	
+
 	return lwcircstring_construct(srid, NULL, pa);
 }
 
@@ -223,7 +223,7 @@
 	}
 
 	pa = ptarray_construct_reference_data(zmflag&2, zmflag&1, mpoint->ngeoms, newpoints);
-	
+
 	LWDEBUGF(3, "lwcurve_from_lwmpoint: constructed pointarray for %d points, %d zmflag", mpoint->ngeoms, zmflag);
 
 	return lwcircstring_construct(srid, NULL, pa);
@@ -289,7 +289,7 @@
 {
 	if ( lwcircstring_is_empty(circ) )
 		return 0.0;
-	
+
 	return ptarray_arc_length_2d(circ->points);
 }
 

Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c	2017-08-21 17:15:14 UTC (rev 15564)
+++ trunk/liblwgeom/lwgeom.c	2017-08-22 12:38:59 UTC (rev 15565)
@@ -512,7 +512,7 @@
 {
 	char* wkt = NULL;
 	size_t wkt_size = 0;
-	
+
 	wkt = lwgeom_to_wkt(lwgeom, WKT_EXTENDED, 12, &wkt_size);
 
 	if ( ! wkt )
@@ -612,7 +612,7 @@
 
 	if ( ! p || ! p->point )
 		return LW_FALSE;
-		
+
 	pt = getPoint2d_cp(p->point, 0);
 
 	center.x = cx;
@@ -655,17 +655,17 @@
 	if ( lwgeom_is_empty(lwgeom) ) return;
 
 	FLAGS_SET_BBOX(lwgeom->flags, 1);
-	
+
 	if ( ! ( gbox || lwgeom->bbox ) )
 	{
 		lwgeom->bbox = gbox_new(lwgeom->flags);
-		lwgeom_calculate_gbox(lwgeom, lwgeom->bbox);		
+		lwgeom_calculate_gbox(lwgeom, lwgeom->bbox);
 	}
 	else if ( gbox && ! lwgeom->bbox )
 	{
 		lwgeom->bbox = gbox_clone(gbox);
 	}
-	
+
 	if ( lwgeom_is_collection(lwgeom) )
 	{
 		int i;
@@ -697,7 +697,7 @@
 	if( FLAGS_GET_GEODETIC(lwgeom->flags) )
 		return lwgeom_calculate_gbox_geodetic(lwgeom, gbox);
 	else
-		return lwgeom_calculate_gbox_cartesian(lwgeom, gbox);	
+		return lwgeom_calculate_gbox_cartesian(lwgeom, gbox);
 }
 
 void
@@ -730,31 +730,31 @@
 
 LWGEOM*
 lwgeom_force_2d(const LWGEOM *geom)
-{	
+{
 	return lwgeom_force_dims(geom, 0, 0);
 }
 
 LWGEOM*
 lwgeom_force_3dz(const LWGEOM *geom)
-{	
+{
 	return lwgeom_force_dims(geom, 1, 0);
 }
 
 LWGEOM*
 lwgeom_force_3dm(const LWGEOM *geom)
-{	
+{
 	return lwgeom_force_dims(geom, 0, 1);
 }
 
 LWGEOM*
 lwgeom_force_4d(const LWGEOM *geom)
-{	
+{
 	return lwgeom_force_dims(geom, 1, 1);
 }
 
 LWGEOM*
 lwgeom_force_dims(const LWGEOM *geom, int hasz, int hasm)
-{	
+{
 	switch(geom->type)
 	{
 		case POINTTYPE:
@@ -784,7 +784,7 @@
 
 LWGEOM*
 lwgeom_force_sfs(LWGEOM *geom, int version)
-{	
+{
 	LWCOLLECTION *col;
 	int i;
 	LWGEOM *g;
@@ -813,8 +813,8 @@
 				return (LWGEOM *)geom;
 		}
 	}
-	
 
+
 	/* SFS 1.1 version */
 	switch(geom->type)
 	{
@@ -842,7 +842,7 @@
 			}
 			col->type = COLLECTIONTYPE;
 			return lwmpoly_as_lwgeom((LWMPOLY*)geom);
-		
+
 		case POLYHEDRALSURFACETYPE:
 			geom->type = COLLECTIONTYPE;
 			return (LWGEOM *)geom;
@@ -854,7 +854,7 @@
 				col->geoms[i] = lwgeom_force_sfs((LWGEOM*)col->geoms[i], version);
 
 			return lwcollection_as_lwgeom((LWCOLLECTION*)geom);
-		
+
 		default:
 			return (LWGEOM *)geom;
 	}
@@ -904,11 +904,11 @@
 	LWPOLY *ply;
 	LWCOLLECTION *col;
 	int i;
-	
+
 	FLAGS_SET_GEODETIC(geom->flags, value);
 	if ( geom->bbox )
 		FLAGS_SET_GEODETIC(geom->bbox->flags, value);
-	
+
 	switch(geom->type)
 	{
 		case POINTTYPE:
@@ -989,10 +989,10 @@
 lwgeom_is_closed(const LWGEOM *geom)
 {
 	int type = geom->type;
-	
+
 	if( lwgeom_is_empty(geom) )
 		return LW_FALSE;
-	
+
 	/* Test linear types for closure */
 	switch (type)
 	{
@@ -1009,7 +1009,7 @@
 	case POLYHEDRALSURFACETYPE:
 		return lwpsurface_is_closed((LWPSURFACE*)geom);
 	}
-	
+
 	/* Recurse into collections and see if anything is not closed */
 	if ( lwgeom_is_collection(geom) )
 	{
@@ -1024,7 +1024,7 @@
 		}
 		return LW_TRUE;
 	}
-	
+
 	/* All non-linear non-collection types we will call closed */
 	return LW_TRUE;
 }
@@ -1096,7 +1096,7 @@
 	if( ! lwgeom ) return;
 
 	LWDEBUGF(5,"freeing a %s",lwtype_name(lwgeom->type));
-	
+
 	switch (lwgeom->type)
 	{
 	case POINTTYPE:
@@ -1182,10 +1182,10 @@
 int lwgeom_count_vertices(const LWGEOM *geom)
 {
 	int result = 0;
-	
+
 	/* Null? Zero. */
 	if( ! geom ) return 0;
-	
+
 	LWDEBUGF(4, "lwgeom_count_vertices got type %s",
 	         lwtype_name(geom->type));
 
@@ -1236,7 +1236,7 @@
 
 	/* Null? Zero. */
 	if( ! geom ) return -1;
-	
+
 	LWDEBUGF(4, "lwgeom_dimension got type %s",
 	         lwtype_name(geom->type));
 
@@ -1291,7 +1291,7 @@
 int lwgeom_count_rings(const LWGEOM *geom)
 {
 	int result = 0;
-	
+
 	/* Null? Empty? Zero. */
 	if( ! geom || lwgeom_is_empty(geom) )
 		return 0;
@@ -1621,7 +1621,7 @@
 double lwgeom_area(const LWGEOM *geom)
 {
 	int type = geom->type;
-	
+
 	if ( type == POLYGONTYPE )
 		return lwpoly_area((LWPOLY*)geom);
 	else if ( type == CURVEPOLYTYPE )
@@ -1880,7 +1880,7 @@
 {
 	if ( ! lwgeom )
 		return LW_FAILURE;
-		
+
 	switch( lwgeom->type )
 	{
 		case POINTTYPE:
@@ -1947,25 +1947,25 @@
 	double height = clip->ymax - clip->ymin;
 	GBOX subbox1, subbox2;
 	LWGEOM *clipped1, *clipped2;
-	
+
 	if ( geom->type == POLYHEDRALSURFACETYPE || geom->type == TINTYPE )
 	{
 		lwerror("%s: unsupported geometry type '%s'", __func__, lwtype_name(geom->type));
 	}
-	
+
 	if ( width == 0.0 && height == 0.0 )
 	{
 		if ( geom->type == POINTTYPE )
 		{
 			lwcollection_add_lwgeom(col, lwgeom_clone_deep(geom));
-			return 1;			
+			return 1;
 		}
 		else
 		{
 			return 0;
 		}
 	}
-	
+
 	/* Always just recurse into collections */
 	if ( lwgeom_is_collection(geom) && geom->type != MULTIPOINTTYPE )
 	{
@@ -1978,7 +1978,7 @@
 		}
 		return n;
 	}
-	
+
 	/* But don't go too far. 2^50 ~= 10^15, that's enough subdivision */
 	/* Just add what's left */
 	if ( depth > maxdepth )
@@ -1986,21 +1986,21 @@
 		lwcollection_add_lwgeom(col, lwgeom_clone_deep(geom));
 		return 0;
 	}
-	
+
 	nvertices = lwgeom_count_vertices(geom);
 	/* Skip empties entirely */
 	if ( nvertices == 0 )
 	{
 		return 0;
 	}
-	
+
 	/* If it is under the vertex tolerance, just add it, we're done */
 	if ( nvertices < maxvertices )
 	{
 		lwcollection_add_lwgeom(col, lwgeom_clone_deep(geom));
 		return 1;
 	}
-	
+
 	subbox1 = subbox2 = *clip;
 	if ( width > height )
 	{
@@ -2010,7 +2010,7 @@
 	{
 		subbox1.ymax = subbox2.ymin = (clip->ymin + clip->ymax)/2;
 	}
-	
+
 	if ( height == 0 )
 	{
 		subbox1.ymax += FP_TOLERANCE;
@@ -2026,12 +2026,12 @@
 		subbox1.xmin -= FP_TOLERANCE;
 		subbox2.xmin -= FP_TOLERANCE;
 	}
-		
+
 	clipped1 = lwgeom_clip_by_rect(geom, subbox1.xmin, subbox1.ymin, subbox1.xmax, subbox1.ymax);
 	clipped2 = lwgeom_clip_by_rect(geom, subbox2.xmin, subbox2.ymin, subbox2.xmax, subbox2.ymax);
-	
+
 	++depth;
-	
+
 	if ( clipped1 )
 	{
 		n += lwgeom_subdivide_recursive(clipped1, maxvertices, depth, col, &subbox1);
@@ -2043,9 +2043,9 @@
 		n += lwgeom_subdivide_recursive(clipped2, maxvertices, depth, col, &subbox2);
 		lwgeom_free(clipped2);
 	}
-	
+
 	return n;
-	
+
 }
 
 LWCOLLECTION *
@@ -2055,7 +2055,7 @@
 	static int minmaxvertices = 8;
 	LWCOLLECTION *col;
 	GBOX clip;
-	
+
 	col = lwcollection_construct_empty(COLLECTIONTYPE, geom->srid, lwgeom_has_z(geom), lwgeom_has_m(geom));
 
 	if ( lwgeom_is_empty(geom) )
@@ -2066,7 +2066,7 @@
 		lwcollection_free(col);
 		lwerror("%s: cannot subdivide to fewer than %d vertices per output", __func__, minmaxvertices);
 	}
-	
+
 	clip = *(lwgeom_get_bbox(geom));
 	lwgeom_subdivide_recursive(geom, maxvertices, startdepth, col, &clip);
 	lwgeom_set_srid((LWGEOM*)col, geom->srid);



More information about the postgis-tickets mailing list