From a8652e9957e014c19b47635e09147a7bc17a3b8c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 May 2002 18:51:21 +0300 Subject: Fixed problem in fulltest testcase include/my_base.h: Fix to ensure that old tables works in 4.1 myisam/mi_open.c: cleanup mysys/my_handler.c: Fixed problem in fulltest testcase sql/spatial.cc: cleanup sql/sql_table.cc: cleanup --- sql/spatial.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sql/spatial.cc') diff --git a/sql/spatial.cc b/sql/spatial.cc index 32942a70dc2..bb6e03c3c03 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -680,13 +680,16 @@ int GPolygon::centroid_xy(double *x, double *y) const uint32 i; double res_area, res_cx, res_cy; const char *data = m_data; + LINT_INIT(res_area); + LINT_INIT(res_cx); + LINT_INIT(res_cy); if (no_data(data, 4)) return 1; n_linear_rings = uint4korr(data); data += 4; - for(i = 0; i < n_linear_rings; ++i) + for (i = 0; i < n_linear_rings; ++i) { if (no_data(data, 4)) return 1; @@ -720,7 +723,8 @@ int GPolygon::centroid_xy(double *x, double *y) const cur_area = fabs(cur_area) / 2; cur_cx = cur_cx / (n_points - 1); cur_cy = cur_cy / (n_points - 1); - if(i) + + if (i) { double d_area = res_area - cur_area; if (d_area <= 0) @@ -1195,6 +1199,10 @@ int GMultiPolygon::centroid(String *result) const double res_area, res_cx, res_cy; double cur_area, cur_cx, cur_cy; + LINT_INIT(res_area); + LINT_INIT(res_cx); + LINT_INIT(res_cy); + const char *data = m_data; if (no_data(data, 4)) return 1; @@ -1211,7 +1219,7 @@ int GMultiPolygon::centroid(String *result) const if (p.centroid_xy(&cur_cx, &cur_cy)) return 1; - if(i) + if (i) { double sum_area = res_area + cur_area; res_cx = (res_area * res_cx + cur_area * cur_cx) / sum_area; -- cgit v1.2.1