avoid unintialized variable warnings in g++

This commit is contained in:
Dane Springmeyer 2011-02-28 18:30:38 +00:00
parent 3df75cc422
commit 2ea0340e2d
2 changed files with 14 additions and 10 deletions

View file

@ -123,7 +123,8 @@ public:
std::vector<double> intersections; // only need to store the X as we know the y std::vector<double> intersections; // only need to store the X as we know the y
double x0, y0; double x0=0;
double y0=0;
rewind(0); rewind(0);
unsigned command = vertex(&x0, &y0); unsigned command = vertex(&x0, &y0);
double x1,y1; double x1,y1;
@ -316,7 +317,8 @@ public:
return distance(x, y, x0, y0) <= abs(tol); return distance(x, y, x0, y0) <= abs(tol);
} else if (cont_.size() > 1) { } else if (cont_.size() > 1) {
bool inside=false; bool inside=false;
double x0, y0; double x0=0;
double y0=0;
rewind(0); rewind(0);
vertex(&x0, &y0); vertex(&x0, &y0);

View file

@ -386,7 +386,8 @@ public:
template <typename T> template <typename T>
void add_agg_path(T& path, unsigned start_index = 0) void add_agg_path(T& path, unsigned start_index = 0)
{ {
double x, y; double x=0;
double y=0;
path.rewind(start_index); path.rewind(start_index);
@ -400,8 +401,8 @@ public:
{ {
if (agg::is_curve3(cm)) if (agg::is_curve3(cm))
{ {
double end_x; double end_x=0;
double end_y; double end_y=0;
std::cerr << "Curve 3 not implemented" << std::endl; std::cerr << "Curve 3 not implemented" << std::endl;
path.vertex(&end_x, &end_y); path.vertex(&end_x, &end_y);
@ -409,10 +410,10 @@ public:
} }
else if (agg::is_curve4(cm)) else if (agg::is_curve4(cm))
{ {
double ct2_x; double ct2_x=0;
double ct2_y; double ct2_y=0;
double end_x; double end_x=0;
double end_y; double end_y=0;
path.vertex(&ct2_x, &ct2_y); path.vertex(&ct2_x, &ct2_y);
path.vertex(&end_x, &end_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) for (unsigned j = 1; j < geom.num_points(); ++j)
{ {
double x,y; double x=0;
double y=0;
cm = geom.vertex(&x,&y); cm = geom.vertex(&x,&y);