Commit 1f8557cf authored by Roland Levillain's avatar Roland Levillain
Browse files

Address more remaining clang++ errors in Milena.

	* mln/core/concept/proxy.hxx: Add and reorder forward
	declarations.
	* mln/accu/site_set/rectangularity.hh (rectangularity<P>): Do not
	re-import base class attributes as protected members, so that the
	base class can still access them.
	Adjust.
	* mln/geom/seeds2tiling_roundness.hh,
	* mln/subsampling/antialiased.hh,
	* mln/world/inter_pixel/dim2/make_edge_image.hh:
	Add missing header inclusions.
	* mln/io/plot/save.hh (save)
	* mln/morpho/tree/propagate_node.hh
	(propagate_node_to_descendants):
	Do not provide default arguments twice.
	* mln/topo/face_iter.hh,
	* mln/topo/n_face_iter.hh:
	Add `this->' qualifiers to disambiguate calls to base class
	methods.
	* tests/metal/converts_to.cc (from_2): Do not rely on
	uninitialized data.
	(main): Add a test case.
parent c52c5f64
2013-02-05 Roland Levillain <roland@lrde.epita.fr>
Address more remaining clang++ errors in Milena.
* mln/core/concept/proxy.hxx: Add and reorder forward
declarations.
* mln/accu/site_set/rectangularity.hh (rectangularity<P>): Do not
re-import base class attributes as protected members, so that the
base class can still access them.
Adjust.
* mln/geom/seeds2tiling_roundness.hh,
* mln/subsampling/antialiased.hh,
* mln/world/inter_pixel/dim2/make_edge_image.hh:
Add missing header inclusions.
* mln/io/plot/save.hh (save)
* mln/morpho/tree/propagate_node.hh
(propagate_node_to_descendants):
Do not provide default arguments twice.
* mln/topo/face_iter.hh,
* mln/topo/n_face_iter.hh:
Add `this->' qualifiers to disambiguate calls to base class
methods.
* tests/metal/converts_to.cc (from_2): Do not rely on
uninitialized data.
(main): Add a test case.
2012-03-09 Roland Levillain <roland@lrde.epita.fr> 2012-03-09 Roland Levillain <roland@lrde.epita.fr>
   
