suppress unused variable compiler warnings with gcc

This commit is contained in:
Dane Springmeyer 2012-07-23 17:29:10 -07:00
parent a1d6579da2
commit 5c20a9f72a
4 changed files with 33 additions and 19 deletions

View file

@ -39,7 +39,7 @@ namespace mapnik
template <typename T>
bool clip_test(T p,T q,double& tmin,double& tmax)
{
double r;
double r(0);
bool result=true;
if (p<0.0)
{
@ -96,7 +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,y1;
double x1(0);
double y1(0);
while (++start!=end)
{
if ( boost::get<2>(*start) == SEG_MOVETO)
@ -173,7 +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,y1;
double x1(0);
double y1(0);
while (++start != end)
{
if ( boost::get<2>(*start) == SEG_MOVETO)
@ -222,7 +224,10 @@ struct filter_at_point
template <typename PathType>
double path_length(PathType & path)
{
double x0,y0,x1,y1;
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;
@ -239,7 +244,10 @@ double path_length(PathType & path)
template <typename PathType>
bool middle_point(PathType & path, double & x, double & y)
{
double x0,y0,x1,y1;
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);
@ -268,10 +276,10 @@ namespace label {
template <typename PathType>
bool centroid(PathType & path, double & x, double & y)
{
double x0;
double y0;
double x1;
double y1;
double x0(0);
double y0(0);
double x1(0);
double y1(0);
double start_x;
double start_y;
@ -318,7 +326,10 @@ template <typename PathType>
bool hit_test(PathType & path, double x, double y, double tol)
{
bool inside=false;
double x0, y0, x1, y1;
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;
@ -363,11 +374,12 @@ void interior_position(PathType & path, double & x, double & y)
std::vector<double> intersections; // only need to store the X as we know the y
double x0;
double y0;
double x0(0);
double y0(0);
path.rewind(0);
unsigned command = path.vertex(&x0, &y0);
double x1,y1;
double x1(0);
double y1(0);
while (SEG_END != (command = path.vertex(&x1, &y1)))
{
if (command != SEG_MOVETO)

View file

@ -46,9 +46,6 @@ struct agg_stack_blur
{
agg_stack_blur(unsigned rx_, unsigned ry_)
: rx(rx_),ry(ry_) {}
// an attempt to support older boost spirit (< 1.46)
agg_stack_blur()
: rx(1),ry(1) {}
unsigned rx;
unsigned ry;
};

View file

@ -126,7 +126,8 @@ namespace mapnik { namespace util {
ss.write(reinterpret_cast<char*>(&byte_order),1);
int type = static_cast<int>(mapnik::Point);
write(ss,type,4,byte_order);
double x,y;
double x(0);
double y(0);
g.vertex(0,&x,&y);
write(ss,x,8,byte_order);
write(ss,y,8,byte_order);
@ -145,7 +146,8 @@ namespace mapnik { namespace util {
int type = static_cast<int>(mapnik::LineString);
write(ss,type,4,byte_order);
write(ss,num_points,4,byte_order);
double x,y;
double x(0);
double y(0);
for (unsigned i=0; i< num_points; ++i)
{
g.vertex(i,&x,&y);
@ -165,7 +167,8 @@ namespace mapnik { namespace util {
typedef std::vector<point_type> linear_ring;
boost::ptr_vector<linear_ring> rings;
double x,y;
double x(0);
double y(0);
std::size_t size = 1 + 4 + 4 ; // byteOrder + wkbType + numRings
for (unsigned i=0; i< num_points; ++i)
{

View file

@ -22,6 +22,8 @@
#include "basiccurl.h"
#include <iostream>
CURL_LOAD_DATA* grab_http_response(const char* url)
{
CURL_LOAD_DATA* data;