Skip to content

Commit ce1daeb

Browse files
Merge pull request #405 from murraycu/develop-murrayc-examples-modern-cpp-attempt2
Examples: Fix minor warnings
2 parents 68b08e3 + 350e8d7 commit ce1daeb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

example/fibonacci_heap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main()
3434
uniform_int<> distrib(0, N - 1);
3535
boost::variate_generator< random_ns::mt19937&, uniform_int<> > rand_gen(
3636
gen, distrib);
37-
for (int t = 0; t < 10; ++t)
37+
for (std::size_t t = 0; t < 10; ++t)
3838
{
3939
std::vector< float > v, w(N);
4040

example/graph-thingie.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <boost/foreach.hpp>
1515
#include <string>
1616
#include <sstream>
17+
#include <cstdlib>
1718

1819
using namespace boost;
1920
using namespace std;
@@ -104,5 +105,5 @@ int main()
104105
<< get("label", dp, v) << ")\n";
105106
}
106107

107-
return 0;
108+
return status ? EXIT_SUCCESS : EXIT_FAILURE;
108109
}

example/prim-telephone.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ int main()
5353
#endif
5454

5555
int total_weight = 0;
56-
for (int v = 0; v < num_vertices(g); ++v)
56+
for (std::size_t v = 0; v < num_vertices(g); ++v)
5757
if (parent[v] != v)
5858
total_weight += get(weight, edge(parent[v], v, g).first);
5959
std::cout << "total weight: " << total_weight << std::endl;
6060

61-
for (int u = 0; u < num_vertices(g); ++u)
61+
for (std::size_t u = 0; u < num_vertices(g); ++u)
6262
if (parent[u] != u)
6363
edge_attr_map[edge(parent[u], u, g_dot).first]["color"] = "black";
6464
std::ofstream out("figs/telephone-mst-prim.dot");

0 commit comments

Comments
 (0)