Skip to content

Commit 5c5b599

Browse files
author
Dane Springmeyer
committed
Fix a few -Wshorten-64-to-32 warnings
1 parent 896711c commit 5c5b599

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/mapnik_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ std::shared_ptr<image_any> copy(mapnik::image_any const& im, mapnik::image_dtype
145145
return std::make_shared<image_any>(mapnik::image_copy(im, type, offset, scaling));
146146
}
147147

148-
unsigned compare(mapnik::image_any const& im1, mapnik::image_any const& im2, double threshold, bool alpha)
148+
std::size_t compare(mapnik::image_any const& im1, mapnik::image_any const& im2, double threshold, bool alpha)
149149
{
150150
return mapnik::compare(im1, im2, threshold, alpha);
151151
}

src/mapnik_parameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mapnik::parameter get_params_by_index(mapnik::parameters const& p, int index)
165165
throw boost::python::error_already_set();
166166
}
167167

168-
unsigned get_params_size(mapnik::parameters const& p)
168+
std::size_t get_params_size(mapnik::parameters const& p)
169169
{
170170
return p.size();
171171
}

src/python_grid_utils.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ void grid2utf(T const& grid_type,
7171
// start counting at utf8 codepoint 32, aka space character
7272
std::uint16_t codepoint = 32;
7373

74-
unsigned array_size = data.width();
75-
for (unsigned y = 0; y < data.height(); ++y)
74+
std::size_t array_size = data.width();
75+
for (std::size_t y = 0; y < data.height(); ++y)
7676
{
7777
std::uint16_t idx = 0;
7878
const std::unique_ptr<Py_UNICODE[]> line(new Py_UNICODE[array_size]);
7979
typename T::value_type const* row = data.get_row(y);
80-
for (unsigned x = 0; x < data.width(); ++x)
80+
for (std::size_t x = 0; x < data.width(); ++x)
8181
{
8282
typename T::value_type feature_id = row[x];
8383
feature_pos = feature_keys.find(feature_id);
@@ -201,14 +201,13 @@ void grid2utf2(T const& grid_type,
201201
mapnik::grid::data_type target(data.width()/resolution,data.height()/resolution);
202202
mapnik::scale_grid(target,grid_type.data(),0.0,0.0);
203203

204-
unsigned array_size = target.width();
205-
for (unsigned y = 0; y < target.height(); ++y)
204+
std::size_t array_size = target.width();
205+
for (std::size_t y = 0; y < target.height(); ++y)
206206
{
207207
uint16_t idx = 0;
208208
const std::unique_ptr<Py_UNICODE[]> line(new Py_UNICODE[array_size]);
209209
mapnik::grid::value_type * row = target.get_row(y);
210-
unsigned x;
211-
for (x = 0; x < target.width(); ++x)
210+
for (std::size_t x = 0; x < target.width(); ++x)
212211
{
213212
feature_pos = feature_keys.find(row[x]);
214213
if (feature_pos != feature_keys.end())

0 commit comments

Comments
 (0)