Commit 8ae6c4cd authored by Roland Levillain's avatar Roland Levillain
Browse files

Address warnings reported by clang++ in Milena.

	* mln/canvas/browsing/diagonal2d.hh (diagonal2d_t::operator())
	* mln/clustering/kmean_rgb.hh (internal::kmean_rgb_dispatch)
	* mln/labeling/value_and_compute.hh
	(internal::value_and_compute_tests)
	(impl::process__)
	* mln/metal/math/root.hh (impl::root<n, x, lo, hi>::value): Add an
	explicit type conversion of operator<'s the right-hand side
	operand.
	* mln/morpho/watershed/topological.hh (topological)
	* mln/world/rgb/invert.hh (internal::invert_dispatch):
	Remove unused variables.
	Do not name unused arguments.
	* mln/util/object_id.hh
	(operator==(const object_id<Tag,V>&, const Value<V2>&)):
	Add an explicit type conversion of the right-hand side operand.
	* mln/world/rgb/invert.hh,
	* tests/core/alias/point1d.cc,
	* tests/make/p_edges_with_mass_centers.cc,
	* tests/make/p_vertices_with_mass_centers.cc,
	* tests/value/int_s16.cc,
	* tests/value/int_u8.cc:
	Shush the compiler about unused variables.
	* tests/trait/op/plus.cc (mln::my_image2d<T>): Complete this type
	to have it comply with the mln::Image concept.
	(mln::dummy_t): New (dummy) type.
	(dummy): New (dummy) value.
	(main): Do not use uninitialized pointers.
parent f2b50a1a
2013-02-07 Roland Levillain <roland@lrde.epita.fr>
Address warnings reported by clang++ in Milena.
* mln/canvas/browsing/diagonal2d.hh (diagonal2d_t::operator())
* mln/clustering/kmean_rgb.hh (internal::kmean_rgb_dispatch)
* mln/labeling/value_and_compute.hh
(internal::value_and_compute_tests)
(impl::process__)
* mln/metal/math/root.hh (impl::root<n, x, lo, hi>::value): Add an
explicit type conversion of operator<'s the right-hand side
operand.
* mln/morpho/watershed/topological.hh (topological)
* mln/world/rgb/invert.hh (internal::invert_dispatch):
Remove unused variables.
Do not name unused arguments.
* mln/util/object_id.hh
(operator==(const object_id<Tag,V>&, const Value<V2>&)):
Add an explicit type conversion of the right-hand side operand.
* mln/world/rgb/invert.hh,
* tests/core/alias/point1d.cc,
* tests/make/p_edges_with_mass_centers.cc,
* tests/make/p_vertices_with_mass_centers.cc,
* tests/value/int_s16.cc,
* tests/value/int_u8.cc:
Shush the compiler about unused variables.
* tests/trait/op/plus.cc (mln::my_image2d<T>): Complete this type
to have it comply with the mln::Image concept.
(mln::dummy_t): New (dummy) type.
(dummy): New (dummy) value.
(main): Do not use uninitialized pointers.
2013-02-06 Roland Levillain <roland@lrde.epita.fr>
 