More clang++ support in Milena. More clang++ support in Milena.
// 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. // This file is part of Olena.
// //
...@@ -77,13 +77,9 @@ namespace mln ...@@ -77,13 +77,9 @@ namespace mln
/// Return the rectangularity value. /// Return the rectangularity value.
result to_result() const; result to_result() const;
protected:
using super_::a1_;
using super_::a2_;
}; };
# ifndef MLN_INCLUDE_ONLY # ifndef MLN_INCLUDE_ONLY
template <typename P> template <typename P>
...@@ -97,8 +93,8 @@ namespace mln ...@@ -97,8 +93,8 @@ namespace mln
mln_result(rectangularity<P>::A1) mln_result(rectangularity<P>::A1)
rectangularity<P>::bbox() const rectangularity<P>::bbox() const
{ {
mln_precondition(a1_.is_valid()); mln_precondition(this->a1_.is_valid());
return a1_.to_result(); return this->a1_.to_result();
} }
template <typename P> template <typename P>
...@@ -106,8 +102,8 @@ namespace mln ...@@ -106,8 +102,8 @@ namespace mln
mln_result(rectangularity<P>::A2) mln_result(rectangularity<P>::A2)
rectangularity<P>::area() const rectangularity<P>::area() const
{ {
mln_precondition(a2_.is_valid()); mln_precondition(this->a2_.is_valid());
return a2_.to_result(); return this->a2_.to_result();
} }
template <typename P> template <typename P>
...@@ -117,7 +113,8 @@ namespace mln ...@@ -117,7 +113,8 @@ namespace mln
{ {
mln_precondition(this->is_valid()); mln_precondition(this->is_valid());
// Force division return type. // Force division return type.
return static_cast<result>(a2_.to_result()) / a1_.to_result().nsites(); return static_cast<result>
(this->a2_.to_result()) / this->a1_.to_result().nsites();
} }
# endif // ! MLN_INCLUDE_ONLY # endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2008, 2009, 2012 EPITA Research and Development // Copyright (C) 2008, 2009, 2012, 2013 EPITA Research and Development
// Laboratory (LRDE) // Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
...@@ -42,9 +42,25 @@ ...@@ -42,9 +42,25 @@
namespace mln namespace mln
{ {
// Fwd decls. /// Fwd decls.
/// \{
template <typename E> struct Proxy; template <typename E> struct Proxy;
namespace internal
{
template <typename T>
struct unproxy_rec_;
}
template <typename T>
typename mln::internal::unproxy_rec_<T>::ret
unproxy_rec(T& t);
template <typename T>
typename mln::internal::unproxy_rec_<const T>::ret
unproxy_rec(const T& t);
/// \}
namespace internal namespace internal
{ {
...@@ -81,9 +97,6 @@ namespace mln ...@@ -81,9 +97,6 @@ namespace mln
template <typename T>
struct unproxy_rec_;
template <typename O, bool is_proxy> template <typename O, bool is_proxy>
struct helper_unproxy_rec; struct helper_unproxy_rec;
......
// 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. // This file is part of Olena.
// //
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
# include <map> # include <map>
# include <mln/core/concept/image.hh> # include <mln/core/concept/image.hh>
# include <mln/core/image/image2d.hh>
# include <mln/core/concept/neighborhood.hh> # include <mln/core/concept/neighborhood.hh>
# include <mln/core/alias/w_window2d_int.hh> # include <mln/core/alias/w_window2d_int.hh>
# include <mln/core/site_set/p_priority.hh> # include <mln/core/site_set/p_priority.hh>
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory // Copyright (C) 2009, 2010, 2013 EPITA Research and Development Laboratory
// (LRDE) // (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
...@@ -87,7 +87,7 @@ namespace mln ...@@ -87,7 +87,7 @@ namespace mln
template <typename T> template <typename T>
inline inline
void save(const util::array<T>& arr, const std::string& filename, void save(const util::array<T>& arr, const std::string& filename,
int start_value = 0) int start_value)
{ {
trace::entering("mln::io::plot::save"); trace::entering("mln::io::plot::save");
......
// 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. // This file is part of Olena.
// //
...@@ -121,7 +121,7 @@ namespace mln ...@@ -121,7 +121,7 @@ namespace mln
const T& t, const T& t,
Image<A>& a_, Image<A>& a_,
const mln_value(A)& v, const mln_value(A)& v,
unsigned* nb_leaves = 0) unsigned* nb_leaves)
{ {
A& a = exact(a_); A& a = exact(a_);
mln_precondition(a.is_valid()); mln_precondition(a.is_valid());
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory // Copyright (C) 2009, 2010, 2013 EPITA Research and Development Laboratory
// (LRDE) // (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <mln/core/concept/image.hh> #include <mln/core/concept/image.hh>
#include <mln/core/alias/point2d.hh>
#include <mln/border/thickness.hh> #include <mln/border/thickness.hh>
#include <mln/extension/adjust_duplicate.hh> #include <mln/extension/adjust_duplicate.hh>
#include <mln/core/macros.hh> #include <mln/core/macros.hh>
......
// 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. // This file is part of Olena.
// //
...@@ -162,7 +163,7 @@ namespace mln ...@@ -162,7 +163,7 @@ namespace mln
face_fwd_iter<D>::face_fwd_iter(complex<D>& c) face_fwd_iter<D>::face_fwd_iter(complex<D>& c)
: super_(c) : super_(c)
{ {
set_cplx(c); this->set_cplx(c);
mln_postcondition(!is_valid()); mln_postcondition(!is_valid());
} }
...@@ -214,7 +215,7 @@ namespace mln ...@@ -214,7 +215,7 @@ namespace mln
face_bkd_iter<D>::face_bkd_iter(complex<D>& c) face_bkd_iter<D>::face_bkd_iter(complex<D>& c)
: super_(c) : super_(c)
{ {
set_cplx(c); this->set_cplx(c);
mln_postcondition(!is_valid()); mln_postcondition(!is_valid());
} }
......
// 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. // This file is part of Olena.
// //
...@@ -191,7 +192,7 @@ namespace mln ...@@ -191,7 +192,7 @@ namespace mln
: super_(c) : super_(c)
{ {
mln_precondition(n <= D); mln_precondition(n <= D);
set_cplx(c); this->set_cplx(c);
set_n(n); set_n(n);
mln_postcondition(!is_valid()); mln_postcondition(!is_valid());
} }
......
// 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. // This file is part of Olena.
// //
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
/// ///
/// Construct a valued image of edges. /// Construct a valued image of edges.
# include <mln/core/image/image2d.hh>
# include <mln/core/image/dmorph/extension_ima.hh> # include <mln/core/image/dmorph/extension_ima.hh>
# include <mln/core/image/dmorph/image_if.hh> # include <mln/core/image/dmorph/image_if.hh>
......
// 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. // This file is part of Olena.
// //
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
#include <mln/metal/converts_to.hh> #include <mln/metal/converts_to.hh>
#include <mln/accu/math/sum.hh>
struct from_1 struct from_1
...@@ -38,7 +40,7 @@ struct dest ...@@ -38,7 +40,7 @@ struct dest
struct from_2 struct from_2
{ {
operator dest() const { dest* tmp; return *tmp; } operator dest() const { dest* tmp = 0; return *tmp; }
}; };
...@@ -72,6 +74,8 @@ int main() ...@@ -72,6 +74,8 @@ int main()
metal::converts_to<derived, base>::check(); metal::converts_to<derived, base>::check();
metal::converts_to<derived, const base>::check(); metal::converts_to<derived, const base>::check();
metal::converts_to<accu::math::sum<int, int>, int>::check();
// metal::converts_to<derived, base_>::check_not(); // metal::converts_to<derived, base_>::check_not();
// metal::converts_to<derived, const base_>::check_not(); // metal::converts_to<derived, const base_>::check_not();
} }
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