Commit c9e4bfe8 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix compilation warnings

parent 6758e857
......@@ -21,6 +21,17 @@
#include <boost/graph/iteration_macros.hpp>
#endif
// redefine this locally to avoid a stupid compilation warning
#undef BGL_FORALL_ADJ_T
#define BGL_FORALL_ADJ_T(UNAME, VNAME, GNAME, GraphType) \
for (std::pair<typename boost::graph_traits<GraphType>::adjacency_iterator, \
typename boost::graph_traits<GraphType>::adjacency_iterator> BGL_RANGE(__LINE__) = adjacent_vertices(UNAME, GNAME); \
BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \
for (typename boost::graph_traits<GraphType>::vertex_descriptor VNAME = 0; \
BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (VNAME = *BGL_FIRST(__LINE__), true) : false; \
++BGL_FIRST(__LINE__))
namespace boost {
namespace detail {
......
......@@ -64,7 +64,7 @@ struct get_lattice
bool periodic_boundary) const
{
int N = 1;
for (int i = 0; i < shape.size(); ++i)
for (size_t i = 0; i < shape.size(); ++i)
N *= shape[i];
for (int i = 0; i < N; ++i)
add_vertex(g);
......
......@@ -71,8 +71,8 @@ struct get_average
void operator()(Graph& g, DegreeSelector deg) const
{
typedef typename DegreeSelector::value_type value_type;
long double a, aa;
size_t count;
long double a = 0, aa = 0;
size_t count = 0;
AverageTraverse traverse;
int i, N = num_vertices(g);
......
......@@ -44,8 +44,8 @@ bool operator<=(const vector<ValueType>& v1, const vector<ValueType>& v2)
return true;
if (v1.size() > v2.size())
return false;
long double d1, d2;
for (size_t i; i < v1.size(); ++i)
long double d1 = 0, d2 = 0;
for (size_t i = 0; i < v1.size(); ++i)
{
d1 += v1[i]*v1[i];
d2 += v2[i]*v2[i];
......
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