last-svn-commit-998-g392e46d Address clang's warnings.

* mln/algebra/h_vec.hh, * mln/core/image/dmorph/sub_image.hh, * mln/core/internal/pixel_impl.hh, * mln/core/site_set/box.hh, * mln/core/site_set/p_array.hh, * mln/metal/vec.hh, * mln/pw/internal/image_base.hh, * mln/topo/adj_higher_face_iter.hh, * mln/topo/adj_lower_face_iter.hh, * mln/topo/algebraic_face.hh, * mln/topo/face.hh, * mln/topo/face_data.hh: Use `class' and `struct' uniformly in declarations and definitions. * mln/convert/impl/from_double_to_value.hh, * mln/convert/impl/from_float_to_value.hh, * mln/convert/impl/from_int_to_value.hh, * mln/core/image/complex_window_piter.hh, * mln/core/point.hh, * mln/opt/element.hh, * mln/value/lut_vec.hh: Comment out unused arguments. * mln/topo/complex.hh [NDEBUG]: Avoid a warning about an unused variable. --- milena/ChangeLog | 29 +++++++++++++++++++++++ milena/mln/algebra/h_vec.hh | 8 ++++-- milena/mln/convert/impl/from_double_to_value.hh | 6 ++-- milena/mln/convert/impl/from_float_to_value.hh | 7 +++-- milena/mln/convert/impl/from_int_to_value.hh | 7 +++-- milena/mln/core/image/complex_window_piter.hh | 6 +++- milena/mln/core/image/dmorph/sub_image.hh | 6 +++- milena/mln/core/internal/pixel_impl.hh | 5 ++- milena/mln/core/point.hh | 2 +- milena/mln/core/site_set/box.hh | 13 +++++---- milena/mln/core/site_set/p_array.hh | 9 ++++--- milena/mln/metal/vec.hh | 5 ++- milena/mln/opt/element.hh | 6 ++-- milena/mln/pw/internal/image_base.hh | 6 ++-- milena/mln/topo/adj_higher_face_iter.hh | 5 ++- milena/mln/topo/adj_lower_face_iter.hh | 5 ++- milena/mln/topo/algebraic_face.hh | 5 ++- milena/mln/topo/complex.hh | 5 +++- milena/mln/topo/face.hh | 5 ++- milena/mln/topo/face_data.hh | 11 ++++---- milena/mln/value/lut_vec.hh | 5 ++- 21 files changed, 103 insertions(+), 53 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index a2d2e4e..843f891 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,32 @@ +2010-11-29 Roland Levillain <roland@lrde.epita.fr> + + Address clang's warnings. + + * mln/algebra/h_vec.hh, + * mln/core/image/dmorph/sub_image.hh, + * mln/core/internal/pixel_impl.hh, + * mln/core/site_set/box.hh, + * mln/core/site_set/p_array.hh, + * mln/metal/vec.hh, + * mln/pw/internal/image_base.hh, + * mln/topo/adj_higher_face_iter.hh, + * mln/topo/adj_lower_face_iter.hh, + * mln/topo/algebraic_face.hh, + * mln/topo/face.hh, + * mln/topo/face_data.hh: + Use `class' and `struct' uniformly in declarations and + definitions. + * mln/convert/impl/from_double_to_value.hh, + * mln/convert/impl/from_float_to_value.hh, + * mln/convert/impl/from_int_to_value.hh, + * mln/core/image/complex_window_piter.hh, + * mln/core/point.hh, + * mln/opt/element.hh, + * mln/value/lut_vec.hh: + Comment out unused arguments. + * mln/topo/complex.hh [NDEBUG]: Avoid a warning about an unused + variable. + 2009-10-06 Roland Levillain <roland@lrde.epita.fr> Update tests/core/image/graph_image. diff --git a/milena/mln/algebra/h_vec.hh b/milena/mln/algebra/h_vec.hh index 38e0e05..f772e55 100644 --- a/milena/mln/algebra/h_vec.hh +++ b/milena/mln/algebra/h_vec.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -39,7 +40,7 @@ namespace mln // Forward declaration. namespace algebra { - template <unsigned d, typename C> struct h_vec; + template <unsigned d, typename C> class h_vec; } @@ -90,8 +91,9 @@ namespace mln * */ template <unsigned d, typename C> - struct h_vec : public vec<d + 1, C> + class h_vec : public vec<d + 1, C> { + public: /// Dimension is the 'natural' one (3 for 3D), not the one of the vector (dim + 1). enum { dim = d }; diff --git a/milena/mln/convert/impl/from_double_to_value.hh b/milena/mln/convert/impl/from_double_to_value.hh index de766df..757fb55 100644 --- a/milena/mln/convert/impl/from_double_to_value.hh +++ b/milena/mln/convert/impl/from_double_to_value.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -86,8 +86,8 @@ namespace mln template <typename V> inline void - from_double_to_value(const double& from, - Value<V>& to) + from_double_to_value(const double& /* from */, + Value<V>& /* to */) { mlc_abort(V)::check(); } diff --git a/milena/mln/convert/impl/from_float_to_value.hh b/milena/mln/convert/impl/from_float_to_value.hh index f516419..b50173b 100644 --- a/milena/mln/convert/impl/from_float_to_value.hh +++ b/milena/mln/convert/impl/from_float_to_value.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -86,8 +87,8 @@ namespace mln template <typename V> inline void - from_float_to_value(const float& from, - Value<V>& to) + from_float_to_value(const float& /* from */, + Value<V>& /* to */) { mlc_abort(V)::check(); } diff --git a/milena/mln/convert/impl/from_int_to_value.hh b/milena/mln/convert/impl/from_int_to_value.hh index 30840b3..b17040b 100644 --- a/milena/mln/convert/impl/from_int_to_value.hh +++ b/milena/mln/convert/impl/from_int_to_value.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -73,8 +74,8 @@ namespace mln template <typename V> inline void - from_int_to_value(const int& from, - Value<V>& to) + from_int_to_value(const int& /* from */, + Value<V>& /* to */) { mlc_abort(V)::check(); } diff --git a/milena/mln/core/image/complex_window_piter.hh b/milena/mln/core/image/complex_window_piter.hh index 8a54adb..5f1daa5 100644 --- a/milena/mln/core/image/complex_window_piter.hh +++ b/milena/mln/core/image/complex_window_piter.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -363,8 +364,9 @@ namespace mln template <typename Pref> inline void - complex_window_bkd_piter<I, G, W>::center_at_(const Pref& c) + complex_window_bkd_piter<I, G, W>::center_at_(const Pref& /* c */) { + // FIXME: Argument C is not used here... Is this normal? iter_.center_at(this->center().face()); } diff --git a/milena/mln/core/image/dmorph/sub_image.hh b/milena/mln/core/image/dmorph/sub_image.hh index 9155b09..7aef40c 100644 --- a/milena/mln/core/image/dmorph/sub_image.hh +++ b/milena/mln/core/image/dmorph/sub_image.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -98,10 +99,11 @@ namespace mln /// \ingroup modimagedomainmorpher // template <typename I, typename S> - struct sub_image : public internal::image_domain_morpher< I, + class sub_image : public internal::image_domain_morpher< I, S, sub_image<I,S> > { + public: /// Skeleton. typedef sub_image< tag::image_<I>, tag::domain_<S> > skeleton; diff --git a/milena/mln/core/internal/pixel_impl.hh b/milena/mln/core/internal/pixel_impl.hh index 45ea553..4e30f4c 100644 --- a/milena/mln/core/internal/pixel_impl.hh +++ b/milena/mln/core/internal/pixel_impl.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -51,7 +52,7 @@ namespace mln // image whatever it is a fastest one or not. template <bool is_fastest, typename I, typename E> - class pixel_impl_base_; + struct pixel_impl_base_; template <typename I, typename E> diff --git a/milena/mln/core/point.hh b/milena/mln/core/point.hh index 7862e95..a912fac 100644 --- a/milena/mln/core/point.hh +++ b/milena/mln/core/point.hh @@ -677,7 +677,7 @@ namespace mln template <typename C> inline const util::yes& - cut_(const point<grid::tick,C>& p) + cut_(const point<grid::tick,C>& /* p */) { util::yes* the_; return *the_; diff --git a/milena/mln/core/site_set/box.hh b/milena/mln/core/site_set/box.hh index 12b049a..4256dc4 100644 --- a/milena/mln/core/site_set/box.hh +++ b/milena/mln/core/site_set/box.hh @@ -43,9 +43,9 @@ namespace mln { // Fwd decls. - template <typename P> struct box; - template <typename P> struct box_fwd_piter_; - template <typename P> struct box_bkd_piter_; + template <typename P> class box; + template <typename P> class box_fwd_piter_; + template <typename P> class box_bkd_piter_; namespace trait @@ -78,10 +78,11 @@ namespace mln /// \ingroup modsitesetbasic // template <typename P> - struct box : public Box< box<P> >, - public internal::box_impl_< P::dim, mln_coord(P), box<P> >, - private mlc_is_unqualif(P)::check_t + class box : public Box< box<P> >, + public internal::box_impl_< P::dim, mln_coord(P), box<P> >, + private mlc_is_unqualif(P)::check_t { + public: /// Dimension. enum { dim = P::dim }; diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh index 218a95a..6a7a236 100644 --- a/milena/mln/core/site_set/p_array.hh +++ b/milena/mln/core/site_set/p_array.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -51,9 +52,9 @@ namespace mln // Forward declarations. template <typename P> class p_array; - template <typename S> class p_indexed_psite; - template <typename S> struct p_indexed_fwd_piter; - template <typename S> struct p_indexed_bkd_piter; + template <typename S> class p_indexed_psite; + template <typename S> class p_indexed_fwd_piter; + template <typename S> class p_indexed_bkd_piter; diff --git a/milena/mln/metal/vec.hh b/milena/mln/metal/vec.hh index a2e51a4..a129d68 100644 --- a/milena/mln/metal/vec.hh +++ b/milena/mln/metal/vec.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2006, 2007, 2008, 2009, 2010 EPITA Research and +// Development Laboratory (LRDE) // // This file is part of Olena. // @@ -57,7 +58,7 @@ namespace mln namespace literal { struct zero_t; } - template <unsigned d, typename C> struct h_vec; + template <unsigned d, typename C> class h_vec; diff --git a/milena/mln/opt/element.hh b/milena/mln/opt/element.hh index cec8ebe..0aabf6b 100644 --- a/milena/mln/opt/element.hh +++ b/milena/mln/opt/element.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -60,7 +60,7 @@ namespace mln template <typename I> inline mln_rvalue(I) element_impl(trait::image::category::domain_morpher, - const Image<I>& ima, unsigned index) + const Image<I>& ima, unsigned /* index */) { return element(*exact(ima).delegatee_()); } @@ -82,7 +82,7 @@ namespace mln template <typename I> inline mln_lvalue(I) element_impl(trait::image::category::domain_morpher, - Image<I>& ima, unsigned index) + Image<I>& ima, unsigned /* index */) { return element(*exact(ima).delegatee_()); } diff --git a/milena/mln/pw/internal/image_base.hh b/milena/mln/pw/internal/image_base.hh index 46099e3..537f2eb 100644 --- a/milena/mln/pw/internal/image_base.hh +++ b/milena/mln/pw/internal/image_base.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ namespace mln { template <typename F, typename S, typename E> - struct image_base; + class image_base; } // end of namespace mln::pw::internal @@ -111,7 +111,7 @@ namespace mln /// Parameter \p F is the image value type. /// Parameter \p S is the image site set type. template <typename F, typename S, typename E> - struct image_base + class image_base : public mln::internal::image_primary<mln_result(F), S, E > { typedef typename F::mutable_result mutable_result; diff --git a/milena/mln/topo/adj_higher_face_iter.hh b/milena/mln/topo/adj_higher_face_iter.hh index 21f6d34..2b4ef65 100644 --- a/milena/mln/topo/adj_higher_face_iter.hh +++ b/milena/mln/topo/adj_higher_face_iter.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -56,7 +57,7 @@ namespace mln } // end of mln::topo::internal template <unsigned D> - struct algebraic_face; + class algebraic_face; /*------------------------------------. | topo::adj_higher_face_fwd_iter<D>. | diff --git a/milena/mln/topo/adj_lower_face_iter.hh b/milena/mln/topo/adj_lower_face_iter.hh index e7010db..a903460 100644 --- a/milena/mln/topo/adj_lower_face_iter.hh +++ b/milena/mln/topo/adj_lower_face_iter.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -56,7 +57,7 @@ namespace mln } // end of namespace mln::topo::internal template <unsigned D> - struct algebraic_face; + class algebraic_face; /*-----------------------------------. diff --git a/milena/mln/topo/algebraic_face.hh b/milena/mln/topo/algebraic_face.hh index 5cf9da5..bcedcba 100644 --- a/milena/mln/topo/algebraic_face.hh +++ b/milena/mln/topo/algebraic_face.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -56,7 +57,7 @@ namespace mln /// Contrary to an mln::topo::algebraic_n_face, the dimension of an /// mln::topo::algebraic_face is not fixed. template <unsigned D> - struct algebraic_face : public face<D> + class algebraic_face : public face<D> { typedef face<D> super_; diff --git a/milena/mln/topo/complex.hh b/milena/mln/topo/complex.hh index 3662396..9cfd266 100644 --- a/milena/mln/topo/complex.hh +++ b/milena/mln/topo/complex.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -961,6 +962,8 @@ namespace mln { // If we reached this method, then N should be 0. mln_precondition(n == 0); + // Prevent ``unused variable'' warnings when NDEBUG is defined. + (void) n; return f(faces_); } diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh index 98b81c7..da95019 100644 --- a/milena/mln/topo/face.hh +++ b/milena/mln/topo/face.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -60,7 +61,7 @@ namespace mln /// Contrary to an mln::topo::n_face, the dimension of an /// mln::topo::face is not fixed. template <unsigned D> - struct face + class face { public: // The type of the complex this handle points to. diff --git a/milena/mln/topo/face_data.hh b/milena/mln/topo/face_data.hh index 6a7bd8e..de8028b 100644 --- a/milena/mln/topo/face_data.hh +++ b/milena/mln/topo/face_data.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -115,8 +116,8 @@ namespace mln void connect_lower_dim_face(const algebraic_n_face<N - 1, D>& f); private: - friend class mln::topo::internal::lower_dim_faces_set_mixin<N, D>; - friend class mln::topo::internal::lower_dim_adj_faces_if_dim_matches_<N, D>; + friend struct mln::topo::internal::lower_dim_faces_set_mixin<N, D>; + friend struct mln::topo::internal::lower_dim_adj_faces_if_dim_matches_<N, D>; friend lower_dim_faces_type mln::topo::n_face<N, D>::lower_dim_adj_faces() const; @@ -133,8 +134,8 @@ namespace mln void connect_higher_dim_face(const algebraic_n_face<N + 1, D>& f); private: - friend class mln::topo::internal::higher_dim_faces_set_mixin<N, D>; - friend class mln::topo::internal::higher_dim_adj_faces_if_dim_matches_<N, D>; + friend struct mln::topo::internal::higher_dim_faces_set_mixin<N, D>; + friend struct mln::topo::internal::higher_dim_adj_faces_if_dim_matches_<N, D>; friend higher_dim_faces_type mln::topo::n_face<N, D>::higher_dim_adj_faces() const; diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh index 7886dc1..b86e541 100644 --- a/milena/mln/value/lut_vec.hh +++ b/milena/mln/value/lut_vec.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2009, 2010 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -135,7 +136,7 @@ namespace mln template <typename S, typename T> inline unsigned - lut_vec<S,T>::index_of(const T& v) const + lut_vec<S,T>::index_of(const T& /* v */) const { mln_invariant(0); // FIXME return 0; -- 1.7.2.5
participants (1)
-
Roland Levillain