
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena Index: ChangeLog from Nicolas Ballas <ballas@lrde.epita.fr> Fix in mln_value_quant_from_ macro. * mln/trait/value_.hh: Fix a bug. * mln/core/image/flat_image.hh: Fix warning. * mln/level/fill_with_value.spe.hh: Update. * mln/level/paste.hh, * mln/level/fill_with_value.hh: Update documentations. core/image/flat_image.hh | 3 +++ level/fill_with_value.hh | 7 +++---- level/fill_with_value.spe.hh | 2 +- level/paste.hh | 1 + trait/value_.hh | 5 +++-- 5 files changed, 11 insertions(+), 7 deletions(-) Index: mln/trait/value_.hh --- mln/trait/value_.hh (revision 2830) +++ mln/trait/value_.hh (working copy) @@ -49,7 +49,7 @@ # define mln_trait_value_kind(V) typename mln::trait::value_< V >::kind # define mln_trait_value_kind_(V) mln::trait::value_< V >::kind # define mln_trait_value_quant(V) typename mln::trait::value_< V >::quant -# define mln_trait_value_quant_(V) mln::trait::value_< V >::quant +# define mln_trait_value_quant_(V) mln::trait::bvalue_< V >::quant # define mln_nbits(V) mln::trait::value_< V >::nbits @@ -67,8 +67,9 @@ +/// FIXME: check that the -1 is correct # define mln_value_quant_from_(C) \ - mlc_if(mln::metal::bool_<( C > 65536 || C == 0 )>, \ + mlc_if(mln::metal::bool_<( C > 65536 || C == 0 || C == -1)>, \ mln::trait::value::quant::high, \ mln::trait::value::quant::low) Index: mln/core/image/flat_image.hh --- mln/core/image/flat_image.hh (revision 2830) +++ mln/core/image/flat_image.hh (working copy) @@ -252,6 +252,9 @@ mln_precondition(this->has_data()); mln_precondition(old_val == this->data_->val_); this->data_->val_ = new_val; + + /// Avoid warning when NDEBUG is set + (void) old_val; } template <typename T, typename S> Index: mln/level/fill_with_value.spe.hh --- mln/level/fill_with_value.spe.hh (revision 2830) +++ mln/level/fill_with_value.spe.hh (working copy) @@ -77,8 +77,8 @@ { trace::entering("level::impl::fill_with_value_one_block"); - I& ima = exact(ima_); + internal::fill_with_value_tests(ima, val); mln_precondition(((mlc_is(mln_trait_image_pw_io(I), trait::image::pw_io::read_write)::value || Index: mln/level/paste.hh --- mln/level/paste.hh (revision 2830) +++ mln/level/paste.hh (working copy) @@ -88,6 +88,7 @@ mln_precondition(exact(input).has_data()); mln_precondition(exact(input).domain() <= exact(output).domain()); + // Avoid warning when compiling with NDEBUG (void)input; (void)output; } Index: mln/level/fill_with_value.hh --- mln/level/fill_with_value.hh (revision 2830) +++ mln/level/fill_with_value.hh (working copy) @@ -77,12 +77,11 @@ inline void fill_with_value_tests(Image<I>& ima, const V&) { - // Avoid a warning about an undefined variable when NDEBUG - // is not defined. - (void) ima; - mlc_converts_to(mln_exact(V), mln_value(I))::check(); mln_precondition(exact(ima).has_data()); + + // Avoid a warning about an undefined variable when NDEBUG + (void) ima; } } // end of namespace mln::level::internal