From 2ea0340e2d9006ad2a3c10a5d7e697b4ceb7b391 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 28 Feb 2011 18:30:38 +0000 Subject: [PATCH] avoid unintialized variable warnings in g++ --- include/mapnik/geometry.hpp | 6 ++++-- src/cairo_renderer.cpp | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 0dfbb1962..f5acfe1b8 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -123,7 +123,8 @@ public: std::vector intersections; // only need to store the X as we know the y - double x0, y0; + double x0=0; + double y0=0; rewind(0); unsigned command = vertex(&x0, &y0); double x1,y1; @@ -316,7 +317,8 @@ public: return distance(x, y, x0, y0) <= abs(tol); } else if (cont_.size() > 1) { bool inside=false; - double x0, y0; + double x0=0; + double y0=0; rewind(0); vertex(&x0, &y0); diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index a590a87a9..7e0fc8ad4 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -386,7 +386,8 @@ public: template void add_agg_path(T& path, unsigned start_index = 0) { - double x, y; + double x=0; + double y=0; path.rewind(start_index); @@ -400,8 +401,8 @@ public: { if (agg::is_curve3(cm)) { - double end_x; - double end_y; + double end_x=0; + double end_y=0; std::cerr << "Curve 3 not implemented" << std::endl; path.vertex(&end_x, &end_y); @@ -409,10 +410,10 @@ public: } else if (agg::is_curve4(cm)) { - double ct2_x; - double ct2_y; - double end_x; - double end_y; + double ct2_x=0; + double ct2_y=0; + double end_x=0; + double end_y=0; path.vertex(&ct2_x, &ct2_y); path.vertex(&end_x, &end_y); @@ -796,7 +797,8 @@ void cairo_renderer_base::process(building_symbolizer const& sym, for (unsigned j = 1; j < geom.num_points(); ++j) { - double x,y; + double x=0; + double y=0; cm = geom.vertex(&x,&y);