Commit 93ca680b authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Fix compilation issues with g++ 4.6.1 and clang++.

	* mln/topo/center_only_iter.hh,
	* mln/topo/face.hh,
	* mln/trait/images.hh,
	* mln/convert/from_to.hxx,
	* mln/core/image/dmorph/sub_image.hh,
	* mln/core/routine/init.hxx,
	* mln/algebra/vec.hh: Make declaration and forward declarations
	consistent.

	* mln/canvas/browsing/backdiagonal2d.hh,
	* mln/canvas/browsing/breadth_first_search.hh,
	* mln/canvas/browsing/depth_first_search.hh,
	* mln/canvas/browsing/diagonal2d.hh,
	* mln/canvas/browsing/directional.hh,
	* mln/canvas/browsing/fwd.hh,
	* mln/canvas/browsing/hyper_directional.hh,
	* mln/canvas/browsing/snake_fwd.hh,
	* mln/canvas/browsing/snake_generic.hh,
	* mln/canvas/browsing/snake_vert.hh,
	* mln/fun/v2v/hsl_to_rgb.hh,
	* mln/literal/black.hh,
	* mln/literal/colors.hh,
	* mln/literal/white.hh: Add a default constructor for global
	variable types.

	* mln/canvas/browsing/internal/graph_first_search.hh: Avoid a
	warning for an unused variable.

	* mln/data/was.median.hh: Fix type of the reference.
parent 812809e6
2011-11-21 Guillaume Lazzara <z@lrde.epita.fr>
Fix compilation issues with g++ 4.6.1 and clang++.
* mln/topo/center_only_iter.hh,
* mln/topo/face.hh,
* mln/trait/images.hh,
* mln/convert/from_to.hxx,
* mln/core/image/dmorph/sub_image.hh,
* mln/core/routine/init.hxx,
* mln/algebra/vec.hh: Make declaration and forward declarations
consistent.
* mln/canvas/browsing/backdiagonal2d.hh,
* mln/canvas/browsing/breadth_first_search.hh,
* mln/canvas/browsing/depth_first_search.hh,
* mln/canvas/browsing/diagonal2d.hh,
* mln/canvas/browsing/dir_struct_elt_incr_update.hh,
* mln/canvas/browsing/directional.hh,
* mln/canvas/browsing/fwd.hh,
* mln/canvas/browsing/hyper_directional.hh,
* mln/canvas/browsing/snake_fwd.hh,
* mln/canvas/browsing/snake_generic.hh,
* mln/canvas/browsing/snake_vert.hh,
* mln/fun/v2v/hsl_to_rgb.hh,
* mln/literal/black.hh,
* mln/literal/colors.hh,
* mln/literal/white.hh: Add a default constructor for global
variable types.
* mln/canvas/browsing/internal/graph_first_search.hh: Avoid a
warning for an unused variable.
* mln/data/was.median.hh: Fix type of the reference.
2011-10-04 Roland Levillain <roland@lrde.epita.fr> 2011-10-04 Roland Levillain <roland@lrde.epita.fr>
   
