Commit 4e8bcd25 authored by Davis King's avatar Davis King

Fixing yet more compiler warnings on older versions of gcc

parent 2021d6ed
...@@ -483,8 +483,8 @@ namespace dlib ...@@ -483,8 +483,8 @@ namespace dlib
if (set1 != set2) if (set1 != set2)
{ {
const diff_type diff = sorted_edges[i].diff; const diff_type diff = sorted_edges[i].diff;
const diff_type tau1 = k/data[set1].component_size; const diff_type tau1 = static_cast<diff_type>(k/data[set1].component_size);
const diff_type tau2 = k/data[set2].component_size; const diff_type tau2 = static_cast<diff_type>(k/data[set2].component_size);
const diff_type mint = std::min(data[set1].internal_diff + tau1, const diff_type mint = std::min(data[set1].internal_diff + tau1,
data[set2].internal_diff + tau2); data[set2].internal_diff + tau2);
......
...@@ -258,7 +258,9 @@ namespace ...@@ -258,7 +258,9 @@ namespace
{ {
for (long c = 0; c < images[i].nc(); ++c) for (long c = 0; c < images[i].nc(); ++c)
{ {
images[i][r][c] = put_in_range(0,255,images[i][r][c] + 10*rnd.get_random_gaussian()); typedef typename image_array_type::type image_type;
typedef typename image_type::type type;
images[i][r][c] = (type)put_in_range(0,255,images[i][r][c] + 10*rnd.get_random_gaussian());
} }
} }
} }
...@@ -356,7 +358,9 @@ namespace ...@@ -356,7 +358,9 @@ namespace
{ {
for (long c = 0; c < images[i].nc(); ++c) for (long c = 0; c < images[i].nc(); ++c)
{ {
images[i][r][c] = put_in_range(0,255,images[i][r][c] + 40*rnd.get_random_gaussian()); typedef typename image_array_type::type image_type;
typedef typename image_type::type type;
images[i][r][c] = (type)put_in_range(0,255,images[i][r][c] + 40*rnd.get_random_gaussian());
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment