]> granicus.if.org Git - postgis/commitdiff
Change from pass by reference to pass by value
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 7 Oct 2009 03:37:00 +0000 (03:37 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 7 Oct 2009 03:37:00 +0000 (03:37 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4613 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_box.c
liblwgeom/libgeom.h
liblwgeom/lwgeodetic.c

index 37bc380e17234a03d3106ff9ede409033fc88d74..b465200b90b170afc803ebbd5e782e775edad579 100644 (file)
@@ -67,22 +67,22 @@ int gbox_merge(GBOX new_box, GBOX *merge_box)
        return G_SUCCESS;
 }
 
-int gbox_overlaps(GBOX *g1, GBOX *g2)
+int gbox_overlaps(GBOX g1, GBOX g2)
 {
-       if( g1->flags != g2->flags )
+       if( g1.flags != g2.flags )
                lwerror("gbox_overlaps: geometries have mismatched dimensionality");
                
-       if( g1->xmax < g2->xmin || g1->ymax < g2->ymin ||
-           g1->xmin > g2->xmax || g1->ymin > g2->ymax )
+       if( g1.xmax < g2.xmin || g1.ymax < g2.ymin ||
+           g1.xmin > g2.xmax || g1.ymin > g2.ymax )
                return LW_FALSE;
-       if( FLAGS_GET_Z(g1->flags) || FLAGS_GET_GEODETIC(g1->flags) )
+       if( FLAGS_GET_Z(g1.flags) || FLAGS_GET_GEODETIC(g1.flags) )
        {
-               if( g1->zmax < g2->zmin || g1->zmin > g2->zmax )
+               if( g1.zmax < g2.zmin || g1.zmin > g2.zmax )
                        return LW_FALSE;
        }
-       if( FLAGS_GET_M(g1->flags) )
+       if( FLAGS_GET_M(g1.flags) )
        {
-               if( g1->mmax < g2->mmin || g1->mmin > g2->mmax )
+               if( g1.mmax < g2.mmin || g1.mmin > g2.mmax )
                        return LW_FALSE;
        }
        return LW_TRUE;
index ada2c4a35da09dd5002f2ea6a45f71fdef7ffc36..e89f477899c70801cc1c9a15e07554825084f43f 100644 (file)
@@ -428,7 +428,7 @@ extern GBOX* gbox_from_string(char *str);
 /**
 * Return #LW_TRUE if the #GBOX overlaps, #LW_FALSE otherwise. 
 */
-extern int gbox_overlaps(GBOX *g1, GBOX *g2);
+extern int gbox_overlaps(GBOX g1, GBOX g2);
 
 /**
 * Copy the values of original #GBOX into duplicate.
index ff488451108e9db4d6d50cfce472f8f89ac40292..80ff110194a145e9f9dcdc95060cdf1e8a65b0ba 100644 (file)
@@ -1462,7 +1462,7 @@ double lwgeom_distance_sphere(LWGEOM *lwgeom1, LWGEOM *lwgeom2, GBOX gbox1, GBOX
        
        
        /* If the boxes aren't disjoint, we have to check for edge intersections */
-       if( gbox_overlaps(&gbox1, &gbox2) )
+       if( gbox_overlaps(gbox1, gbox2) )
                check_intersection = LW_TRUE;
        
        /* Point/line combinations can all be handled with simple point array iterations */