mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Spatial code cleanup
This commit is contained in:
@ -285,7 +285,7 @@ int GLineString::get_mbr(MBR *mbr) const
|
|||||||
return 1;
|
return 1;
|
||||||
for (; n_points>0; --n_points)
|
for (; n_points>0; --n_points)
|
||||||
{
|
{
|
||||||
mbr->add_xy((double *)data, (double *)(data + 8));
|
mbr->add_xy(data, data + 8);
|
||||||
data += 8+8;
|
data += 8+8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,7 +551,7 @@ int GPolygon::get_mbr(MBR *mbr) const
|
|||||||
return 1;
|
return 1;
|
||||||
for (; n_points>0; --n_points)
|
for (; n_points>0; --n_points)
|
||||||
{
|
{
|
||||||
mbr->add_xy((double *)data, (double *)(data + 8));
|
mbr->add_xy(data, data + 8);
|
||||||
data += 8+8;
|
data += 8+8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -838,8 +838,7 @@ int GMultiPoint::get_mbr(MBR *mbr) const
|
|||||||
return 1;
|
return 1;
|
||||||
for (; n_points>0; --n_points)
|
for (; n_points>0; --n_points)
|
||||||
{
|
{
|
||||||
mbr->add_xy((double *)(data + WKB_HEADER_SIZE),
|
mbr->add_xy(data + WKB_HEADER_SIZE, data + 8 + WKB_HEADER_SIZE);
|
||||||
(double *)(data + 8 + WKB_HEADER_SIZE));
|
|
||||||
data += (8+8+WKB_HEADER_SIZE);
|
data += (8+8+WKB_HEADER_SIZE);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -963,7 +962,7 @@ int GMultiLineString::get_mbr(MBR *mbr) const
|
|||||||
|
|
||||||
for (; n_points>0; --n_points)
|
for (; n_points>0; --n_points)
|
||||||
{
|
{
|
||||||
mbr->add_xy((double *)data, (double *)(data + 8));
|
mbr->add_xy(data, data + 8);
|
||||||
data += 8+8;
|
data += 8+8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1156,7 +1155,7 @@ int GMultiPolygon::get_mbr(MBR *mbr) const
|
|||||||
|
|
||||||
for (; n_points>0; --n_points)
|
for (; n_points>0; --n_points)
|
||||||
{
|
{
|
||||||
mbr->add_xy((double *)data, (double *)(data + 8));
|
mbr->add_xy(data, data + 8);
|
||||||
data += 8+8;
|
data += 8+8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ struct MBR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_xy(double *px, double *py)
|
void add_xy(const char *px, const char *py)
|
||||||
{ /* Not using "else" for proper one point MBR calculation */
|
{ /* Not using "else" for proper one point MBR calculation */
|
||||||
double x, y;
|
double x, y;
|
||||||
float8get(x, px);
|
float8get(x, px);
|
||||||
|
Reference in New Issue
Block a user