Disambiguate operator- overload resolution with a pow_int_ operand.
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2010, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -123,9 +123,7 @@ namespace mln
mln_deduce(I, psite, delta) diag;
psite
pmin = f.input.domain().pmin(),
pmax = f.input.domain().pmax();
psite pmin = f.input.domain().pmin();
f.p = pmin;
......
// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2010, 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -966,8 +966,8 @@ namespace mln
const unsigned k_center,
const unsigned watch_dog,
const unsigned n_times,
const value::rgb<n>&,
const point2d&)
const value::rgb<n>& /* v */,
const point2d& /* p */)
{
return impl::kmean_image2d_rgb<T,n>(img, k_center, watch_dog, n_times);
}
......@@ -975,12 +975,12 @@ namespace mln
template <typename T, unsigned n, typename I, typename V, typename P>
inline
mln_ch_value(I,value::label_8)
kmean_rgb_dispatch(const Image<I>& img,
const unsigned k_center,
const unsigned watch_dog,
const unsigned n_times,
const V&,
const P&)
kmean_rgb_dispatch(const Image<I>& /* img */,
const unsigned /* k_center */,
const unsigned /* watch_dog */,
const unsigned /* n_times */,
const V& /* v */,
const P& /* p */)
{
// No kmean implementation found.
mlc_abort(I)::check();
......
// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2010, 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -71,18 +71,16 @@ namespace mln
template <typename I, typename N, typename L, typename A>
void
value_and_compute_tests(const Image<I>& input, const mln_value(I)& val,
const Neighborhood<N>& nbh, L& nlabels,
const Accumulator<A>& accu)
value_and_compute_tests(const Image<I>& input,
const mln_value(I)& /* val */,
const Neighborhood<N>& nbh, L& /* nlabels */,
const Accumulator<A>& /* accu */)
{
mln_precondition(exact(input).is_valid());
mln_precondition(exact(nbh).is_valid());
(void) accu;
(void) input;
(void) val;
(void) nbh;
(void) nlabels;
}
} // end of namespace mln::labeling::internal
......@@ -190,7 +188,7 @@ namespace mln
template <typename V>
inline
void process__(const V&, const mln_site(I)&, const L& l)
void process__(const V&, const mln_site(I)&, const L& /* l */)
{
mlc_abort(V)::check();
}
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -60,7 +61,7 @@ namespace mln
val_lo = root<n, x, lo, mid-1>::value,
val_hi = root<n, x, mid, hi>::value
};
enum { value = x < mlc_pow_int(mid, n) ? val_lo : val_hi };
enum { value = x < unsigned(mlc_pow_int(mid, n)) ? val_lo : val_hi };
};
template<unsigned n, unsigned x, unsigned m>
......
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -692,7 +693,6 @@ namespace mln
p_priority< mln_value(I), p_queue_fast<mln_site(I)> > l;
// p_queue < site > m;
std::queue<mln_site(I)> m;
mln_value(I) min = mln_min(mln_value(I));
std::cout << "Init" << std::endl;
......
// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
// Copyright (C) 2009, 2011, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
......@@ -209,7 +209,7 @@ namespace mln
bool
operator==(const object_id<Tag,V>& lhs, const Value<V2>& rhs)
{
return lhs.value() == exact(rhs).to_equiv();
return lhs.value() == static_cast<V>(exact(rhs).to_equiv());
}
template <typename Tag, typename V>
......
// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2010, 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -130,9 +130,9 @@ namespace mln
inline
void
invert_dispatch(trait::image::speed::any, const mln_value(I)&,
const I& input, O& output)
const I& /* input*/ , O& /* output */)
{
// No implementation found. May be input is not a RGB image?
// No implementation found. Maybe `input' is not an RGB image?
mlc_abort(I)::check();
}
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -28,6 +29,8 @@
using namespace mln;
/* FIXME: Complete or at least describe the purpose of these empty
functions. */
void run_in_3d(const algebra::vec<3, float>&)
{
......@@ -45,9 +48,9 @@ void foo(const mln::algebra::h_vec<3,float>&)
int main()
{
algebra::vec<3, def::coord> x;
algebra::h_vec<3, def::coord> w = x.to_h_vec();
(void) w;
typedef algebra::h_vec<3, def::coord> p3d;
p3d p;
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -25,6 +26,7 @@
#include <mln/core/alias/point1d.hh>
#include <mln/math/abs.hh>
int main()
......@@ -33,19 +35,17 @@ int main()
point1d p, q;
// assignment
p[0] = 4;
algebra::vec<1,float> v = p;
mln_assertion(v[0] == 4);
p.ind() += 1;
mln_assertion(p.ind() == 5 && p[0] == 5);
// construction
q.ind() = 5;
mln_assertion(p == q);
q.set_all(0);
for (unsigned i = 0; i < p.dim; ++i)
for (unsigned i = 0; i < q.dim; ++i)
mln_assertion(q[i] == 0);
}
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -59,7 +59,6 @@ int main()
g.add_edge(4,3);
g.add_edge(4,2);
L nbasins = 4;
typedef p_edges<G,fun::i2v::array<util::site_pair<point2d> > > pe_t;
pe_t pe = make::p_edges_with_mass_centers(wst, g);
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -57,7 +57,6 @@ int main()
g.add_edge(4,3);
g.add_edge(4,2);
L nbasins = 4;
typedef p_vertices<G,fun::i2v::array<point2d> > pv_t;
pv_t pv = make::p_vertices_with_mass_centers(wst, g);
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -32,11 +33,46 @@
namespace mln
{
struct dummy_t {};
dummy_t dummy;
template <typename T>
struct my_image2d : Image< my_image2d<T> >
{
void m() {}
// Dummy typedefs and methods added to comply with interface
// requirements of concept Image.
typedef dummy_t domain_t;
typedef dummy_t site;
typedef dummy_t psite;
typedef dummy_t piter;
typedef dummy_t fwd_piter;
typedef dummy_t bkd_piter;
bool has(const psite& /* p */) const { return false; }
bool is_valid() const { return true; }
typedef dummy_t t_eligible_values_set;
const t_eligible_values_set& values_eligible() const { return dummy; }
typedef dummy_t t_values_space;
const t_values_space& values_space() const { return dummy; }
typedef dummy_t value;
typedef dummy_t rvalue;
typedef dummy_t lvalue;
rvalue operator()(const psite& /* p */) const { return dummy; }
lvalue operator()(const psite& /* p */) { return dummy; }
const domain_t& domain() const { return dummy; }
typedef dummy_t skeleton;
void init_(const dummy_t&) {};
};
......@@ -82,7 +118,8 @@ int main()
tmp = 5.1f;
}
{
my_image2d<float>* ptr;
my_image2d<float> ima;
my_image2d<float>* ptr = &ima;
mln_trait_op_plus_(my_image2d<int>, my_image2d<float>) tmp = *ptr;
tmp.m();
}
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -192,7 +193,7 @@ int main()
mln_assertion(c == 100);
int_s16 d = 2;
c /= 2;
c /= d;
mln_assertion(c == 50);
}
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -176,7 +177,7 @@ int main()
sym_compare_assert(c, ==, 100.f);
int_u8 d = 2;
c /= 2;
c /= d;
sym_compare_assert(c, ==, 50.f);
// FIXME: Triggers a warning about signed vs unsigned comparison.
......
Supports Markdown
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