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
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -42,146 +42,244 @@ namespace mln
/// Type of literal red.
struct red_t : public Literal<red_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
red_t();
};
/// Type of literal green.
struct green_t : public Literal<green_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
green_t();
};
/// Type of literal blue.
struct blue_t : public Literal<blue_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
blue_t();
};
/// Type of literal brown.
struct brown_t : public Literal<brown_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
brown_t();
};
/// Type of literal lime.
struct lime_t : public Literal<lime_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
lime_t();
};
/// Type of literal orange.
struct orange_t : public Literal<orange_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
orange_t();
};
/// Type of literal pink.
struct pink_t : public Literal<pink_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
pink_t();
};
/// Type of literal purple.
struct purple_t : public Literal<purple_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
purple_t();
};
/// Type of literal teal.
struct teal_t : public Literal<teal_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
teal_t();
};
/// Type of literal violet.
struct violet_t : public Literal<violet_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
violet_t();
};
/// Type of literal cyan.
struct cyan_t : public Literal<cyan_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
cyan_t();
};
/// Type of literal magenta.
struct magenta_t : public Literal<magenta_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
magenta_t();
};
/// Type of literal yellow.
struct yellow_t : public Literal<yellow_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
yellow_t();
};
/// Type of literal olive.
struct olive_t : public Literal<olive_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
olive_t();
};
/// Literal red.
extern const red_t& red;
extern const red_t red;
/// Literal green.
extern const green_t& green;
extern const green_t green;
/// Literal blue.
extern const blue_t& blue;
extern const blue_t blue;
/// Literal brown.
extern const brown_t& brown;
extern const brown_t brown;
/// Literal lime.
extern const lime_t& lime;
extern const lime_t lime;
/// Literal orange.
extern const orange_t& orange;
extern const orange_t orange;
/// Literal pink.
extern const pink_t& pink;
extern const pink_t pink;
/// Literal purple.
extern const purple_t& purple;
extern const purple_t purple;
/// Literal teal.
extern const teal_t& teal;
extern const teal_t teal;
/// Literal violet.
extern const violet_t& violet;
extern const violet_t violet;
/// Literal cyan.
extern const cyan_t& cyan;
extern const cyan_t cyan;
/// Literal magenta.
extern const magenta_t& magenta;
extern const magenta_t magenta;
/// Literal yellow.
extern const yellow_t& yellow;
extern const yellow_t yellow;
/// Literal olive.
extern const olive_t& olive;
extern const olive_t olive;
# ifndef MLN_INCLUDE_ONLY
red_t::red_t()
{
}
green_t::green_t()
{
}
blue_t::blue_t()
{
}
brown_t::brown_t()
{
}
lime_t::lime_t()
{
}
orange_t::orange_t()
{
}
pink_t::pink_t()
{
}
purple_t::purple_t()
{
}
teal_t::teal_t()
{
}
violet_t::violet_t()
{
}
cyan_t::cyan_t()
{
}
magenta_t::magenta_t()
{
}
yellow_t::yellow_t()
{
}
olive_t::olive_t()
{
}
# ifndef MLN_WO_GLOBAL_VARS
const red_t& red = red_t();
const red_t red;
const green_t& green = green_t();
const green_t green;
const blue_t& blue = blue_t();
const blue_t blue;
const brown_t& brown = brown_t();
const brown_t brown;
const lime_t& lime = lime_t();
const lime_t lime;
const orange_t& orange = orange_t();
const orange_t orange;
const pink_t& pink = pink_t();
const pink_t pink;
const purple_t& purple = purple_t();
const purple_t purple;
const teal_t& teal = teal_t();
const teal_t teal;
const violet_t& violet = violet_t();
const violet_t violet;
const cyan_t& cyan = cyan_t();
const cyan_t cyan;
const magenta_t& magenta = magenta_t();
const magenta_t magenta;
const yellow_t& yellow = yellow_t();
const yellow_t yellow;
const olive_t& olive = olive_t();
const olive_t olive;
# endif
......
......@@ -42,6 +42,10 @@ namespace mln
/// Type of literal white.
struct white_t : public Literal<white_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
white_t();
# ifdef MLN_NEW_VALUE_TYPES
operator float() const;
operator double() const;
......@@ -50,17 +54,21 @@ namespace mln
/// Literal white.
extern const white_t& white;
extern const white_t white;
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const white_t& white = white_t();
const white_t white;
# endif
white_t::white_t()
{
}
# ifdef MLN_NEW_VALUE_TYPES
inline
white_t::operator float() const
......
......@@ -45,7 +45,7 @@ namespace mln
{
// Forward declaration.
template <unsigned D> struct face;
template <unsigned D> class face;
/*----------------------------.
......
......@@ -49,7 +49,7 @@ namespace mln
template <unsigned D> class complex;
template <unsigned N, unsigned D> class n_face;
template <unsigned N, unsigned D> class face_data;
template <unsigned N> struct algebraic_face;
template <unsigned N> class algebraic_face;
/*-------.
......
......@@ -118,7 +118,7 @@ namespace mln
// Morphers.
template <typename I, typename F> struct image_if_base;
template <typename I, typename D> struct decorated_image;
template <typename I, typename S> struct sub_image;
template <typename I, typename S> class sub_image;
template <typename I> class safe_image;
template <typename T, typename I> struct cast_image_;
namespace value { template <unsigned n, typename I> struct stack_image; }
......
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