
* mln/canvas/browsing/snake_vert.hh, * mln/fun/v2v/hsi_to_rgb.hh, * mln/fun/v2v/rgb_to_hsi.hh, * mln/fun/v2v/rgb_to_hsl.hh, * mln/literal/grays.hh, * mln/literal/identity.hh, * mln/literal/max.hh, * mln/literal/min.hh, * mln/literal/one.hh, * mln/literal/origin.hh, * mln/literal/zero.hh: Add default constructors. --- milena/ChangeLog | 16 ++++++++++ milena/mln/canvas/browsing/snake_vert.hh | 11 +++++++ milena/mln/fun/v2v/hsi_to_rgb.hh | 13 ++++++++- milena/mln/fun/v2v/rgb_to_hsi.hh | 8 +++++ milena/mln/fun/v2v/rgb_to_hsl.hh | 7 ++++ milena/mln/literal/grays.hh | 45 ++++++++++++++++++++++++----- milena/mln/literal/identity.hh | 15 ++++++++-- milena/mln/literal/max.hh | 13 +++++++- milena/mln/literal/min.hh | 10 ++++++- milena/mln/literal/one.hh | 16 ++++++++-- milena/mln/literal/origin.hh | 15 ++++++++-- milena/mln/literal/zero.hh | 18 +++++++++-- 12 files changed, 162 insertions(+), 25 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 724f344..555ea72 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,19 @@ +2011-11-23 Guillaume Lazzara <z@lrde.epita.fr> + + Fix more compilation issues with g++ 4.6.1 and clang++. + + * mln/canvas/browsing/snake_vert.hh, + * mln/fun/v2v/hsi_to_rgb.hh, + * mln/fun/v2v/rgb_to_hsi.hh, + * mln/fun/v2v/rgb_to_hsl.hh, + * mln/literal/grays.hh, + * mln/literal/identity.hh, + * mln/literal/max.hh, + * mln/literal/min.hh, + * mln/literal/one.hh, + * mln/literal/origin.hh, + * mln/literal/zero.hh: Add default constructors. + 2011-11-21 Guillaume Lazzara <z@lrde.epita.fr> Fix compilation issues with g++ 4.6.1 and clang++. diff --git a/milena/mln/canvas/browsing/snake_vert.hh b/milena/mln/canvas/browsing/snake_vert.hh index 416786c..c984192 100644 --- a/milena/mln/canvas/browsing/snake_vert.hh +++ b/milena/mln/canvas/browsing/snake_vert.hh @@ -83,6 +83,10 @@ namespace mln struct snake_vert_t : public Browsing< snake_vert_t > { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + snake_vert_t(); + template <typename F> void operator()(F& f) const; }; @@ -93,6 +97,13 @@ namespace mln const snake_vert_t snake_vert = snake_vert_t(); +# endif // ! MLN_WO_GLOBAL_VARS + + inline + snake_vert_t::snake_vert_t() + { + } + template <typename F> inline void diff --git a/milena/mln/fun/v2v/hsi_to_rgb.hh b/milena/mln/fun/v2v/hsi_to_rgb.hh index 947e7c4..40201db 100644 --- a/milena/mln/fun/v2v/hsi_to_rgb.hh +++ b/milena/mln/fun/v2v/hsi_to_rgb.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -57,6 +58,8 @@ namespace mln { typedef T_rgb result; + f_hsi_to_rgb_(); + template <typename T_hsi> T_rgb operator()(const T_hsi& hsi) const; @@ -74,6 +77,14 @@ namespace mln f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8; /// \} +# endif // ! MLN_WO_GLOBAL_VARS + + + template <typename T_rgb> + f_hsi_to_rgb_<T_rgb>::f_hsi_to_rgb_() + { + } + template <typename T_rgb> template <typename T_hsi> inline diff --git a/milena/mln/fun/v2v/rgb_to_hsi.hh b/milena/mln/fun/v2v/rgb_to_hsi.hh index e80cd00..7001813 100644 --- a/milena/mln/fun/v2v/rgb_to_hsi.hh +++ b/milena/mln/fun/v2v/rgb_to_hsi.hh @@ -49,6 +49,8 @@ namespace mln { typedef T_hsi result; + f_rgb_to_hsi_(); + template <typename T_rgb> T_hsi operator()(const T_rgb& rgb) const; @@ -67,6 +69,12 @@ namespace mln /// \} + + template <typename T_hsi> + f_rgb_to_hsi_<T_hsi>::f_rgb_to_hsi_() + { + } + template <typename T_hsi> template <typename T_rgb> inline diff --git a/milena/mln/fun/v2v/rgb_to_hsl.hh b/milena/mln/fun/v2v/rgb_to_hsl.hh index a3da15d..0f63ccd 100644 --- a/milena/mln/fun/v2v/rgb_to_hsl.hh +++ b/milena/mln/fun/v2v/rgb_to_hsl.hh @@ -58,6 +58,8 @@ namespace mln { typedef T_hsl result; + f_rgb_to_hsl_(); + template <typename T_rgb> T_hsl operator()(const T_rgb& rgb) const; @@ -77,6 +79,11 @@ namespace mln template <typename T_hsl> + f_rgb_to_hsl_f_t<T_hsl>::f_rgb_to_hsl_f_t() + { + } + + template <typename T_hsl> template <typename T_rgb> inline T_hsl diff --git a/milena/mln/literal/grays.hh b/milena/mln/literal/grays.hh index 79aef78..42dce90 100644 --- a/milena/mln/literal/grays.hh +++ b/milena/mln/literal/grays.hh @@ -1,4 +1,5 @@ -// 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. // @@ -27,7 +28,7 @@ # define MLN_LITERAL_GRAYS_HH /*! \file - * \brief Definition of the colors literal. + * \brief Definition of the grays literal. * */ @@ -42,32 +43,60 @@ namespace mln /// Type of literal grays. struct light_gray_t : public Literal<light_gray_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + light_gray_t(); }; struct medium_gray_t : public Literal<medium_gray_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + medium_gray_t(); }; struct dark_gray_t : public Literal<dark_gray_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + dark_gray_t(); }; /// Literal light gray. - extern const light_gray_t& light_gray; + extern const light_gray_t light_gray; /// Literal medium_gray. - extern const medium_gray_t& medium_gray; + extern const medium_gray_t medium_gray; /// Literal dark gray. - extern const dark_gray_t& dark_gray; + extern const dark_gray_t dark_gray; # ifndef MLN_INCLUDE_ONLY - const light_gray_t& light_gray = light_gray_t(); +# ifndef MLN_WO_GLOBAL_VARS - const medium_gray_t& medium_gray = medium_gray_t(); + const light_gray_t light_gray; - const dark_gray_t& dark_gray = dark_gray_t(); + const medium_gray_t medium_gray; + + const dark_gray_t dark_gray; + +# endif // ! MLN_WO_GLOBAL_VARS + + inline + light_gray_t::light_gray_t() + { + } + + inline + medium_gray_t::medium_gray_t() + { + } + + inline + dark_gray_t::dark_gray_t() + { + } # endif // !MLN_INCLUDE_ONLY diff --git a/milena/mln/literal/identity.hh b/milena/mln/literal/identity.hh index f07081f..8e78aad 100644 --- a/milena/mln/literal/identity.hh +++ b/milena/mln/literal/identity.hh @@ -1,4 +1,5 @@ -// 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. // @@ -42,16 +43,24 @@ namespace mln /// Type of literal identity. struct identity_t : public Literal<identity_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + identity_t(); }; /// Literal identity. - extern const identity_t& identity; + extern const identity_t identity; # ifndef MLN_INCLUDE_ONLY + inline + identity_t::identity_t() + { + } + # ifndef MLN_WO_GLOBAL_VARS - const identity_t& identity = identity_t(); + const identity_t identity; # endif // !MLN_WO_GLOBAL_VARS diff --git a/milena/mln/literal/max.hh b/milena/mln/literal/max.hh index f590f8f..630584c 100644 --- a/milena/mln/literal/max.hh +++ b/milena/mln/literal/max.hh @@ -1,4 +1,5 @@ -// 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. // @@ -43,6 +44,9 @@ namespace mln /// Type of literal max. struct max_t : public Literal<max_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + max_t(); template <typename T> operator T () const; @@ -50,11 +54,16 @@ namespace mln /// Literal max. - extern const max_t& max; + extern const max_t max; # ifndef MLN_INCLUDE_ONLY + inline + max_t::max_t() + { + } + template <typename T> inline max_t::operator T () const diff --git a/milena/mln/literal/min.hh b/milena/mln/literal/min.hh index 5d37857..eb1abc8 100644 --- a/milena/mln/literal/min.hh +++ b/milena/mln/literal/min.hh @@ -43,6 +43,9 @@ namespace mln /// Type of literal min. struct min_t : public Literal<min_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + min_t(); template <typename T> operator T () const; @@ -50,11 +53,16 @@ namespace mln /// Literal min. - extern const min_t& min; + extern const min_t min; # ifndef MLN_INCLUDE_ONLY + inline + min_t::min_t() + { + } + template <typename T> inline min_t::operator T () const diff --git a/milena/mln/literal/one.hh b/milena/mln/literal/one.hh index 94babc7..310c6f6 100644 --- a/milena/mln/literal/one.hh +++ b/milena/mln/literal/one.hh @@ -1,4 +1,5 @@ -// 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. // @@ -43,6 +44,10 @@ namespace mln /// Type of literal one. struct one_t : public Literal<one_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + one_t(); + // FIXME: Cf. comments in literal/zero.hh. template <typename T> @@ -51,11 +56,16 @@ namespace mln /// Literal one. - extern const one_t& one; + extern const one_t one; # ifndef MLN_INCLUDE_ONLY + inline + one_t::one_t() + { + } + template <typename T> inline one_t::operator const T () const @@ -66,7 +76,7 @@ namespace mln # ifndef MLN_WO_GLOBAL_VARS - const one_t& one = one_t(); + const one_t one; # endif // !MLN_WO_GLOBAL_VARS diff --git a/milena/mln/literal/origin.hh b/milena/mln/literal/origin.hh index 369ffff..8c99669 100644 --- a/milena/mln/literal/origin.hh +++ b/milena/mln/literal/origin.hh @@ -1,4 +1,5 @@ -// 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. // @@ -43,16 +44,24 @@ namespace mln /// Type of literal origin. struct origin_t : public Literal<origin_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + origin_t(); }; /// Literal origin. - extern const origin_t& origin; + extern const origin_t origin; # ifndef MLN_INCLUDE_ONLY + inline + origin_t::origin_t() + { + } + # ifndef MLN_WO_GLOBAL_VARS - const origin_t& origin = origin_t(); + const origin_t origin; # endif // !MLN_WO_GLOBAL_VARS diff --git a/milena/mln/literal/zero.hh b/milena/mln/literal/zero.hh index 4d3a13b..276cbb4 100644 --- a/milena/mln/literal/zero.hh +++ b/milena/mln/literal/zero.hh @@ -1,4 +1,5 @@ -// 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. // @@ -45,6 +46,10 @@ namespace mln /// Type of literal zero. struct zero_t : public Literal<zero_t> { + // This default constructor is needed for compilation with gcc + // 4.6.0, gcc 4.6.1 and Clang. + zero_t(); + // FIXME: (for the record) Add "friend class Literal<zero_t>;" and a protected ctor. template <typename T> @@ -52,10 +57,15 @@ namespace mln }; /// Literal zero. - extern const zero_t& zero; + extern const zero_t zero; # ifndef MLN_INCLUDE_ONLY + inline + zero_t::zero_t() + { + } + template <typename T> inline zero_t::operator const T () const @@ -66,9 +76,9 @@ namespace mln # ifndef MLN_WO_GLOBAL_VARS - const zero_t& zero = zero_t(); + const zero_t zero; -# endif // !MLN_GLOBAL_VARS +# endif // !MLN_WO_GLOBAL_VARS # endif // ! MLN_INCLUDE_ONLY -- 1.7.2.5