fix a batch of unused variable warnings (leaving several with are true bugs/missing features)

This commit is contained in:
Dane Springmeyer 2013-07-23 15:51:22 -04:00
parent d1667c125c
commit 3bd2e6501f
10 changed files with 44 additions and 29 deletions

View file

@ -266,7 +266,7 @@ struct test5
s.resize(s.capacity()); s.resize(s.capacity());
while (true) while (true)
{ {
size_t n2 = static_cast<size_t>(snprintf(&s[0], s.size()+1, "%g", val_)); size_t n2 = static_cast<size_t>(snprintf(&s[0], s.size()+1, "%g", val));
if (n2 <= s.size()) if (n2 <= s.size())
{ {
s.resize(n2); s.resize(n2);

View file

@ -134,7 +134,7 @@ namespace agg
static AGG_INLINE void blend_pix(value_type* p, static AGG_INLINE void blend_pix(value_type* p,
unsigned cr, unsigned cg, unsigned cb, unsigned cr, unsigned cg, unsigned cb,
unsigned alpha, unsigned alpha,
unsigned cover=0) unsigned /*cover*/=0)
{ {
calc_type r = p[Order::R]; calc_type r = p[Order::R];
calc_type g = p[Order::G]; calc_type g = p[Order::G];

View file

@ -164,7 +164,7 @@ namespace mapnik {
public: public:
typedef std::basic_ostringstream<Ch, Tr, A> stream_buffer; typedef std::basic_ostringstream<Ch, Tr, A> stream_buffer;
void operator()(const logger::severity_type& severity, const stream_buffer &s) void operator()(const logger::severity_type& /*severity*/, const stream_buffer &s)
{ {
#ifdef MAPNIK_THREADSAFE #ifdef MAPNIK_THREADSAFE
static boost::mutex mutex; static boost::mutex mutex;
@ -193,15 +193,19 @@ namespace mapnik {
base_log() {} base_log() {}
#ifdef MAPNIK_LOG
base_log(const char* object_name) base_log(const char* object_name)
{ {
#ifdef MAPNIK_LOG
if (object_name != NULL) if (object_name != NULL)
{ {
object_name_ = object_name; object_name_ = object_name;
} }
#endif
} }
#else
base_log(const char* /*object_name*/)
{
}
#endif
~base_log() ~base_log()
{ {
@ -214,13 +218,20 @@ namespace mapnik {
} }
template<class T> template<class T>
#ifdef MAPNIK_LOG
base_log &operator<<(const T &x) base_log &operator<<(const T &x)
{ {
#ifdef MAPNIK_LOG
streambuf_ << x; streambuf_ << x;
#endif
return *this; return *this;
} }
#else
base_log &operator<<(const T& /*x*/)
{
return *this;
}
#endif
private: private:
#ifdef MAPNIK_LOG #ifdef MAPNIK_LOG

View file

@ -582,7 +582,7 @@ void apply_filter(Src & src, scale_hsla const& transform)
} }
template <typename Src> template <typename Src>
void apply_filter(Src & src, gray const& op) void apply_filter(Src & src, gray const& /*op*/)
{ {
using namespace boost::gil; using namespace boost::gil;
@ -632,14 +632,14 @@ void x_gradient_impl(Src const& src_view, Dst const& dst_view)
} }
template <typename Src> template <typename Src>
void apply_filter(Src & src, x_gradient const& op) void apply_filter(Src & src, x_gradient const& /*op*/)
{ {
double_buffer<Src> tb(src); double_buffer<Src> tb(src);
x_gradient_impl(tb.src_view, tb.dst_view); x_gradient_impl(tb.src_view, tb.dst_view);
} }
template <typename Src> template <typename Src>
void apply_filter(Src & src, y_gradient const& op) void apply_filter(Src & src, y_gradient const& /*op*/)
{ {
double_buffer<Src> tb(src); double_buffer<Src> tb(src);
x_gradient_impl(rotated90ccw_view(tb.src_view), x_gradient_impl(rotated90ccw_view(tb.src_view),
@ -647,7 +647,7 @@ void apply_filter(Src & src, y_gradient const& op)
} }
template <typename Src> template <typename Src>
void apply_filter(Src & src, invert const& op) void apply_filter(Src & src, invert const& /*op*/)
{ {
using namespace boost::gil; using namespace boost::gil;

View file

@ -47,7 +47,7 @@ namespace mapnik { namespace detail {
template <typename T> template <typename T>
struct extract_value struct extract_value
{ {
static inline boost::optional<T> do_extract_from_string(std::string const& source) static inline boost::optional<T> do_extract_from_string(std::string const& /*source*/)
{ {
std::string err_msg = (boost::format("No conversion from std::string to %s") % typeid(T).name()).str(); std::string err_msg = (boost::format("No conversion from std::string to %s") % typeid(T).name()).str();
throw std::runtime_error(err_msg); throw std::runtime_error(err_msg);

View file

@ -122,7 +122,7 @@ struct equals
} }
template <typename T, typename U> template <typename T, typename U>
bool operator() (T const& lhs, U const& rhs) const bool operator() (T const& /*lhs*/, U const& /*rhs*/) const
{ {
return false; return false;
} }
@ -182,7 +182,7 @@ struct not_equals
// back compatibility shim to equate empty string with null for != test // back compatibility shim to equate empty string with null for != test
// https://github.com/mapnik/mapnik/issues/1859 // https://github.com/mapnik/mapnik/issues/1859
// TODO - consider removing entire specialization at Mapnik 3.x // TODO - consider removing entire specialization at Mapnik 3.x
bool operator() (value_null lhs,value_unicode_string const& rhs) const bool operator() (value_null /*lhs*/, value_unicode_string const& rhs) const
{ {
if (rhs.isEmpty()) return false; if (rhs.isEmpty()) return false;
return true; return true;

View file

@ -47,12 +47,12 @@ typedef bool value_bool;
struct value_null struct value_null
{ {
bool operator==(value_null const& other) const bool operator==(value_null const& /*other*/) const
{ {
return true; return true;
} }
bool operator!=(value_null const& other) const bool operator!=(value_null const& /*other*/) const
{ {
return false; return false;
} }
@ -88,11 +88,11 @@ struct value_null
} }
}; };
inline std::size_t hash_value(const value_null& val) { inline std::size_t hash_value(const value_null& /*val*/) {
return 0; return 0;
} }
inline std::ostream& operator<< (std::ostream & out,value_null const& v) inline std::ostream& operator<< (std::ostream & out,value_null const& /*v*/)
{ {
return out; return out;
} }

View file

@ -64,6 +64,9 @@
#include "agg_conv_clipper.h" #include "agg_conv_clipper.h"
#include "agg_path_storage.h" #include "agg_path_storage.h"
// stl
#include <stdexcept>
namespace mapnik { namespace mapnik {
struct transform_tag {}; struct transform_tag {};
@ -86,9 +89,9 @@ struct converter_traits
typedef T0 geometry_type; typedef T0 geometry_type;
typedef geometry_type conv_type; typedef geometry_type conv_type;
template <typename Args> template <typename Args>
static void setup(geometry_type & geom, Args const& args) static void setup(geometry_type & geom, Args const& /*args*/)
{ {
throw "BOOM!"; throw std::runtime_error("invalid call to setup");
} }
}; };
@ -216,7 +219,7 @@ struct converter_traits<T,mapnik::close_poly_tag>
typedef T geometry_type; typedef T geometry_type;
typedef typename agg::conv_close_polygon<geometry_type> conv_type; typedef typename agg::conv_close_polygon<geometry_type> conv_type;
template <typename Args> template <typename Args>
static void setup(geometry_type & geom, Args const& args) static void setup(geometry_type & geom, Args const& /*args*/)
{ {
// no-op // no-op
} }
@ -291,7 +294,7 @@ template <>
struct converter_fwd<true> struct converter_fwd<true>
{ {
template <typename Base, typename T0,typename T1,typename T2, typename Iter,typename End> template <typename Base, typename T0,typename T1,typename T2, typename Iter,typename End>
static void forward(Base& base, T0 & geom,T1 const& args) static void forward(Base& base, T0 & geom,T1 const& /*args*/)
{ {
base.template dispatch<Iter,End>(geom, typename boost::is_same<Iter,End>::type()); base.template dispatch<Iter,End>(geom, typename boost::is_same<Iter,End>::type());
} }

View file

@ -133,23 +133,24 @@ static datasource_map ds_map = boost::assign::map_list_of
; ;
#endif #endif
#ifdef MAPNIK_STATIC_PLUGINS
datasource_ptr create_static_datasource(parameters const& params) datasource_ptr create_static_datasource(parameters const& params)
{ {
datasource_ptr ds; datasource_ptr ds;
#ifdef MAPNIK_STATIC_PLUGINS
boost::optional<std::string> type = params.get<std::string>("type"); boost::optional<std::string> type = params.get<std::string>("type");
datasource_map::iterator it = ds_map.find(*type); datasource_map::iterator it = ds_map.find(*type);
if (it != ds_map.end()) if (it != ds_map.end())
{ {
ds = it->second(params); ds = it->second(params);
} }
#endif
return ds; return ds;
} }
#else
datasource_ptr create_static_datasource(parameters const& /*params*/)
{
return datasource_ptr();
}
#endif
std::vector<std::string> get_static_datasource_names() std::vector<std::string> get_static_datasource_names()
{ {

View file

@ -59,7 +59,7 @@ struct expression_string : boost::static_visitor<void>
str_ += "]"; str_ += "]";
} }
void operator() (geometry_type_attribute const& attr) const void operator() (geometry_type_attribute const& /*attr*/) const
{ {
str_ += "[mapnik::geometry_type]"; str_ += "[mapnik::geometry_type]";
} }