URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-09-07 Matthieu Garrigues <garrigues.matthieu@lrde.epita.fr> make the tests compile * mln/convert/to_image.hh: replace box2d by box_<P> to handle 1d * mln/debug/println.hh: stupid error * tests/convert_to_vec_p.cc: stupid error * tests/w_window1d_int.cc: rectangle1d ??? replaced by segment1d --- mln/convert/to_image.hh | 7 +++++-- mln/debug/println.hh | 4 ++-- tests/convert_to_vec_p.cc | 4 ++-- tests/w_window1d_int.cc | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) Index: trunk/milena/tests/w_window1d_int.cc =================================================================== --- trunk/milena/tests/w_window1d_int.cc (revision 1090) +++ trunk/milena/tests/w_window1d_int.cc (revision 1091) @@ -31,6 +31,7 @@ */ #include <mln/core/w_window1d_int.hh> +#include <mln/core/win/segment1d.hh> #include <mln/convert/to_image.hh> #include <mln/convert/to_w_window.hh> @@ -61,7 +62,7 @@ } { - w_window1d_int w_win = make::w_window(win::rectangle1d(3, 5), + w_window1d_int w_win = make::w_window(win::segment1d(3), convert::to_fun(f)); // -3 -2 -1 0 +1 // -2 -1 0 +1 +2 Index: trunk/milena/tests/convert_to_vec_p.cc =================================================================== --- trunk/milena/tests/convert_to_vec_p.cc (revision 1090) +++ trunk/milena/tests/convert_to_vec_p.cc (revision 1091) @@ -48,7 +48,7 @@ win::segment1d win1d(5); vec1d v1(convert::to_vec_p(win1d, p1)); - for (int i=0; i < v1.npoints(); i++) + for (size_t i=0; i < v1.npoints(); i++) std::cout << (v1[i]); std::cout << "\n"; @@ -58,7 +58,7 @@ win::rectangle2d win2d(3, 3); vec2d v2(convert::to_vec_p(win2d, p2)); - for (int i=0; i < v2.npoints(); i++) + for (size_t i=0; i < v2.npoints(); i++) std::cout << (v2[i]); } Index: trunk/milena/mln/convert/to_image.hh =================================================================== --- trunk/milena/mln/convert/to_image.hh (revision 1090) +++ trunk/milena/mln/convert/to_image.hh (revision 1091) @@ -44,6 +44,7 @@ # include <mln/convert/to_window.hh> # include <mln/geom/bbox.hh> # include <mln/level/fill.hh> +# include <mln/histo/data.hh> # define mln_image_from(Src, Value) typename mln::image_from_< Src, Value >::ret @@ -113,7 +114,9 @@ /// Convert an histo \p h into an image1d_b. template <typename S> - image1d_b<std::size_t> to_image(const histo::data<S>& h); + image1d_b<std::size_t> + to_image(const + mln::histo::data<S>& h); # ifndef MLN_INCLUDE_ONLY @@ -158,7 +161,7 @@ mln_precondition(! w_win.is_empty()); typedef mln_point(W) P; - box2d b = geom::bbox(w_win); + box_<P> b = geom::bbox(w_win); mln_image_from(W, mln_weight(W)) ima(b); mln_qiter(W) q(w_win, P::zero); for_all(q) Index: trunk/milena/mln/debug/println.hh =================================================================== --- trunk/milena/mln/debug/println.hh (revision 1090) +++ trunk/milena/mln/debug/println.hh (revision 1091) @@ -102,8 +102,8 @@ void println_with_border(const box2d& b, const Fast_Image<I>& input_) { const I& input = exact(input_); - const int ncols = b.ncols() + 2 * input.border(); - for (int i = 0; i < input.ncells(); i++) + const std::size_t ncols = b.ncols() + 2 * input.border(); + for (size_t i = 0; i < input.ncells(); i++) { std::cout << input.buffer()[i] << ' '; if (((i+1) % ncols) == 0)