Handle the case of filling an empty border. Handle the case of filling an empty border.
...@@ -56,7 +56,7 @@ namespace mln ...@@ -56,7 +56,7 @@ namespace mln
// Forward declarations. // Forward declarations.
namespace algebra { namespace algebra {
template <unsigned n, typename T> class vec; template <unsigned n, typename T> class vec;
template <unsigned d, typename C> struct h_vec; template <unsigned d, typename C> class h_vec;
template <unsigned n, unsigned m, typename T> class mat; template <unsigned n, unsigned m, typename T> class mat;
} }
......
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development // Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Laboratory (LRDE) // Development Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -82,6 +82,10 @@ namespace mln ...@@ -82,6 +82,10 @@ namespace mln
*/ */
struct backdiagonal2d_t : public Browsing< backdiagonal2d_t > struct backdiagonal2d_t : public Browsing< backdiagonal2d_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
backdiagonal2d_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -92,13 +96,15 @@ namespace mln ...@@ -92,13 +96,15 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY # ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS # ifndef MLN_WO_GLOBAL_VARS
const backdiagonal2d_t backdiagonal2d; const backdiagonal2d_t backdiagonal2d;
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
backdiagonal2d_t::backdiagonal2d_t()
{
}
template <typename F> template <typename F>
inline inline
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) // Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
// (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -78,7 +79,11 @@ namespace mln ...@@ -78,7 +79,11 @@ namespace mln
/// Breadth-first search algorithm for graph, on vertices. /// Breadth-first search algorithm for graph, on vertices.
struct breadth_first_search_t : struct breadth_first_search_t :
public internal::graph_first_search_t<breadth_first_search_t, std::queue> public internal::graph_first_search_t<breadth_first_search_t, std::queue>
{}; {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
breadth_first_search_t();
};
extern const breadth_first_search_t breadth_first_search; extern const breadth_first_search_t breadth_first_search;
...@@ -88,6 +93,10 @@ namespace mln ...@@ -88,6 +93,10 @@ namespace mln
const breadth_first_search_t breadth_first_search; const breadth_first_search_t breadth_first_search;
breadth_first_search_t::breadth_first_search_t()
{
}
# endif // ! MLN_INCLUDE_ONLY # endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::canvas::browsing } // end of namespace mln::canvas::browsing
......
// Copyright (C) 2008, 2009, 2010 EPITA Research and Development // Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE) // Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
...@@ -79,7 +79,11 @@ namespace mln ...@@ -79,7 +79,11 @@ namespace mln
/// Breadth-first search algorithm for graph, on vertices. /// Breadth-first search algorithm for graph, on vertices.
struct depth_first_search_t : struct depth_first_search_t :
public internal::graph_first_search_t<depth_first_search_t, std::stack> public internal::graph_first_search_t<depth_first_search_t, std::stack>
{}; {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
depth_first_search_t();
};
extern const depth_first_search_t depth_first_search; extern const depth_first_search_t depth_first_search;
...@@ -93,6 +97,10 @@ namespace mln ...@@ -93,6 +97,10 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
depth_first_search_t::depth_first_search_t()
{
}
# endif // ! MLN_INCLUDE_ONLY # endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::canvas::browsing } // end of namespace mln::canvas::browsing
......
...@@ -81,6 +81,10 @@ namespace mln ...@@ -81,6 +81,10 @@ namespace mln
*/ */
struct diagonal2d_t : public Browsing< diagonal2d_t > struct diagonal2d_t : public Browsing< diagonal2d_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
diagonal2d_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -95,6 +99,10 @@ namespace mln ...@@ -95,6 +99,10 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
diagonal2d_t::diagonal2d_t()
{
}
template <typename F> template <typename F>
inline inline
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) // Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -85,6 +86,10 @@ namespace mln ...@@ -85,6 +86,10 @@ namespace mln
*/ */
struct dir_struct_elt_incr_update_t : public Browsing< dir_struct_elt_incr_update_t > struct dir_struct_elt_incr_update_t : public Browsing< dir_struct_elt_incr_update_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
dir_struct_elt_incr_update_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -95,6 +100,10 @@ namespace mln ...@@ -95,6 +100,10 @@ namespace mln
const dir_struct_elt_incr_update_t dir_struct_elt_incr_update; const dir_struct_elt_incr_update_t dir_struct_elt_incr_update;
dir_struct_elt_incr_update_t::dir_struct_elt_incr_update_t()
{
}
template <typename F> template <typename F>
inline inline
void void
......
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development // Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Laboratory (LRDE) // Development Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -89,6 +89,10 @@ namespace mln ...@@ -89,6 +89,10 @@ namespace mln
*/ */
struct directional_t : public Browsing< directional_t > struct directional_t : public Browsing< directional_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
directional_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -103,6 +107,10 @@ namespace mln ...@@ -103,6 +107,10 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
directional_t::directional_t()
{
}
template <typename F> template <typename F>
inline inline
void void
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) // Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -71,6 +72,10 @@ namespace mln ...@@ -71,6 +72,10 @@ namespace mln
*/ */
struct fwd_t : public Browsing< fwd_t > struct fwd_t : public Browsing< fwd_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
fwd_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -81,6 +86,10 @@ namespace mln ...@@ -81,6 +86,10 @@ namespace mln
const fwd_t fwd; const fwd_t fwd;
fwd_t::fwd_t()
{
}
template <typename F> template <typename F>
inline inline
void void
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) // Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -73,6 +74,10 @@ namespace mln ...@@ -73,6 +74,10 @@ namespace mln
*/ */
struct hyper_directional_t : public Browsing< hyper_directional_t > struct hyper_directional_t : public Browsing< hyper_directional_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
hyper_directional_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -83,6 +88,10 @@ namespace mln ...@@ -83,6 +88,10 @@ namespace mln
const hyper_directional_t hyper_directional; const hyper_directional_t hyper_directional;
hyper_directional_t::hyper_directional_t()
{
}
template <typename F> template <typename F>
inline inline
void void
......
...@@ -128,6 +128,7 @@ namespace mln ...@@ -128,6 +128,7 @@ namespace mln
util::vertex_id_t util::vertex_id_t
next(const S& stack) next(const S& stack)
{ {
(void) stack;
mln_assertion(0); mln_assertion(0);
/// Not defined yet! /// Not defined yet!
// mlc_abort(S)::check(); // mlc_abort(S)::check();
......
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development // Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Laboratory (LRDE) // Development Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -83,6 +83,10 @@ namespace mln ...@@ -83,6 +83,10 @@ namespace mln
struct snake_fwd_t : public Browsing< snake_fwd_t > struct snake_fwd_t : public Browsing< snake_fwd_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
snake_fwd_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
}; };
...@@ -97,6 +101,9 @@ namespace mln ...@@ -97,6 +101,9 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
snake_fwd_t::snake_fwd_t()
{
}
template <typename F> template <typename F>
inline inline
......
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development // Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Laboratory (LRDE) // Development Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -76,6 +76,10 @@ namespace mln ...@@ -76,6 +76,10 @@ namespace mln
struct snake_generic_t : public Browsing< snake_generic_t > struct snake_generic_t : public Browsing< snake_generic_t >
{ {
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
snake_generic_t();
template <typename F> template <typename F>
void operator()(F& f) const; void operator()(F& f) const;
...@@ -91,6 +95,9 @@ namespace mln ...@@ -91,6 +95,9 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS # endif // ! MLN_WO_GLOBAL_VARS
snake_generic_t::snake_generic_t()
{
}
template <typename F> template <typename F>
inline inline
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) // Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -90,7 +91,7 @@ namespace mln ...@@ -90,7 +91,7 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY # ifndef MLN_INCLUDE_ONLY
const snake_vert_t snake_vert; const snake_vert_t snake_vert = snake_vert_t();
template <typename F> template <typename F>
inline inline
......
...@@ -69,7 +69,7 @@ namespace mln ...@@ -69,7 +69,7 @@ namespace mln
namespace algebra { namespace algebra {
template <unsigned n, typename T> class vec; template <unsigned n, typename T> class vec;
template <unsigned d, typename C> struct h_vec; template <unsigned d, typename C> class h_vec;
} }
namespace fun { namespace fun {
......
...@@ -44,7 +44,7 @@ namespace mln ...@@ -44,7 +44,7 @@ namespace mln
// Forward declaration. // Forward declaration.
template <typename I, typename S> struct sub_image; template <typename I, typename S> class sub_image;
namespace internal namespace internal
......
...@@ -37,7 +37,7 @@ namespace mln ...@@ -37,7 +37,7 @@ namespace mln
// Forward declarations. // Forward declarations.
namespace fun { namespace i2v { template <typename T> class array; } } namespace fun { namespace i2v { template <typename T> class array; } }
namespace pw { namespace internal { template <typename F, typename S, typename E> struct image_base; } } namespace pw { namespace internal { template <typename F, typename S, typename E> class image_base; } }
namespace pw { template <typename F, typename S> class image; } namespace pw { template <typename F, typename S> class image; }
template <typename I, typename F> struct image_if; template <typename I, typename F> struct image_if;
......
...@@ -97,8 +97,8 @@ namespace mln ...@@ -97,8 +97,8 @@ namespace mln
med.take(input(q)); med.take(input(q));
} }
int& row = p.row(); def::coord& row = p.row();
int& col = p.col(); def::coord& col = p.col();
bool fwd = true; bool fwd = true;
mln_assertion(p.col() == min_col); mln_assertion(p.col() == min_col);
...@@ -155,8 +155,8 @@ namespace mln ...@@ -155,8 +155,8 @@ namespace mln
const unsigned half = win.length() / 2; const unsigned half = win.length() / 2;
point2d p; point2d p;
int& row = p.row(); def::coord& row = p.row();
int& col = p.col(); def::coord& col = p.col();
accu::stat::median_h<mln_vset(I)> med(input.values()); accu::stat::median_h<mln_vset(I)> med(input.values());
......
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory // Copyright (C) 2008, 2009, 2011 EPITA Research and Development
// (LRDE) // Laboratory (LRDE)
// //
// This file is part of Olena. // This file is part of Olena.
// //
...@@ -71,6 +71,9 @@ namespace mln ...@@ -71,6 +71,9 @@ namespace mln
{ {
typedef T_rgb result; typedef T_rgb result;
f_hsl_to_rgb_();
template <typename T_hsl> template <typename T_hsl>
T_rgb operator()(const T_hsl& hsl) const; T_rgb operator()(const T_hsl& hsl) const;
...@@ -94,6 +97,10 @@ namespace mln ...@@ -94,6 +97,10 @@ namespace mln
/// \} /// \}
# endif // !MLN_WO_GLOBAL_VARS # endif // !MLN_WO_GLOBAL_VARS
template <typename T_rgb>
f_hsl_to_rgb_<T_rgb>::f_hsl_to_rgb_()
{
}
/// This method implements the conversion from HSL to RGB as described by /// This method implements the conversion from HSL to RGB as described by
/// Max K. Agoston in `Computer Graphics and Geometric Modeling: /// Max K. Agoston in `Computer Graphics and Geometric Modeling:
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development // Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development