Change from pass by reference to pass by value

git-svn-id: http://svn.osgeo.org/postgis/trunk@4613 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Paul Ramsey 2009-10-07 03:37:00 +00:00
parent 4dcc58e3b1
commit c4e1620079
3 changed files with 10 additions and 10 deletions

View 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;

View 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.

View 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 */