From 25a7c6bc01b1d81aaccf1adaacd379b93963d965 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 24 Jul 2012 14:20:57 -0700 Subject: [PATCH] + use assignment op to initialize built-in types. --- include/mapnik/geom_util.hpp | 34 +++++++++++++++---------------- include/mapnik/geometry.hpp | 4 ++-- include/mapnik/grid/grid_util.hpp | 13 +++++++----- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index a8a058b5e..31432aa33 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -39,7 +39,7 @@ namespace mapnik template bool clip_test(T p,T q,double& tmin,double& tmax) { - double r(0); + double r = 0; bool result=true; if (p<0.0) { @@ -96,8 +96,8 @@ inline bool point_inside_path(double x,double y,Iter start,Iter end) double x0=boost::get<0>(*start); double y0=boost::get<1>(*start); - double x1(0); - double y1(0); + double x1 = 0; + double y1 = 0; while (++start!=end) { if ( boost::get<2>(*start) == SEG_MOVETO) @@ -174,8 +174,8 @@ inline bool point_on_path(double x,double y,Iter start,Iter end, double tol) { double x0=boost::get<0>(*start); double y0=boost::get<1>(*start); - double x1(0); - double y1(0); + double x1 = 0; + double y1 = 0; while (++start != end) { if ( boost::get<2>(*start) == SEG_MOVETO) @@ -224,10 +224,10 @@ struct filter_at_point template double path_length(PathType & path) { - double x0(0); - double y0(0); - double x1(0); - double y1(0); + double x0 = 0; + double y0 = 0; + double x1 = 0; + double y1 = 0; path.rewind(0); unsigned command = path.vertex(&x0,&y0); if (command == SEG_END) return 0; @@ -244,10 +244,10 @@ double path_length(PathType & path) template bool middle_point(PathType & path, double & x, double & y) { - double x0(0); - double y0(0); - double x1(0); - double y1(0); + double x0 = 0; + double y0 = 0; + double x1 = 0; + double y1 = 0; double mid_length = 0.5 * path_length(path); path.rewind(0); unsigned command = path.vertex(&x0,&y0); @@ -334,10 +334,10 @@ template bool hit_test(PathType & path, double x, double y, double tol) { bool inside=false; - double x0(0); - double y0(0); - double x1(0); - double y1(0); + double x0 = 0; + double y0 = 0; + double x1 = 0; + double y1 = 0; path.rewind(0); unsigned command = path.vertex(&x0, &y0); if (command == SEG_END) return false; diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 20356dc84..31bfeb337 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -88,8 +88,8 @@ public: box2d envelope() const { box2d result; - double x(0); - double y(0); + double x = 0; + double y = 0; rewind(0); for (unsigned i=0;i