mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-25 01:22:47 +00:00
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:
parent
4dcc58e3b1
commit
c4e1620079
|
@ -67,22 +67,22 @@ int gbox_merge(GBOX new_box, GBOX *merge_box)
|
||||||
return G_SUCCESS;
|
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");
|
lwerror("gbox_overlaps: geometries have mismatched dimensionality");
|
||||||
|
|
||||||
if( g1->xmax < g2->xmin || g1->ymax < g2->ymin ||
|
if( g1.xmax < g2.xmin || g1.ymax < g2.ymin ||
|
||||||
g1->xmin > g2->xmax || g1->ymin > g2->ymax )
|
g1.xmin > g2.xmax || g1.ymin > g2.ymax )
|
||||||
return LW_FALSE;
|
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;
|
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_FALSE;
|
||||||
}
|
}
|
||||||
return LW_TRUE;
|
return LW_TRUE;
|
||||||
|
|
|
@ -428,7 +428,7 @@ extern GBOX* gbox_from_string(char *str);
|
||||||
/**
|
/**
|
||||||
* Return #LW_TRUE if the #GBOX overlaps, #LW_FALSE otherwise.
|
* 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.
|
* Copy the values of original #GBOX into duplicate.
|
||||||
|
|
|
@ -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 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;
|
check_intersection = LW_TRUE;
|
||||||
|
|
||||||
/* Point/line combinations can all be handled with simple point array iterations */
|
/* Point/line combinations can all be handled with simple point array iterations */
|
||||||
|
|
Loading…
Reference in a new issue