use safe_cast to avoid -Wsign-conversion warnings

This commit is contained in:
Dane Springmeyer 2015-06-13 19:23:36 -07:00
parent bb2e938302
commit 563bd1adc7

View file

@ -4,6 +4,7 @@
// mapnik // mapnik
#include <mapnik/params.hpp> #include <mapnik/params.hpp>
#include <mapnik/value_types.hpp> #include <mapnik/value_types.hpp>
#include <mapnik/safe_cast.hpp>
#include "../test/cleanup.hpp" #include "../test/cleanup.hpp"
// stl // stl
@ -26,8 +27,8 @@ protected:
public: public:
test_case(mapnik::parameters const& params) test_case(mapnik::parameters const& params)
: params_(params), : params_(params),
threads_(*params.get<mapnik::value_integer>("threads",0)), threads_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("threads",0))),
iterations_(*params.get<mapnik::value_integer>("iterations",0)) iterations_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("iterations",0)))
{} {}
std::size_t threads() const std::size_t threads() const
{ {