diff options
author | monty@mysql.com/narttu.mysql.fi <> | 2006-12-15 00:51:37 +0200 |
---|---|---|
committer | monty@mysql.com/narttu.mysql.fi <> | 2006-12-15 00:51:37 +0200 |
commit | 88dd873de0d5dc6e8f262268f925596a60b58704 (patch) | |
tree | 142bd488523fec48817d9fb2194f1a608eec00fc /sql/spatial.cc | |
parent | 601e6f4b2a78921304bc1d779991c615ee229f89 (diff) | |
download | mariadb-git-88dd873de0d5dc6e8f262268f925596a60b58704.tar.gz |
Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments
Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c
I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r-- | sql/spatial.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index e91653f79d5..3e54d28182c 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -24,13 +24,13 @@ String Geometry::bad_geometry_data("Bad object", &my_charset_bin); -Geometry::Class_info *Geometry::ci_collection[Geometry::wkb_end+1]= +Geometry::Class_info *Geometry::ci_collection[Geometry::wkb_last+1]= { NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static Geometry::Class_info **ci_collection_end= - Geometry::ci_collection+Geometry::wkb_end + 1; + Geometry::ci_collection+Geometry::wkb_last + 1; Geometry::Class_info::Class_info(const char *name, int type_id, void(*create_func)(void *)): @@ -550,7 +550,7 @@ bool Gis_line_string::get_mbr(MBR *mbr, const char **end) const } -int Gis_line_string::length(double *len) const +int Gis_line_string::geom_length(double *len) const { uint32 n_points; double prev_x, prev_y; @@ -946,15 +946,14 @@ int Gis_polygon::centroid_xy(double *x, double *y) const while (--n_points) // One point is already read { - double x, y; - get_point(&x, &y, data); + double tmp_x, tmp_y; + get_point(&tmp_x, &tmp_y, data); data+= (SIZEOF_STORED_DOUBLE*2); - /* QQ: Is the following prev_x+x right ? */ - cur_area+= (prev_x + x) * (prev_y - y); - cur_cx+= x; - cur_cy+= y; - prev_x= x; - prev_y= y; + cur_area+= (prev_x + tmp_x) * (prev_y - tmp_y); + cur_cx+= tmp_x; + cur_cy+= tmp_y; + prev_x= tmp_x; + prev_y= tmp_y; } cur_area= fabs(cur_area) / 2; cur_cx= cur_cx / (org_n_points - 1); @@ -1298,7 +1297,7 @@ int Gis_multi_line_string::geometry_n(uint32 num, String *result) const } -int Gis_multi_line_string::length(double *len) const +int Gis_multi_line_string::geom_length(double *len) const { uint32 n_line_strings; const char *data= m_data; @@ -1315,7 +1314,7 @@ int Gis_multi_line_string::length(double *len) const Gis_line_string ls; data+= WKB_HEADER_SIZE; ls.set_data_ptr(data, (uint32) (m_data_end - data)); - if (ls.length(&ls_len)) + if (ls.geom_length(&ls_len)) return 1; *len+= ls_len; /* |