From 350e8d74c4bdfc30b248fb4774964f372ffce42c Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sat, 7 May 2016 13:38:27 +0200 Subject: [PATCH] Examples: Avoid signed/unsigned comparison warnings. --- example/fibonacci_heap.cpp | 2 +- example/prim-telephone.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/fibonacci_heap.cpp b/example/fibonacci_heap.cpp index ffa42ab5..ca70367d 100644 --- a/example/fibonacci_heap.cpp +++ b/example/fibonacci_heap.cpp @@ -34,7 +34,7 @@ int main() uniform_int<> distrib(0, N - 1); boost::variate_generator< random_ns::mt19937&, uniform_int<> > rand_gen( gen, distrib); - for (int t = 0; t < 10; ++t) + for (std::size_t t = 0; t < 10; ++t) { std::vector< float > v, w(N); diff --git a/example/prim-telephone.cpp b/example/prim-telephone.cpp index 1f256db0..40b05fc1 100644 --- a/example/prim-telephone.cpp +++ b/example/prim-telephone.cpp @@ -53,12 +53,12 @@ int main() #endif int total_weight = 0; - for (int v = 0; v < num_vertices(g); ++v) + for (std::size_t v = 0; v < num_vertices(g); ++v) if (parent[v] != v) total_weight += get(weight, edge(parent[v], v, g).first); std::cout << "total weight: " << total_weight << std::endl; - for (int u = 0; u < num_vertices(g); ++u) + for (std::size_t u = 0; u < num_vertices(g); ++u) if (parent[u] != u) edge_attr_map[edge(parent[u], u, g_dot).first]["color"] = "black"; std::ofstream out("figs/telephone-mst-prim.dot");