From d5a3cf938907eb9ab61044810d984c73452eb200 Mon Sep 17 00:00:00 2001 From: Pedro Giffuni Date: Wed, 19 Sep 2012 22:31:29 +0000 Subject: Updates to upstream Vigra Vigra 1.6.0 (Newer versions use Cmake) * Adds a lot of functionality and includes improvements for 64 bit compilers. * Add explicit cast (gcc 4.7 compatibility patch by Stephan Bergmann) https://github.com/ukoethe/vigra/commit/e0dcd31c76bb13c98920e21544b309ca47bb3c5c More information on the Vigra changes here: http://hci.iwr.uni-heidelberg.de/vigra/doc/vigra/CreditsChangelog.html (cherry picked from commit 0f94142a20861c18f60b5be6fc4163c7e8a69240) Conflicts: external_deps.lst mdds/makefile.mk mdds/prj/d.lst vigra/makefile.mk vigra/prj/d.lst Change-Id: I05de88982b9dab7c851fab16811ca696207cd091 Vigra: add missing mathutil.hxx patch (cherry picked from commit ba446263713f7ce1dcc47f78b97840280018af89) Change-Id: I506f0c1c96cfaf278b4e72de34b24633a1e99431 fix vigra patch for BasicImage::resizeCopy() "data_" is an actual data pointer but "data" is a member function (since vigra-1.4). The method resizeCopy() seems to confuse data and data_ which the clang compiler was happy to point out. The OOo patch to vigra-1.4 already solved that problem but it was lost in the upgrade to vigra-1.6 (cherry picked from commit a71a282ae781b90c31e25eb631537f10fe842492) Change-Id: Ifb031950c60efdda2d30e442990af95f557dd914 Build fix (cherry picked from commit 6e6c057792a410dd36893674c59d452586733348) Change-Id: Ide599665c78d377baf0b8f935274b41535749610 --- vigra/UnpackedTarball_vigra.mk | 5 +- vigra/vigra1.4.0-enumwarn.patch | 13 - vigra/vigra1.4.0-unused-parameters.patch | 31 - vigra/vigra1.4.0.patch | 1713 ------------------------------ vigra/vigra1.6.0-unused-parameters.patch | 31 + vigra/vigra1.6.0.patch | 1453 +++++++++++++++++++++++++ 6 files changed, 1486 insertions(+), 1760 deletions(-) delete mode 100644 vigra/vigra1.4.0-enumwarn.patch delete mode 100644 vigra/vigra1.4.0-unused-parameters.patch delete mode 100644 vigra/vigra1.4.0.patch create mode 100644 vigra/vigra1.6.0-unused-parameters.patch create mode 100644 vigra/vigra1.6.0.patch (limited to 'vigra') diff --git a/vigra/UnpackedTarball_vigra.mk b/vigra/UnpackedTarball_vigra.mk index 72e6209253af..efab47817790 100644 --- a/vigra/UnpackedTarball_vigra.mk +++ b/vigra/UnpackedTarball_vigra.mk @@ -12,10 +12,9 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,vigra)) $(eval $(call gb_UnpackedTarball_set_tarball,vigra,$(VIGRA_TARBALL))) $(eval $(call gb_UnpackedTarball_add_patches,vigra,\ - vigra/vigra1.4.0.patch \ + vigra/vigra1.6.0.patch \ $(if $(filter GCC,$(COM)), \ - vigra/vigra1.4.0-unused-parameters.patch) \ - vigra/vigra1.4.0-enumwarn.patch \ + vigra/vigra1.6.0-unused-parameters.patch) \ )) # vim: set noet sw=4 ts=4: diff --git a/vigra/vigra1.4.0-enumwarn.patch b/vigra/vigra1.4.0-enumwarn.patch deleted file mode 100644 index 8ea1ed7890da..000000000000 --- a/vigra/vigra1.4.0-enumwarn.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- misc/vigra1.4.0/include/vigra/sized_int.hxx 2012-03-28 13:36:02.743956393 +0200 -+++ misc/build/vigra1.4.0/include/vigra/sized_int.hxx 2012-03-28 13:35:44.956057143 +0200 -@@ -80,8 +80,8 @@ - template - struct SelectBiggestIntegerType - { -- enum { cursize = LIST::size, -- nextsize = SelectBiggestIntegerType::size, -+ enum { cursize = static_cast< int >(LIST::size), -+ nextsize = static_cast< int >(SelectBiggestIntegerType::size), - size = (cursize < nextsize) ? nextsize : cursize }; - typedef typename - IfBool<(cursize < nextsize), diff --git a/vigra/vigra1.4.0-unused-parameters.patch b/vigra/vigra1.4.0-unused-parameters.patch deleted file mode 100644 index f32317865ea8..000000000000 --- a/vigra/vigra1.4.0-unused-parameters.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- misc/vigra1.4.0/include/vigra/basicimage.hxx 2012-01-19 22:49:11.232074631 +0100 -+++ misc/build/vigra1.4.0/include/vigra/basicimage.hxx 2012-01-19 22:48:12.997439136 +0100 -@@ -72,7 +72,7 @@ - difference_type offset_; - }; - -- static void initialize(BaseType &) {} -+ static void initialize(__attribute__ ((unused)) BaseType &) {} - - static reference dereference(BaseType const & d) - { return const_cast(*(*d.line_start_ + d.offset_)); } ---- misc/vigra1.4.0/include/vigra/diff2d.hxx 2012-01-19 22:49:11.280074335 +0100 -+++ misc/build/vigra1.4.0/include/vigra/diff2d.hxx 2012-01-19 22:49:00.129144170 +0100 -@@ -60,7 +60,7 @@ - typedef Diff const * pointer; - typedef std::random_access_iterator_tag iterator_category; - -- static void initialize(BaseType &) {} -+ static void initialize(__attribute__ ((unused)) BaseType &) {} - - static reference dereference(BaseType const & d) - { return d; } -@@ -102,7 +102,7 @@ - typedef Diff const * pointer; - typedef std::random_access_iterator_tag iterator_category; - -- static void initialize(BaseType & /*d*/) {} -+ static void initialize(__attribute__ ((unused)) BaseType & /*d*/) {} - - static reference dereference(BaseType const & d) - { return d; } diff --git a/vigra/vigra1.4.0.patch b/vigra/vigra1.4.0.patch deleted file mode 100644 index 431b021099a7..000000000000 --- a/vigra/vigra1.4.0.patch +++ /dev/null @@ -1,1713 +0,0 @@ -diff -uprN misc/vigra1.4.0/configure misc/build/vigra1.4.0/configure ---- misc/vigra1.4.0/configure Tue Dec 20 23:53:28 2005 -+++ misc/build/vigra1.4.0/configure Wed Apr 4 20:35:48 2007 -@@ -7259,7 +7259,7 @@ kfreebsd*-gnu) - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -10961,7 +10961,7 @@ kfreebsd*-gnu) - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -14110,7 +14110,7 @@ kfreebsd*-gnu) - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -16461,7 +16461,7 @@ kfreebsd*-gnu) - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -diff -uprN misc/vigra1.4.0/include/vigra/array_vector.hxx misc/build/vigra1.4.0/include/vigra/array_vector.hxx ---- misc/vigra1.4.0/include/vigra/array_vector.hxx 2005-12-21 05:53:30.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/array_vector.hxx 2006-08-31 12:08:15.172679000 +0200 -@@ -196,7 +196,38 @@ public: - iterator insert(iterator p, size_type n, value_type const & v); - - template -- iterator insert(iterator p, InputIterator i, InputIterator iend); -+ iterator insert(iterator p, InputIterator i, InputIterator iend) -+ { -+ difference_type n = iend - i; -+ difference_type pos = p - begin(); -+ size_type new_size = size() + n; -+ if(new_size >= capacity_) -+ { -+ pointer new_data = reserve_raw(new_size); -+ std::uninitialized_copy(begin(), p, new_data); -+ std::uninitialized_copy(i, iend, new_data + pos); -+ std::uninitialized_copy(p, end(), new_data + pos + n); -+ deallocate(data_, size_); -+ capacity_ = new_size; -+ data_ = new_data; -+ } -+ else if(pos + n >= size_) -+ { -+ size_type diff = pos + n - size_; -+ std::uninitialized_copy(p, end(), end() + diff); -+ std::uninitialized_copy(iend - diff, iend, end()); -+ std::copy(i, iend - diff, p); -+ } -+ else -+ { -+ size_type diff = size_ - (pos + n); -+ std::uninitialized_copy(end() - n, end(), end()); -+ std::copy_backward(p, p + diff, end()); -+ std::copy(i, iend, p); -+ } -+ size_ = new_size; -+ return begin() + pos; -+ } - - iterator erase(iterator p); - -@@ -260,23 +291,23 @@ ArrayVector::ArrayVector(Alloc - {} - - template --ArrayVector::ArrayVector( size_type size, Alloc const & alloc) -+ArrayVector::ArrayVector( size_type sz, Alloc const & alloc) - : alloc_(alloc), -- size_(size), -- capacity_(size), -- data_(reserve_raw(size)) -+ size_(sz), -+ capacity_(sz), -+ data_(reserve_raw(sz)) - { - if(size_ > 0) - std::uninitialized_fill(data_, data_+size_, value_type()); - } - - template --ArrayVector::ArrayVector( size_type size, -+ArrayVector::ArrayVector( size_type sz, - value_type const & initial, Alloc const & alloc) - : alloc_(alloc), -- size_(size), -- capacity_(size), -- data_(reserve_raw(size)) -+ size_(sz), -+ capacity_(sz), -+ data_(reserve_raw(sz)) - { - if(size_ > 0) - std::uninitialized_fill(data_, data_+size_, initial); -@@ -295,24 +326,24 @@ ArrayVector::ArrayVector( this - - template - template --ArrayVector::ArrayVector(InputIterator i, InputIterator end) -+ArrayVector::ArrayVector(InputIterator i, InputIterator iend) - : alloc_(), -- size_(std::distance(i, end)), -+ size_(std::distance(i, iend)), - capacity_(size_), - data_(reserve_raw(size_)) - { -- std::uninitialized_copy(i, end, data_); -+ std::uninitialized_copy(i, iend, data_); - } - - template - template --ArrayVector::ArrayVector(InputIterator i, InputIterator end, Alloc const & alloc) -+ArrayVector::ArrayVector(InputIterator i, InputIterator iend, Alloc const & alloc) - : alloc_(alloc), -- size_(std::distance(i, end)), -+ size_(std::distance(i, iend)), - capacity_(size_), - data_(reserve_raw(size_)) - { -- std::uninitialized_copy(i, end, data_); -+ std::uninitialized_copy(i, iend, data_); - } - - -@@ -409,42 +440,6 @@ ArrayVector::insert(iterator p - } - - template --template --typename ArrayVector::iterator --ArrayVector::insert(iterator p, InputIterator i, InputIterator iend) --{ -- difference_type n = iend - i; -- difference_type pos = p - begin(); -- size_type new_size = size() + n; -- if(new_size >= capacity_) -- { -- pointer new_data = reserve_raw(new_size); -- std::uninitialized_copy(begin(), p, new_data); -- std::uninitialized_copy(i, iend, new_data + pos); -- std::uninitialized_copy(p, end(), new_data + pos + n); -- deallocate(data_, size_); -- capacity_ = new_size; -- data_ = new_data; -- } -- else if(pos + n >= size_) -- { -- size_type diff = pos + n - size_; -- std::uninitialized_copy(p, end(), end() + diff); -- std::uninitialized_copy(iend - diff, iend, end()); -- std::copy(i, iend - diff, p); -- } -- else -- { -- size_type diff = size_ - (pos + n); -- std::uninitialized_copy(end() - n, end(), end()); -- std::copy_backward(p, p + diff, end()); -- std::copy(i, iend, p); -- } -- size_ = new_size; -- return begin() + pos; --} -- --template - typename ArrayVector::iterator - ArrayVector::erase(iterator p) - { -@@ -504,25 +499,25 @@ void ArrayVector::swap(this_ty - } - - template --void ArrayVector::deallocate(pointer data, size_type size) -+void ArrayVector::deallocate(pointer target_data, size_type sz) - { - if(data) - { -- detail::destroy_n(data, size); -- alloc_.deallocate(data, size); -+ detail::destroy_n(target_data, sz); -+ alloc_.deallocate(target_data, sz); - } - } - - template - typename ArrayVector::pointer --ArrayVector::reserve_raw(size_type capacity) -+ArrayVector::reserve_raw(size_type cap) - { -- pointer data = 0; -- if(capacity) -+ pointer new_data = 0; -+ if(cap) - { -- data = alloc_.allocate(capacity); -+ new_data = alloc_.allocate(cap); - } -- return data; -+ return new_data; - } - - } // namespace vigra -diff -uprN misc/vigra1.4.0/include/vigra/basicimage.hxx misc/build/vigra1.4.0/include/vigra/basicimage.hxx ---- misc/vigra1.4.0/include/vigra/basicimage.hxx 2005-12-21 05:53:30.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/basicimage.hxx 2006-08-31 12:08:15.194050000 +0200 -@@ -552,7 +552,11 @@ class BasicImage - typedef Alloc allocator_type; - - typedef Alloc Allocator; -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - typedef typename Alloc::template rebind::other LineAllocator; -+#else -+ typedef std::allocator LineAllocator; -+#endif - - /** construct image of size 0x0 - */ -@@ -569,39 +573,51 @@ class BasicImage - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -+#else -+ pallocator_() -+#endif - {} - - /** construct image of size width x height, use the specified allocator. - */ -- BasicImage(int width, int height, Alloc const & alloc = Alloc()) -+ BasicImage(int w, int h, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -+#else -+ pallocator_() -+#endif - { -- vigra_precondition((width >= 0) && (height >= 0), -- "BasicImage::BasicImage(int width, int height): " -+ vigra_precondition((w >= 0) && (h >= 0), -+ "BasicImage::BasicImage(int w, int h): " - "width and height must be >= 0.\n"); - -- resize(width, height, value_type()); -+ resize(w, h, value_type()); - } - - /** construct image of size size.x x size.y, use the specified allocator. - */ -- explicit BasicImage(difference_type const & size, Alloc const & alloc = Alloc()) -+ explicit BasicImage(difference_type const & sz, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -- { -- vigra_precondition((size.x >= 0) && (size.y >= 0), -- "BasicImage::BasicImage(Diff2D size): " -- "size.x and size.y must be >= 0.\n"); -+#else -+ pallocator_() -+#endif -+ { -+ vigra_precondition((sz.x >= 0) && (sz.y >= 0), -+ "BasicImage::BasicImage(Diff2D sz): " -+ "sz.x and sz.y must be >= 0.\n"); - -- resize(size.x, size.y, value_type()); -+ resize(sz.x, sz.y, value_type()); - } - - /** construct image of size width*height and initialize every -@@ -609,71 +625,87 @@ class BasicImage - value_type doesn't have a default constructor). - Use the specified allocator. - */ -- BasicImage(int width, int height, value_type const & d, Alloc const & alloc = Alloc()) -+ BasicImage(int w, int h, value_type const & d, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -+#else -+ pallocator_() -+#endif - { -- vigra_precondition((width >= 0) && (height >= 0), -- "BasicImage::BasicImage(int width, int height, value_type const & ): " -+ vigra_precondition((w >= 0) && (h >= 0), -+ "BasicImage::BasicImage(int w, int h, value_type const & ): " - "width and height must be >= 0.\n"); - -- resize(width, height, d); -+ resize(w, h, d); - } - - /** construct image of size size.x x size.y and initialize - every pixel with given data (use this constructor, if - value_type doesn't have a default constructor). Use the specified allocator. - */ -- explicit BasicImage(difference_type const & size, value_type const & d, Alloc const & alloc = Alloc()) -+ explicit BasicImage(difference_type const & sz, value_type const & d, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -- { -- vigra_precondition((size.x >= 0) && (size.y >= 0), -- "BasicImage::BasicImage(Diff2D const & size, value_type const & v): " -- "size.x and size.y must be >= 0.\n"); -+#else -+ pallocator_() -+#endif -+ { -+ vigra_precondition((sz.x >= 0) && (sz.y >= 0), -+ "BasicImage::BasicImage(Diff2D const & sz, value_type const & v): " -+ "sz.x and sz.y must be >= 0.\n"); - -- resize(size.x, size.y, d); -+ resize(sz.x, sz.y, d); - } - - - /** construct image of size width*height and copy the data from the - given C-style array \a d. Use the specified allocator. - */ -- BasicImage(int width, int height, const_pointer d, Alloc const & alloc = Alloc()) -+ BasicImage(int w, int h, const_pointer d, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -+#else -+ pallocator_() -+#endif - { -- vigra_precondition((width >= 0) && (height >= 0), -- "BasicImage::BasicImage(int width, int height, const_pointer ): " -+ vigra_precondition((w >= 0) && (h >= 0), -+ "BasicImage::BasicImage(int w, int h, const_pointer ): " - "width and height must be >= 0.\n"); - -- resizeCopy(width, height, d); -+ resizeCopy(w, h, d); - } - - /** construct image of size size.x x size.y and copy the data from the - given C-style array. Use the specified allocator. - */ -- explicit BasicImage(difference_type const & size, const_pointer d, Alloc const & alloc = Alloc()) -+ explicit BasicImage(difference_type const & sz, const_pointer d, Alloc const & alloc = Alloc()) - : data_(0), - width_(0), - height_(0), - allocator_(alloc), -+#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS - pallocator_(alloc) -- { -- vigra_precondition((size.x >= 0) && (size.y >= 0), -- "BasicImage::BasicImage(Diff2D const & size, const_pointer): " -- "size.x and size.y must be >= 0.\n"); -+#else -+ pallocator_() -+#endif -+ { -+ vigra_precondition((sz.x >= 0) && (sz.y >= 0), -+ "BasicImage::BasicImage(Diff2D const & sz, const_pointer): " -+ "sz.x and sz.y must be >= 0.\n"); - -- resizeCopy(size.x, size.y, d); -+ resizeCopy(sz.x, sz.y, d); - } - - /** copy rhs image -@@ -710,20 +742,20 @@ class BasicImage - /** reset image to specified size (dimensions must not be negative) - (old data are kept if new size matches old size) - */ -- void resize(int width, int height) -+ void resize(int w, int h) - { -- if(width != width_ || height != height_) -- resize(width, height, value_type()); -+ if(w != width_ || h != height_) -+ resize(w, h, value_type()); - } - - /** reset image to specified size (dimensions must not be negative) - (old data are kept if new size matches old size) - */ -- void resize(difference_type const & size) -+ void resize(difference_type const & sz) - { -- if(size.x != width_ || size.y != height_) -+ if(sz.x != width_ || sz.y != height_) - { -- resize(size.x, size.y, value_type()); -+ resize(sz.x, sz.y, value_type()); - } - } - -@@ -732,12 +764,12 @@ class BasicImage - constructor, dimensions must not be negative, - old data are kept if new size matches old size) - */ -- void resize(int width, int height, value_type const & d); -+ void resize(int w, int h, value_type const & d); - - /** resize image to given size and initialize by copying data - from the C-style arra \a data. - */ -- void resizeCopy(int width, int height, const_pointer data); -+ void resizeCopy(int w, int h, const_pointer data); - - /** resize image to size of other image and copy it's data - */ -@@ -1046,30 +1078,30 @@ BasicImage::init(value - - template - void --BasicImage::resize(int width, int height, value_type const & d) -+BasicImage::resize(int w, int h, value_type const & d) - { -- vigra_precondition((width >= 0) && (height >= 0), -- "BasicImage::resize(int width, int height, value_type const &): " -+ vigra_precondition((w >= 0) && (h >= 0), -+ "BasicImage::resize(int w, int h, value_type const &): " - "width and height must be >= 0.\n"); - -- if (width_ != width || height_ != height) // change size? -+ if (width_ != w || height_ != h) // change size? - { - value_type * newdata = 0; - value_type ** newlines = 0; -- if(width*height > 0) -+ if(w*h > 0) - { -- if (width*height != width_*height_) // different sizes, must reallocate -+ if (w*h != width_*height_) // different sizes, must reallocate - { -- newdata = allocator_.allocate(width*height); -- std::uninitialized_fill_n(newdata, width*height, d); -- newlines = initLineStartArray(newdata, width, height); -+ newdata = allocator_.allocate(w*h); -+ std::uninitialized_fill_n(newdata, w*h, d); -+ newlines = initLineStartArray(newdata, w, h); - deallocate(); - } - else // need only to reshape - { - newdata = data_; -- std::fill_n(newdata, width*height, d); -- newlines = initLineStartArray(newdata, width, height); -+ std::fill_n(newdata, w*h, d); -+ newlines = initLineStartArray(newdata, w, h); - pallocator_.deallocate(lines_, height_); - } - } -@@ -1080,22 +1112,22 @@ BasicImage::resize(int - - data_ = newdata; - lines_ = newlines; -- width_ = width; -- height_ = height; -+ width_ = w; -+ height_ = h; - } -- else if(width*height > 0) // keep size, re-init data -+ else if(w*h > 0) // keep size, re-init data - { -- std::fill_n(data_, width*height, d); -+ std::fill_n(data_, w*h, d); - } - } - - - template - void --BasicImage::resizeCopy(int width, int height, const_pointer data) -+BasicImage::resizeCopy(int w, int h, const_pointer src_data) - { -- int newsize = width*height; -- if (width_ != width || height_ != height) // change size? -+ int newsize = w*h; -+ if (width_ != w || height_ != h) // change size? - { - value_type * newdata = 0; - value_type ** newlines = 0; -@@ -1104,15 +1136,15 @@ BasicImage::resizeCopy - if (newsize != width_*height_) // different sizes, must reallocate - { - newdata = allocator_.allocate(newsize); -- std::uninitialized_copy(data, data + newsize, newdata); -- newlines = initLineStartArray(newdata, width, height); -+ std::uninitialized_copy(src_data, src_data + newsize, newdata); -+ newlines = initLineStartArray(newdata, w, h); - deallocate(); - } - else // need only to reshape - { - newdata = data_; -- std::copy(data, data + newsize, newdata); -- newlines = initLineStartArray(newdata, width, height); -+ std::copy(src_data, src_data + newsize, newdata); -+ newlines = initLineStartArray(newdata, w, h); - pallocator_.deallocate(lines_, height_); - } - } -@@ -1123,12 +1155,12 @@ BasicImage::resizeCopy - - data_ = newdata; - lines_ = newlines; -- width_ = width; -- height_ = height; -+ width_ = w; -+ height_ = h; - } - else if(newsize > 0) // keep size, copy data - { -- std::copy(data, data + newsize, data_); -+ std::copy(src_data, src_data + newsize, data_); - } - } - -@@ -1163,11 +1195,11 @@ BasicImage::deallocate - - template - PIXELTYPE ** --BasicImage::initLineStartArray(value_type * data, int width, int height) -+BasicImage::initLineStartArray(value_type * src_data, int w, int h) - { -- value_type ** lines = pallocator_.allocate(height); -- for(int y=0; y(data)), -+ BasicImageView(const_pointer src_data, int w, int h, int data_stride = 0) -+ : data_(const_cast(src_data)), - width_(w), - height_(h), -- stride_(stride == 0 ? w : stride) -+ stride_(data_stride == 0 ? w : data_stride) - {} - - /** construct view of size size.x x size.y - */ -- BasicImageView(const_pointer data, difference_type const & size, int stride = 0) -- : data_(const_cast(data)), -- width_(size.x), -- height_(size.y), -- stride_(stride == 0 ? size.x : stride) -+ BasicImageView(const_pointer src_data, difference_type const & sz, int data_stride = 0) -+ : data_(const_cast(src_data)), -+ width_(sz.x), -+ height_(sz.y), -+ stride_(data_stride == 0 ? sz.x : data_stride) - {} - - /** set Image with const value -diff -uprN misc/vigra1.4.0/include/vigra/boundarytensor.hxx misc/build/vigra1.4.0/include/vigra/boundarytensor.hxx ---- misc/vigra1.4.0/include/vigra/boundarytensor.hxx 2005-12-21 05:53:31.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/boundarytensor.hxx 2006-08-31 12:08:15.240695000 +0200 -@@ -71,8 +71,8 @@ initGaussianPolarFilters1(double std_dev - int radius = (int)(4.0*std_dev + 0.5); - std_dev *= 1.08179074376; - double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm -- double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5); -- double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3); -+ double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5.0); -+ double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3.0); - double sigma22 = -0.5 / std_dev / std_dev; - - -@@ -175,7 +175,7 @@ initGaussianPolarFilters3(double std_dev - std_dev *= 1.15470053838; - double sigma22 = -0.5 / std_dev / std_dev; - double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm -- double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5); -+ double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5.0); - - for(unsigned int i=0; i -+template - struct FPAssignWithRound; - --template <> --struct FPAssignWithRound -+template -+struct FPAssignWithRound - { -- template - static inline int exec(int v) { return v << (-N); } - }; - --template <> --struct FPAssignWithRound -+template -+struct FPAssignWithRound - { -- template - static inline int exec(int const v) - { - return (v + (1 << (N - 1))) >> (N); -@@ -276,7 +274,7 @@ public: - */ - template - FixedPoint(const FixedPoint &other) -- : value(detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value)) -+ : value(detail::FPAssignWithRound<(Frac2 > FractionalBits), Frac2 - FractionalBits>::exec(other.value)) - { - VIGRA_STATIC_ASSERT((FixedPoint_overflow_error__More_than_31_bits_requested<(IntBits + FractionalBits)>)); - VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); -@@ -321,7 +319,7 @@ public: - FixedPoint & operator=(const FixedPoint &other) - { - VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); -- value = detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); -+ value = detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); - return *this; - } - -@@ -373,7 +371,7 @@ public: - FixedPoint & operator+=(const FixedPoint &other) - { - VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); -- value += detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); -+ value += detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); - return *this; - } - -@@ -384,7 +382,7 @@ public: - FixedPoint & operator-=(const FixedPoint &other) - { - VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); -- value -= detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); -+ value -= detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); - return *this; - } - -@@ -428,12 +426,12 @@ struct FixedPointCast \ - } \ - }; - --VIGRA_FIXED_POINT_CAST(Int8); --VIGRA_FIXED_POINT_CAST(UInt8); --VIGRA_FIXED_POINT_CAST(Int16); --VIGRA_FIXED_POINT_CAST(UInt16); --VIGRA_FIXED_POINT_CAST(Int32); --VIGRA_FIXED_POINT_CAST(UInt32); -+VIGRA_FIXED_POINT_CAST(Int8) -+VIGRA_FIXED_POINT_CAST(UInt8) -+VIGRA_FIXED_POINT_CAST(Int16) -+VIGRA_FIXED_POINT_CAST(UInt16) -+VIGRA_FIXED_POINT_CAST(Int32) -+VIGRA_FIXED_POINT_CAST(UInt32) - - #undef VIGRA_FIXED_POINT_CAST - -diff -uprN misc/vigra1.4.0/include/vigra/gaborfilter.hxx misc/build/vigra1.4.0/include/vigra/gaborfilter.hxx ---- misc/vigra1.4.0/include/vigra/gaborfilter.hxx 2005-12-21 05:53:35.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/gaborfilter.hxx 2006-08-31 12:08:15.389636000 +0200 -@@ -289,7 +289,11 @@ inline double angularGaborSigma(int dire - Namespace: vigra - */ - template ::other > -+#else -+ class Alloc = std::allocator > -+#endif - class GaborFilterFamily - : public ImageArray - { -diff -uprN misc/vigra1.4.0/include/vigra/gaussians.hxx misc/build/vigra1.4.0/include/vigra/gaussians.hxx ---- misc/vigra1.4.0/include/vigra/gaussians.hxx 2005-12-21 05:53:35.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/gaussians.hxx 2006-08-31 12:08:15.409790000 +0200 -@@ -88,26 +88,26 @@ class Gaussian - sigma > 0.0 - \endcode - */ -- explicit Gaussian(T sigma = 1.0, unsigned int derivativeOrder = 0) -- : sigma_(sigma), -- sigma2_(-0.5 / sigma / sigma), -+ explicit Gaussian(T s = 1.0, unsigned int derivOrder = 0) -+ : sigma_(s), -+ sigma2_(-0.5 / s / s), - norm_(0.0), -- order_(derivativeOrder), -- hermitePolynomial_(derivativeOrder / 2 + 1) -+ order_(derivOrder), -+ hermitePolynomial_(derivOrder / 2 + 1) - { -- vigra_precondition(sigma_ > 0.0, -+ vigra_precondition(s > 0.0, - "Gaussian::Gaussian(): sigma > 0 required."); - switch(order_) - { - case 1: - case 2: -- norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sigma); -+ norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * s); - break; - case 3: -- norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sq(sigma) * sigma); -+ norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * sq(s) * s); - break; - default: -- norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / sigma; -+ norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / s; - } - calculateHermitePolynomial(); - } -diff -uprN misc/vigra1.4.0/include/vigra/imagecontainer.hxx misc/build/vigra1.4.0/include/vigra/imagecontainer.hxx ---- misc/vigra1.4.0/include/vigra/imagecontainer.hxx 2005-12-21 05:53:36.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/imagecontainer.hxx 2006-08-31 12:08:15.429159000 +0200 -@@ -70,7 +70,11 @@ namespace vigra { - Namespace: vigra - */ - template ::other > -+#else -+ class Alloc = std::allocator > -+#endif - class ImageArray - { - Size2D imageSize_; -diff -uprN misc/vigra1.4.0/include/vigra/mathutil.hxx misc/build/vigra1.4.0/include/vigra/mathutil.hxx ---- misc/vigra1.4.0/include/vigra/mathutil.hxx 2005-12-21 05:53:39.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/mathutil.hxx 2006-08-31 12:08:15.449199000 +0200 -@@ -73,8 +73,6 @@ - - namespace vigra { - --#ifndef __sun -- - /** \addtogroup MathFunctions Mathematical Functions - - Useful mathematical functions and functors. -@@ -109,18 +107,11 @@ double erf(T x) - return ans - 1.0; - } - --#else -- --using VIGRA_CSTD::erf; -- --#endif -- - // import functions into namespace vigra which VIGRA is going to overload - - using VIGRA_CSTD::pow; - using VIGRA_CSTD::floor; - using VIGRA_CSTD::ceil; --using std::abs; - - #define VIGRA_DEFINE_UNSIGNED_ABS(T) \ - inline T abs(T t) { return t; } -@@ -130,9 +121,39 @@ VIGRA_DEFINE_UNSIGNED_ABS(unsigned char) - VIGRA_DEFINE_UNSIGNED_ABS(unsigned short) - VIGRA_DEFINE_UNSIGNED_ABS(unsigned int) - VIGRA_DEFINE_UNSIGNED_ABS(unsigned long) -+#ifdef VIGRA_HAS_LONG_LONG -+VIGRA_DEFINE_UNSIGNED_ABS(unsigned long long) -+#endif - - #undef VIGRA_DEFINE_UNSIGNED_ABS - -+#define VIGRA_DEFINE_SIGNED_ABS(T) \ -+ inline T abs(T t) { return (T)abs(t); } -+#define VIGRA_DEFINE_SIGNED_LABS(T) \ -+ inline T abs(T t) { return (T)labs(t); } -+#define VIGRA_DEFINE_SIGNED_LLABS(T) \ -+ inline T abs(T t) { return (T)llabs(t); } -+#define VIGRA_DEFINE_FABS(T) \ -+ inline T abs(T t) { return (T)fabs(t); } -+ -+VIGRA_DEFINE_SIGNED_ABS(signed char) -+VIGRA_DEFINE_SIGNED_ABS(signed short) -+VIGRA_DEFINE_SIGNED_ABS(signed int) -+VIGRA_DEFINE_SIGNED_LABS(signed long) -+#ifdef VIGRA_HAS_LONG_LONG -+VIGRA_DEFINE_SIGNED_LLABS(signed long long) -+#endif -+VIGRA_DEFINE_FABS(float) -+VIGRA_DEFINE_FABS(double) -+#ifdef VIGRA_HAS_LONG_DOUBLE -+VIGRA_DEFINE_FABS(long double) -+#endif -+ -+#undef VIGRA_DEFINE_SIGNED_ABS -+#undef VIGRA_DEFINE_SIGNED_LABS -+#undef VIGRA_DEFINE_SIGNED_LLABS -+#undef VIGRA_DEFINE_FABS -+ - /*! The rounding function. - - Defined for all floating point types. Rounds towards the nearest integer for both -@@ -155,12 +176,14 @@ inline double round(double t) - : ceil(t - 0.5); - } - -+#ifdef VIGRA_HAS_LONG_DOUBLE - inline long double round(long double t) - { - return t >= 0.0 - ? floor(t + 0.5) - : ceil(t - 0.5); - } -+#endif - - /*! The square function. - -@@ -371,9 +394,15 @@ VIGRA_DEFINE_NORM(int) - VIGRA_DEFINE_NORM(unsigned int) - VIGRA_DEFINE_NORM(long) - VIGRA_DEFINE_NORM(unsigned long) -+#ifdef VIGRA_HAS_LONG_LONG -+VIGRA_DEFINE_NORM(long long) -+VIGRA_DEFINE_NORM(unsigned long long) -+#endif - VIGRA_DEFINE_NORM(float) - VIGRA_DEFINE_NORM(double) -+#ifdef VIGRA_HAS_LONG_DOUBLE - VIGRA_DEFINE_NORM(long double) -+#endif - - #undef VIGRA_DEFINE_NORM - -diff -uprN misc/vigra1.4.0/include/vigra/numerictraits.hxx misc/build/vigra1.4.0/include/vigra/numerictraits.hxx ---- misc/vigra1.4.0/include/vigra/numerictraits.hxx 2005-12-21 05:53:41.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/numerictraits.hxx 2006-08-31 12:08:15.474422000 +0200 -@@ -891,6 +891,90 @@ struct NumericTraits - } - }; - -+#ifdef VIGRA_HAS_LONG_LONG -+template<> -+struct NumericTraits -+{ -+ typedef long long Type; -+ typedef long long Promote; -+ typedef double RealPromote; -+ typedef std::complex ComplexPromote; -+ typedef Type ValueType; -+ -+ typedef VigraTrueType isIntegral; -+ typedef VigraTrueType isScalar; -+ typedef VigraTrueType isSigned; -+ typedef VigraTrueType isOrdered; -+ typedef VigraFalseType isComplex; -+ -+ static long long zero() { return 0; } -+ static long long one() { return 1; } -+ static long long nonZero() { return 1; } -+ static long long min() { return LLONG_MIN; } -+ static long long max() { return LLONG_MAX; } -+ -+#ifdef NO_INLINE_STATIC_CONST_DEFINITION -+ enum { minConst = LONG_MIN, maxConst = LLONG_MAX }; -+#else -+ static const long long minConst = LLONG_MIN; -+ static const long long maxConst = LLONG_MAX; -+#endif -+ -+ static Promote toPromote(long long v) { return v; } -+ static RealPromote toRealPromote(long long v) { return v; } -+ static long long fromPromote(Promote v) { return v; } -+ static long long fromRealPromote(RealPromote v) { -+ return ((v < 0.0) -+ ? ((v < (RealPromote)LLONG_MIN) -+ ? LLONG_MIN -+ : static_cast(v - 0.5)) -+ : ((v > (RealPromote)LLONG_MAX) -+ ? LLONG_MAX -+ : static_cast(v + 0.5))); -+ } -+}; -+ -+template<> -+struct NumericTraits -+{ -+ typedef unsigned long long Type; -+ typedef unsigned long long Promote; -+ typedef double RealPromote; -+ typedef std::complex ComplexPromote; -+ typedef Type ValueType; -+ -+ typedef VigraTrueType isIntegral; -+ typedef VigraTrueType isScalar; -+ typedef VigraFalseType isSigned; -+ typedef VigraTrueType isOrdered; -+ typedef VigraFalseType isComplex; -+ -+ static unsigned long long zero() { return 0; } -+ static unsigned long long one() { return 1; } -+ static unsigned long long nonZero() { return 1; } -+ static unsigned long long min() { return 0; } -+ static unsigned long long max() { return ULLONG_MAX; } -+ -+#ifdef NO_INLINE_STATIC_CONST_DEFINITION -+ enum { minConst = 0, maxConst = ULLONG_MAX }; -+#else -+ static const unsigned long long minConst = 0; -+ static const unsigned long long maxConst = ULLONG_MAX; -+#endif -+ -+ static Promote toPromote(unsigned long long v) { return v; } -+ static RealPromote toRealPromote(unsigned long long v) { return v; } -+ static unsigned long long fromPromote(Promote v) { return v; } -+ static unsigned long long fromRealPromote(RealPromote v) { -+ return ((v < 0.0) -+ ? 0 -+ : ((v > (RealPromote)ULLONG_MAX) -+ ? ULLONG_MAX -+ : static_cast(v + 0.5))); -+ } -+}; -+#endif -+ - template<> - struct NumericTraits - { -@@ -949,6 +1033,7 @@ struct NumericTraits - static double fromRealPromote(RealPromote v) { return v; } - }; - -+#ifdef VIGRA_HAS_LONG_DOUBLE - template<> - struct NumericTraits - { -@@ -977,6 +1062,7 @@ struct NumericTraits - static long double fromPromote(Promote v) { return v; } - static long double fromRealPromote(RealPromote v) { return v; } - }; -+#endif - - #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION - -@@ -1055,9 +1141,15 @@ VIGRA_DEFINE_NORM_TRAITS(int) - VIGRA_DEFINE_NORM_TRAITS(unsigned int) - VIGRA_DEFINE_NORM_TRAITS(long) - VIGRA_DEFINE_NORM_TRAITS(unsigned long) -+#ifdef VIGRA_HAS_LONG_LONG -+VIGRA_DEFINE_NORM_TRAITS(long long) -+VIGRA_DEFINE_NORM_TRAITS(unsigned long long) -+#endif - VIGRA_DEFINE_NORM_TRAITS(float) - VIGRA_DEFINE_NORM_TRAITS(double) -+#ifdef VIGRA_HAS_LONG_DOUBLE - VIGRA_DEFINE_NORM_TRAITS(long double) -+#endif - - #undef VIGRA_DEFINE_NORM_TRAITS - -diff -uprN misc/vigra1.4.0/include/vigra/orientedtensorfilters.hxx misc/build/vigra1.4.0/include/vigra/orientedtensorfilters.hxx ---- misc/vigra1.4.0/include/vigra/orientedtensorfilters.hxx 2005-12-21 05:53:42.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/orientedtensorfilters.hxx 2006-08-31 12:08:15.503678000 +0200 -@@ -434,7 +434,7 @@ class Sin6RingKernel - if(x == 0 && y == 0) - return weights_(radius_, radius_); - double d = dot(vectors_(x+radius_, y+radius_), v); -- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_); -+ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_); - } - }; - -@@ -455,7 +455,7 @@ class Sin6Kernel - if(x == 0 && y == 0) - return weights_(radius_, radius_); - double d = dot(vectors_(x+radius_, y+radius_), v); -- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_); -+ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_); - } - }; - -@@ -476,7 +476,7 @@ class Cos6RingKernel - if(x == 0 && y == 0) - return weights_(radius_, radius_); - double d = dot(vectors_(x+radius_, y+radius_), v); -- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_); -+ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_); - } - }; - -@@ -497,7 +497,7 @@ class Cos6Kernel - if(x == 0 && y == 0) - return weights_(radius_, radius_); - double d = dot(vectors_(x+radius_, y+radius_), v); -- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_); -+ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_); - } - }; - -diff -uprN misc/vigra1.4.0/include/vigra/polynomial.hxx misc/build/vigra1.4.0/include/vigra/polynomial.hxx ---- misc/vigra1.4.0/include/vigra/polynomial.hxx 2005-12-21 05:53:42.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/polynomial.hxx 2006-08-31 12:08:15.526572000 +0200 -@@ -118,10 +118,10 @@ class PolynomialView - of subsequent algorithms (especially root finding) performed on the - polynomial. - */ -- PolynomialView(T * coeffs, unsigned int order, double epsilon = 1.0e-14) -+ PolynomialView(T * coeffs, unsigned int ord, double eps = 1.0e-14) - : coeffs_(coeffs), -- order_(order), -- epsilon_(epsilon) -+ order_(ord), -+ epsilon_(eps) - {} - - /// Access the coefficient of x^i -@@ -244,16 +244,16 @@ class PolynomialView - { epsilon_ = eps; } - - protected: -- PolynomialView(double epsilon = 1e-14) -+ PolynomialView(double eps = 1e-14) - : coeffs_(0), - order_(0), -- epsilon_(epsilon) -+ epsilon_(eps) - {} - -- void setCoeffs(T * coeffs, unsigned int order) -+ void setCoeffs(T * coeffs, unsigned int ord) - { - coeffs_ = coeffs; -- order_ = order; -+ order_ = ord; - } - - T * coeffs_; -@@ -396,9 +396,9 @@ PolynomialView::deflateConjugatePair( - - template - void --PolynomialView::minimizeOrder(double epsilon) -+PolynomialView::minimizeOrder(double eps) - { -- while(std::abs(coeffs_[order_]) <= epsilon && order_ > 0) -+ while(std::abs(coeffs_[order_]) <= eps && order_ > 0) - --order_; - } - -diff -uprN misc/vigra1.4.0/include/vigra/recursiveconvolution.hxx misc/build/vigra1.4.0/include/vigra/recursiveconvolution.hxx ---- misc/vigra1.4.0/include/vigra/recursiveconvolution.hxx 2005-12-21 05:53:42.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/recursiveconvolution.hxx 2006-08-31 12:08:15.553556000 +0200 -@@ -259,16 +259,16 @@ void recursiveFilterLine(SrcIterator is, - { - // correction factors for b - double bright = b; -- double bleft = VIGRA_CSTD::pow(b, w); -+ double bleft = VIGRA_CSTD::pow(b, (double)w); - - for(x=w-1; x>=0; --x, --is, --id) - { - TempType f = b * old; - old = as(is) + f; -- double norm = (1.0 - b) / (1.0 + b - bleft - bright); -+ double norm2 = (1.0 - b) / (1.0 + b - bleft - bright); - bleft /= b; - bright *= b; -- ad.set(norm * (line[x] + f), id); -+ ad.set(norm2 * (line[x] + f), id); - } - } - else if(border == BORDER_TREATMENT_AVOID) -diff -uprN misc/vigra1.4.0/include/vigra/rgbvalue.hxx misc/build/vigra1.4.0/include/vigra/rgbvalue.hxx ---- misc/vigra1.4.0/include/vigra/rgbvalue.hxx 2005-12-21 05:53:43.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/rgbvalue.hxx 2006-08-31 12:31:37.392094000 +0200 -@@ -39,6 +39,10 @@ - #ifndef VIGRA_RGBVALUE_HXX - #define VIGRA_RGBVALUE_HXX - -+#if defined __GNUC__ -+#pragma GCC system_header -+#endif -+ - #include // abs(double) - #include // abs(int) - #include "vigra/config.hxx" -@@ -700,8 +704,6 @@ operator/=(RGBValue - return l; - } - --using VIGRA_CSTD::abs; -- - /// component-wise absolute value - template - inline -diff -uprN misc/vigra1.4.0/include/vigra/separableconvolution.hxx misc/build/vigra1.4.0/include/vigra/separableconvolution.hxx ---- misc/vigra1.4.0/include/vigra/separableconvolution.hxx 2005-12-21 05:53:44.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/separableconvolution.hxx 2006-08-31 12:08:15.610465000 +0200 -@@ -1017,11 +1017,11 @@ class Kernel1D - */ - InitProxy operator=(value_type const & v) - { -- int size = right_ - left_ + 1; -+ int sz = right_ - left_ + 1; - for(unsigned int i=0; i= 0, -+ vigra_precondition(r >= 0, - "Kernel1D::initExplicitly(): right border must be <= 0."); - -- right_ = right; -- left_ = left; -+ right_ = r; -+ left_ = l; - -- kernel_.resize(right - left + 1); -+ kernel_.resize(r - l + 1); - - return *this; - } -@@ -1342,8 +1342,8 @@ class Kernel1D - }; - - template --void Kernel1D::normalize(value_type norm, -- unsigned int derivativeOrder, -+void Kernel1D::normalize(value_type normFactor, -+ unsigned int derivOrder, - double offset) - { - typedef typename NumericTraits::RealPromote TmpType; -@@ -1352,7 +1352,7 @@ void Kernel1D::normalize(valu - Iterator k = kernel_.begin(); - TmpType sum = NumericTraits::zero(); - -- if(derivativeOrder == 0) -+ if(derivOrder == 0) - { - for(; k < kernel_.end(); ++k) - { -@@ -1362,11 +1362,11 @@ void Kernel1D::normalize(valu - else - { - unsigned int faculty = 1; -- for(unsigned int i = 2; i <= derivativeOrder; ++i) -+ for(unsigned int i = 2; i <= derivOrder; ++i) - faculty *= i; - for(double x = left() + offset; k < kernel_.end(); ++x, ++k) - { -- sum += *k * VIGRA_CSTD::pow(-x, int(derivativeOrder)) / faculty; -+ sum += *k * VIGRA_CSTD::pow(-x, (double)derivOrder) / faculty; - } - } - -@@ -1374,21 +1374,21 @@ void Kernel1D::normalize(valu - "Kernel1D::normalize(): " - "Cannot normalize a kernel with sum = 0"); - // normalize -- sum = norm / sum; -+ sum = normFactor / sum; - k = kernel_.begin(); - for(; k != kernel_.end(); ++k) - { - *k = *k * sum; - } - -- norm_ = norm; -+ norm_ = normFactor; - } - - /***********************************************************************/ - - template - void Kernel1D::initGaussian(double std_dev, -- value_type norm) -+ value_type normFactor) - { - vigra_precondition(std_dev >= 0.0, - "Kernel1D::initGaussian(): Standard deviation must be >= 0."); -@@ -1421,8 +1421,8 @@ void Kernel1D::initGaussian(d - right_ = 0; - } - -- if(norm != 0.0) -- normalize(norm); -+ if(normFactor != 0.0) -+ normalize(normFactor); - else - norm_ = 1.0; - -@@ -1434,7 +1434,7 @@ void Kernel1D::initGaussian(d - - template - void Kernel1D::initDiscreteGaussian(double std_dev, -- value_type norm) -+ value_type normFactor) - { - vigra_precondition(std_dev >= 0.0, - "Kernel1D::initDiscreteGaussian(): Standard deviation must be >= 0."); -@@ -1476,7 +1476,7 @@ void Kernel1D::initDiscreteGa - er += warray[i]; - } - -- double scale = norm / (2*er - warray[0]); -+ double scale = normFactor / (2*er - warray[0]); - - initExplicitly(-radius, radius); - iterator c = center(); -@@ -1489,12 +1489,12 @@ void Kernel1D::initDiscreteGa - else - { - kernel_.erase(kernel_.begin(), kernel_.end()); -- kernel_.push_back(norm); -+ kernel_.push_back(normFactor); - left_ = 0; - right_ = 0; - } - -- norm_ = norm; -+ norm_ = normFactor; - - // best border treatment for Gaussians is BORDER_TREATMENT_REFLECT - border_treatment_ = BORDER_TREATMENT_REFLECT; -@@ -1505,15 +1505,15 @@ void Kernel1D::initDiscreteGa - template - void - Kernel1D::initGaussianDerivative(double std_dev, -- int order, -- value_type norm) -+ int order, -+ value_type normFactor) - { - vigra_precondition(order >= 0, - "Kernel1D::initGaussianDerivative(): Order must be >= 0."); - - if(order == 0) - { -- initGaussian(std_dev, norm); -+ initGaussian(std_dev, normFactor); - return; - } - -@@ -1544,7 +1544,7 @@ Kernel1D::initGaussianDerivat - - // remove DC, but only if kernel correction is permitted by a non-zero - // value for norm -- if(norm != 0.0) -+ if(normFactor != 0.0) - { - for(unsigned int i=0; i < kernel_.size(); ++i) - { -@@ -1555,8 +1555,8 @@ Kernel1D::initGaussianDerivat - left_ = -radius; - right_ = radius; - -- if(norm != 0.0) -- normalize(norm, order); -+ if(normFactor != 0.0) -+ normalize(normFactor, order); - else - norm_ = 1.0; - -@@ -1570,7 +1570,7 @@ Kernel1D::initGaussianDerivat - template - void - Kernel1D::initBinomial(int radius, -- value_type norm) -+ value_type normFactor) - { - vigra_precondition(radius > 0, - "Kernel1D::initBinomial(): Radius must be > 0."); -@@ -1600,12 +1600,12 @@ Kernel1D::initBinomial(int ra - - for(i=0; i<=radius*2+1; ++i) - { -- kernel_.push_back(kernel[i] * norm); -+ kernel_.push_back(kernel[i] * normFactor); - } - - left_ = -radius; - right_ = radius; -- norm_ = norm; -+ norm_ = normFactor; - - // best border treatment for Binomial is BORDER_TREATMENT_REFLECT - border_treatment_ = BORDER_TREATMENT_REFLECT; -@@ -1615,7 +1615,7 @@ Kernel1D::initBinomial(int ra - - template - void Kernel1D::initAveraging(int radius, -- value_type norm) -+ value_type normFactor) - { - vigra_precondition(radius > 0, - "Kernel1D::initAveraging(): Radius must be > 0."); -@@ -1629,12 +1629,12 @@ void Kernel1D::initAveraging( - - for(int i=0; i<=radius*2+1; ++i) - { -- kernel_.push_back(scale * norm); -+ kernel_.push_back(scale * normFactor); - } - - left_ = -radius; - right_ = radius; -- norm_ = norm; -+ norm_ = normFactor; - - // best border treatment for Averaging is BORDER_TREATMENT_CLIP - border_treatment_ = BORDER_TREATMENT_CLIP; -@@ -1644,18 +1644,18 @@ void Kernel1D::initAveraging( - - template - void --Kernel1D::initSymmetricGradient(value_type norm) -+Kernel1D::initSymmetricGradient(value_type normFactor) - { - kernel_.erase(kernel_.begin(), kernel_.end()); - kernel_.reserve(3); - -- kernel_.push_back(0.5 * norm); -- kernel_.push_back(0.0 * norm); -- kernel_.push_back(-0.5 * norm); -+ kernel_.push_back(0.5 * normFactor); -+ kernel_.push_back(0.0 * normFactor); -+ kernel_.push_back(-0.5 * normFactor); - - left_ = -1; - right_ = 1; -- norm_ = norm; -+ norm_ = normFactor; - - // best border treatment for SymmetricGradient is - // BORDER_TREATMENT_REPEAT -diff -uprN misc/vigra1.4.0/include/vigra/sized_int.hxx misc/build/vigra1.4.0/include/vigra/sized_int.hxx ---- misc/vigra1.4.0/include/vigra/sized_int.hxx 2005-12-21 05:53:44.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/sized_int.hxx 2006-08-31 12:26:31.937797000 +0200 -@@ -73,6 +73,10 @@ struct SelectIntegerType - struct SelectBiggestIntegerType - { -@@ -86,6 +90,10 @@ struct SelectBiggestIntegerType - type; - }; - -+#if defined __SUNPRO_CC -+#pragma enable_warn -+#endif -+ - template<> - struct SelectBiggestIntegerType - { -diff -uprN misc/vigra1.4.0/include/vigra/splines.hxx misc/build/vigra1.4.0/include/vigra/splines.hxx ---- misc/vigra1.4.0/include/vigra/splines.hxx 2005-12-21 05:53:44.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/splines.hxx 2006-08-31 12:08:15.655906000 +0200 -@@ -108,8 +108,8 @@ class BSplineBase - /** Create functor for gevine derivative of the spline. The spline's order - is specified spline by the template argument ORDER. - */ -- explicit BSplineBase(unsigned int derivativeOrder = 0) -- : s1_(derivativeOrder) -+ explicit BSplineBase(unsigned int derivOrder = 0) -+ : s1_(derivOrder) - {} - - /** Unary function call. -@@ -280,8 +280,8 @@ class BSplineBase<0, T> - typedef T result_type; - enum StaticOrder { order = 0 }; - -- explicit BSplineBase(unsigned int derivativeOrder = 0) -- : derivativeOrder_(derivativeOrder) -+ explicit BSplineBase(unsigned int derivOrder = 0) -+ : derivativeOrder_(derivOrder) - {} - - result_type operator()(argument_type x) const -@@ -357,8 +357,8 @@ class BSpline<1, T> - typedef T result_type; - enum StaticOrder { order = 1 }; - -- explicit BSpline(unsigned int derivativeOrder = 0) -- : derivativeOrder_(derivativeOrder) -+ explicit BSpline(unsigned int derivOrder = 0) -+ : derivativeOrder_(derivOrder) - {} - - result_type operator()(argument_type x) const -@@ -454,8 +454,8 @@ class BSpline<2, T> - typedef T result_type; - enum StaticOrder { order = 2 }; - -- explicit BSpline(unsigned int derivativeOrder = 0) -- : derivativeOrder_(derivativeOrder) -+ explicit BSpline(unsigned int derivOrder = 0) -+ : derivativeOrder_(derivOrder) - {} - - result_type operator()(argument_type x) const -@@ -580,8 +580,8 @@ class BSpline<3, T> - typedef T result_type; - enum StaticOrder { order = 3 }; - -- explicit BSpline(unsigned int derivativeOrder = 0) -- : derivativeOrder_(derivativeOrder) -+ explicit BSpline(unsigned int derivOrder = 0) -+ : derivativeOrder_(derivOrder) - {} - - result_type operator()(argument_type x) const -@@ -732,8 +732,8 @@ class BSpline<5, T> - typedef T result_type; - enum StaticOrder { order = 5 }; - -- explicit BSpline(unsigned int derivativeOrder = 0) -- : derivativeOrder_(derivativeOrder) -+ explicit BSpline(unsigned int derivOrder = 0) -+ : derivativeOrder_(derivOrder) - {} - - result_type operator()(argument_type x) const -diff -uprN misc/vigra1.4.0/include/vigra/static_assert.hxx misc/build/vigra1.4.0/include/vigra/static_assert.hxx ---- misc/vigra1.4.0/include/vigra/static_assert.hxx 2005-12-21 05:53:45.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/static_assert.hxx 2006-08-31 12:08:15.677548000 +0200 -@@ -115,7 +115,7 @@ assertImpl( void (*)(Predicate), typenam - - TODO: provide more assertion base classes for other (non boolean) types of tests - */ --#if !defined(__GNUC__) || __GNUC__ > 2 -+#if (!defined(__GNUC__) || __GNUC__ > 2) && (!defined(__SUNPRO_CC) || __SUNPRO_CC > 0x550) - #define VIGRA_STATIC_ASSERT(Predicate) \ - enum { \ - VIGRA_PREPROCESSOR_CONCATENATE(vigra_assertion_in_line_, __LINE__) = sizeof( \ -diff -uprN misc/vigra1.4.0/include/vigra/tinyvector.hxx misc/build/vigra1.4.0/include/vigra/tinyvector.hxx ---- misc/vigra1.4.0/include/vigra/tinyvector.hxx 2005-12-21 05:53:46.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/tinyvector.hxx 2006-08-31 12:31:25.140791000 +0200 -@@ -39,6 +39,10 @@ - #ifndef VIGRA_TINYVECTOR_HXX - #define VIGRA_TINYVECTOR_HXX - -+#if defined __GNUC__ -+#pragma GCC system_header -+#endif -+ - #include // abs(double) - #include // abs(int) - #include // ostream -@@ -49,7 +53,6 @@ - - namespace vigra { - --using VIGRA_CSTD::abs; - using VIGRA_CSTD::ceil; - using VIGRA_CSTD::floor; - -@@ -439,9 +442,9 @@ class TinyVectorBase - /** Initialize from another sequence (must have length SIZE!) - */ - template -- void init(Iterator i, Iterator end) -+ void init(Iterator i, Iterator iend) - { -- vigra_precondition(end-i == SIZE, -+ vigra_precondition(iend-i == SIZE, - "TinyVector::init(): Sequence has wrong size."); - Loop::assignCast(data_, i); - } -diff -uprN misc/vigra1.4.0/include/vigra/transformimage.hxx misc/build/vigra1.4.0/include/vigra/transformimage.hxx ---- misc/vigra1.4.0/include/vigra/transformimage.hxx 2005-12-21 05:53:46.000000000 +0100 -+++ misc/build/vigra1.4.0/include/vigra/transformimage.hxx 2006-08-31 12:08:15.727415000 +0200 -@@ -986,11 +986,11 @@ class BrightnessContrastFunctor - result_type operator()(argument_type const & v) const - { - promote_type v1 = (v - min_) / diff_; -- promote_type brighter = pow(v1, b_); -+ promote_type brighter = pow((promote_type)v1, b_); - promote_type v2 = 2.0 * brighter - one_; - promote_type contrasted = (v2 < zero_) ? -- -pow(-v2, c_) : -- pow(v2, c_); -+ -pow((promote_type)-v2, c_) : -+ pow((promote_type)v2, c_); - return result_type(0.5 * diff_ * (contrasted + one_) + min_); - } - -diff -uprN misc/vigra1.4.0/include/vigra/diff2d.hxx misc/build/vigra1.4.0/include/vigra/diff2d.hxx ---- misc/vigra1.4.0/include/vigra/diff2d.hxx 2009-03-02 09:27:34.000000000 +0000 -+++ misc/build/vigra1.4.0/include/vigra/diff2d.hxx 2009-03-02 09:27:57.000000000 +0000 -@@ -1117,7 +1117,7 @@ - bool contains(Rect2D const &r) const - { - return r.isEmpty() || -- contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1)); -+ (contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1))); - } - - /** Return whether this rectangle overlaps with the given diff --git a/vigra/vigra1.6.0-unused-parameters.patch b/vigra/vigra1.6.0-unused-parameters.patch new file mode 100644 index 000000000000..7e23531bad6f --- /dev/null +++ b/vigra/vigra1.6.0-unused-parameters.patch @@ -0,0 +1,31 @@ +--- misc/vigra1.6.0/include/vigra/basicimage.hxx 2012-01-19 22:49:11.232074631 +0100 ++++ misc/build/vigra1.6.0/include/vigra/basicimage.hxx 2012-01-19 22:48:12.997439136 +0100 +@@ -72,7 +72,7 @@ + difference_type offset_; + }; + +- static void initialize(BaseType &) {} ++ static void initialize(__attribute__ ((unused)) BaseType &) {} + + static reference dereference(BaseType const & d) + { return const_cast(*(*d.line_start_ + d.offset_)); } +--- misc/vigra1.6.0/include/vigra/diff2d.hxx 2012-01-19 22:49:11.280074335 +0100 ++++ misc/build/vigra1.6.0/include/vigra/diff2d.hxx 2012-01-19 22:49:00.129144170 +0100 +@@ -60,7 +60,7 @@ + typedef Diff const * pointer; + typedef std::random_access_iterator_tag iterator_category; + +- static void initialize(BaseType &) {} ++ static void initialize(__attribute__ ((unused)) BaseType &) {} + + static reference dereference(BaseType const & d) + { return d; } +@@ -102,7 +102,7 @@ + typedef Diff const * pointer; + typedef std::random_access_iterator_tag iterator_category; + +- static void initialize(BaseType & /*d*/) {} ++ static void initialize(__attribute__ ((unused)) BaseType & /*d*/) {} + + static reference dereference(BaseType const & d) + { return d; } diff --git a/vigra/vigra1.6.0.patch b/vigra/vigra1.6.0.patch new file mode 100644 index 000000000000..db57c2e28522 --- /dev/null +++ b/vigra/vigra1.6.0.patch @@ -0,0 +1,1453 @@ +diff -uprN misc/vigra1.6.0/configure misc/build/vigra1.6.0/configure +--- misc/vigra1.6.0/configure 2008-08-13 08:15:32.000000000 -0500 ++++ misc/build/vigra1.6.0/configure 2012-09-19 17:30:24.000000000 -0500 +@@ -7843,7 +7843,7 @@ kfreebsd*-gnu) + ;; + + freebsd*) +- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` ++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +@@ -11504,7 +11504,7 @@ kfreebsd*-gnu) + ;; + + freebsd*) +- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` ++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +@@ -14616,7 +14616,7 @@ kfreebsd*-gnu) + ;; + + freebsd*) +- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` ++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +@@ -16958,7 +16958,7 @@ kfreebsd*-gnu) + ;; + + freebsd*) +- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` ++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +diff -uprN misc/vigra1.6.0/include/vigra/array_vector.hxx misc/build/vigra1.6.0/include/vigra/array_vector.hxx +--- misc/vigra1.6.0/include/vigra/array_vector.hxx 2008-08-13 08:15:34.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/array_vector.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -578,7 +578,38 @@ public: + iterator insert(iterator p, size_type n, value_type const & v); + + template +- iterator insert(iterator p, InputIterator i, InputIterator iend); ++ iterator insert(iterator p, InputIterator i, InputIterator iend) ++ { ++ difference_type n = iend - i; ++ difference_type pos = p - begin(); ++ size_type new_size = size() + n; ++ if(new_size >= capacity_) ++ { ++ pointer new_data = reserve_raw(new_size); ++ std::uninitialized_copy(begin(), p, new_data); ++ std::uninitialized_copy(i, iend, new_data + pos); ++ std::uninitialized_copy(p, end(), new_data + pos + n); ++ deallocate(data_, size_); ++ capacity_ = new_size; ++ data_ = new_data; ++ } ++ else if(pos + n >= size_) ++ { ++ size_type diff = pos + n - size_; ++ std::uninitialized_copy(p, end(), end() + diff); ++ std::uninitialized_copy(iend - diff, iend, end()); ++ std::copy(i, iend - diff, p); ++ } ++ else ++ { ++ size_type diff = size_ - (pos + n); ++ std::uninitialized_copy(end() - n, end(), end()); ++ std::copy_backward(p, p + diff, end()); ++ std::copy(i, iend, p); ++ } ++ size_ = new_size; ++ return begin() + pos; ++ } + + iterator erase(iterator p); + +diff -uprN misc/vigra1.6.0/include/vigra/basicimage.hxx misc/build/vigra1.6.0/include/vigra/basicimage.hxx +--- misc/vigra1.6.0/include/vigra/basicimage.hxx 2008-08-13 08:15:34.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/basicimage.hxx 2012-09-19 17:46:22.000000000 -0500 +@@ -572,7 +572,11 @@ class BasicImage + typedef Alloc allocator_type; + + typedef Alloc Allocator; ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + typedef typename Alloc::template rebind::other LineAllocator; ++#else ++ typedef std::allocator LineAllocator; ++#endif + + /** construct image of size 0x0 + */ +@@ -589,39 +593,51 @@ class BasicImage + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) ++#else ++ pallocator_() ++#endif + {} + + /** construct image of size width x height, use the specified allocator. + */ +- BasicImage(int width, int height, Alloc const & alloc = Alloc()) ++ BasicImage(int w, int h, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) ++#else ++ pallocator_() ++#endif + { +- vigra_precondition((width >= 0) && (height >= 0), +- "BasicImage::BasicImage(int width, int height): " ++ vigra_precondition((w >= 0) && (h >= 0), ++ "BasicImage::BasicImage(int w, int h): " + "width and height must be >= 0.\n"); + +- resize(width, height, value_type()); ++ resize(w, h, value_type()); + } + + /** construct image of size size.x x size.y, use the specified allocator. + */ +- explicit BasicImage(difference_type const & size, Alloc const & alloc = Alloc()) ++ explicit BasicImage(difference_type const & sz, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) +- { +- vigra_precondition((size.x >= 0) && (size.y >= 0), +- "BasicImage::BasicImage(Diff2D size): " +- "size.x and size.y must be >= 0.\n"); ++#else ++ pallocator_() ++#endif ++ { ++ vigra_precondition((sz.x >= 0) && (sz.y >= 0), ++ "BasicImage::BasicImage(Diff2D sz): " ++ "sz.x and sz.y must be >= 0.\n"); + +- resize(size.x, size.y, value_type()); ++ resize(sz.x, sz.y, value_type()); + } + + /** construct image of size width*height and initialize every +@@ -629,71 +645,87 @@ class BasicImage + value_type doesn't have a default constructor). + Use the specified allocator. + */ +- BasicImage(int width, int height, value_type const & d, Alloc const & alloc = Alloc()) ++ BasicImage(int w, int h, value_type const & d, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) ++#else ++ pallocator_() ++#endif + { +- vigra_precondition((width >= 0) && (height >= 0), +- "BasicImage::BasicImage(int width, int height, value_type const & ): " ++ vigra_precondition((w >= 0) && (h >= 0), ++ "BasicImage::BasicImage(int w, int h, value_type const & ): " + "width and height must be >= 0.\n"); + +- resize(width, height, d); ++ resize(w, h, d); + } + + /** construct image of size size.x x size.y and initialize + every pixel with given data (use this constructor, if + value_type doesn't have a default constructor). Use the specified allocator. + */ +- explicit BasicImage(difference_type const & size, value_type const & d, Alloc const & alloc = Alloc()) ++ explicit BasicImage(difference_type const & sz, value_type const & d, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) +- { +- vigra_precondition((size.x >= 0) && (size.y >= 0), +- "BasicImage::BasicImage(Diff2D const & size, value_type const & v): " +- "size.x and size.y must be >= 0.\n"); ++#else ++ pallocator_() ++#endif ++ { ++ vigra_precondition((sz.x >= 0) && (sz.y >= 0), ++ "BasicImage::BasicImage(Diff2D const & sz, value_type const & v): " ++ "sz.x and sz.y must be >= 0.\n"); + +- resize(size.x, size.y, d); ++ resize(sz.x, sz.y, d); + } + + + /** construct image of size width*height and copy the data from the + given C-style array \a d. Use the specified allocator. + */ +- BasicImage(int width, int height, const_pointer d, Alloc const & alloc = Alloc()) ++ BasicImage(int w, int h, const_pointer d, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) ++#else ++ pallocator_() ++#endif + { +- vigra_precondition((width >= 0) && (height >= 0), +- "BasicImage::BasicImage(int width, int height, const_pointer ): " ++ vigra_precondition((w >= 0) && (h >= 0), ++ "BasicImage::BasicImage(int w, int h, const_pointer ): " + "width and height must be >= 0.\n"); + +- resizeCopy(width, height, d); ++ resizeCopy(w, h, d); + } + + /** construct image of size size.x x size.y and copy the data from the + given C-style array. Use the specified allocator. + */ +- explicit BasicImage(difference_type const & size, const_pointer d, Alloc const & alloc = Alloc()) ++ explicit BasicImage(difference_type const & sz, const_pointer d, Alloc const & alloc = Alloc()) + : data_(0), + width_(0), + height_(0), + allocator_(alloc), ++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS + pallocator_(alloc) +- { +- vigra_precondition((size.x >= 0) && (size.y >= 0), +- "BasicImage::BasicImage(Diff2D const & size, const_pointer): " +- "size.x and size.y must be >= 0.\n"); ++#else ++ pallocator_() ++#endif ++ { ++ vigra_precondition((sz.x >= 0) && (sz.y >= 0), ++ "BasicImage::BasicImage(Diff2D const & sz, const_pointer): " ++ "sz.x and sz.y must be >= 0.\n"); + +- resizeCopy(size.x, size.y, d); ++ resizeCopy(sz.x, sz.y, d); + } + + /** copy rhs image +@@ -730,20 +762,20 @@ class BasicImage + /** reset image to specified size (dimensions must not be negative) + (old data are kept if new size matches old size) + */ +- void resize(int width, int height) ++ void resize(int w, int h) + { +- if(width != width_ || height != height_) +- resize(width, height, value_type()); ++ if(w != width_ || h != height_) ++ resize(w, h, value_type()); + } + + /** reset image to specified size (dimensions must not be negative) + (old data are kept if new size matches old size) + */ +- void resize(difference_type const & size) ++ void resize(difference_type const & sz) + { +- if(size.x != width_ || size.y != height_) ++ if(sz.x != width_ || sz.y != height_) + { +- resize(size.x, size.y, value_type()); ++ resize(sz.x, sz.y, value_type()); + } + } + +@@ -752,12 +784,12 @@ class BasicImage + constructor, dimensions must not be negative, + old data are kept if new size matches old size) + */ +- void resize(int width, int height, value_type const & d); ++ void resize(int w, int h, value_type const & d); + + /** resize image to given size and initialize by copying data + from the C-style arra \a data. + */ +- void resizeCopy(int width, int height, const_pointer data); ++ void resizeCopy(int w, int h, const_pointer data); + + /** resize image to size of other image and copy it's data + */ +@@ -1066,30 +1098,30 @@ BasicImage::init(value + + template + void +-BasicImage::resize(int width, int height, value_type const & d) ++BasicImage::resize(int w, int h, value_type const & d) + { +- vigra_precondition((width >= 0) && (height >= 0), +- "BasicImage::resize(int width, int height, value_type const &): " ++ vigra_precondition((w >= 0) && (h >= 0), ++ "BasicImage::resize(int w, int h, value_type const &): " + "width and height must be >= 0.\n"); + +- if (width_ != width || height_ != height) // change size? ++ if (width_ != w || height_ != h) // change size? + { + value_type * newdata = 0; + value_type ** newlines = 0; +- if(width*height > 0) ++ if(w*h > 0) + { +- if (width*height != width_*height_) // different sizes, must reallocate ++ if (w*h != width_*height_) // different sizes, must reallocate + { +- newdata = allocator_.allocate(typename Alloc::size_type(width*height)); +- std::uninitialized_fill_n(newdata, width*height, d); +- newlines = initLineStartArray(newdata, width, height); ++ newdata = allocator_.allocate(typename Alloc::size_type(w*h)); ++ std::uninitialized_fill_n(newdata, w*h, d); ++ newlines = initLineStartArray(newdata, w, h); + deallocate(); + } + else // need only to reshape + { + newdata = data_; +- std::fill_n(newdata, width*height, d); +- newlines = initLineStartArray(newdata, width, height); ++ std::fill_n(newdata, w*h, d); ++ newlines = initLineStartArray(newdata, w, h); + pallocator_.deallocate(lines_, typename Alloc::size_type(height_)); + } + } +@@ -1100,22 +1132,22 @@ BasicImage::resize(int + + data_ = newdata; + lines_ = newlines; +- width_ = width; +- height_ = height; ++ width_ = w; ++ height_ = h; + } +- else if(width*height > 0) // keep size, re-init data ++ else if(w*h > 0) // keep size, re-init data + { +- std::fill_n(data_, width*height, d); ++ std::fill_n(data_, w*h, d); + } + } + + + template + void +-BasicImage::resizeCopy(int width, int height, const_pointer data) ++BasicImage::resizeCopy(int w, int h, const_pointer src_data) + { +- int newsize = width*height; +- if (width_ != width || height_ != height) // change size? ++ int newsize = w*h; ++ if (width_ != w || height_ != h) // change size? + { + value_type * newdata = 0; + value_type ** newlines = 0; +@@ -1124,15 +1156,15 @@ BasicImage::resizeCopy + if (newsize != width_*height_) // different sizes, must reallocate + { + newdata = allocator_.allocate(typename Alloc::size_type(newsize)); +- std::uninitialized_copy(data, data + newsize, newdata); +- newlines = initLineStartArray(newdata, width, height); ++ std::uninitialized_copy(src_data, src_data + newsize, newdata); ++ newlines = initLineStartArray(newdata, w, h); + deallocate(); + } + else // need only to reshape + { + newdata = data_; +- std::copy(data, data + newsize, newdata); +- newlines = initLineStartArray(newdata, width, height); ++ std::copy(src_data, src_data + newsize, newdata); ++ newlines = initLineStartArray(newdata, w, h); + pallocator_.deallocate(lines_, typename Alloc::size_type(height_)); + } + } +@@ -1143,12 +1175,12 @@ BasicImage::resizeCopy + + data_ = newdata; + lines_ = newlines; +- width_ = width; +- height_ = height; ++ width_ = w; ++ height_ = h; + } + else if(newsize > 0) // keep size, copy data + { +- std::copy(data, data + newsize, data_); ++ std::copy(src_data, src_data + newsize, data_); + } + } + +@@ -1183,11 +1215,11 @@ BasicImage::deallocate + + template + PIXELTYPE ** +-BasicImage::initLineStartArray(value_type * data, int width, int height) ++BasicImage::initLineStartArray(value_type * src_data, int w, int h) + { +- value_type ** lines = pallocator_.allocate(typename Alloc::size_type(height)); +- for(int y=0; y(data)), ++ BasicImageView(const_pointer src_data, int w, int h, int data_stride = 0) ++ : data_(const_cast(src_data)), + width_(w), + height_(h), +- stride_(stride == 0 ? w : stride) ++ stride_(data_stride == 0 ? w : data_stride) + {} + + /** construct view of size size.x x size.y + */ +- BasicImageView(const_pointer data, difference_type const & size, int stride = 0) +- : data_(const_cast(data)), +- width_(size.x), +- height_(size.y), +- stride_(stride == 0 ? size.x : stride) ++ BasicImageView(const_pointer src_data, difference_type const & sz, int data_stride = 0) ++ : data_(const_cast(src_data)), ++ width_(sz.x), ++ height_(sz.y), ++ stride_(data_stride == 0 ? sz.x : data_stride) + {} + + /** set Image with const value +diff -uprN misc/vigra1.6.0/include/vigra/boundarytensor.hxx misc/build/vigra1.6.0/include/vigra/boundarytensor.hxx +--- misc/vigra1.6.0/include/vigra/boundarytensor.hxx 2008-08-13 08:15:34.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/boundarytensor.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -71,8 +71,8 @@ initGaussianPolarFilters1(double std_dev + int radius = (int)(4.0*std_dev + 0.5); + std_dev *= 1.08179074376; + double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm +- double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5); +- double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3); ++ double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5.0); ++ double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3.0); + double sigma22 = -0.5 / std_dev / std_dev; + + +@@ -175,7 +175,7 @@ initGaussianPolarFilters3(double std_dev + std_dev *= 1.15470053838; + double sigma22 = -0.5 / std_dev / std_dev; + double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm +- double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5); ++ double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5.0); + + for(unsigned int i=0; i ++template + struct FPAssignWithRound; + +-template <> +-struct FPAssignWithRound ++template ++struct FPAssignWithRound + { +- template + static inline int exec(int v) { return v << (-N); } + }; + +-template <> +-struct FPAssignWithRound ++template ++struct FPAssignWithRound + { +- template + static inline int exec(int const v) + { + return (v + (1 << (N - 1))) >> (N); +@@ -276,7 +274,7 @@ public: + */ + template + FixedPoint(const FixedPoint &other) +- : value(detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value)) ++ : value(detail::FPAssignWithRound<(Frac2 > FractionalBits), Frac2 - FractionalBits>::exec(other.value)) + { + VIGRA_STATIC_ASSERT((FixedPoint_overflow_error__More_than_31_bits_requested<(IntBits + FractionalBits)>)); + VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); +@@ -321,7 +319,7 @@ public: + FixedPoint & operator=(const FixedPoint &other) + { + VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); +- value = detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); ++ value = detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); + return *this; + } + +@@ -373,7 +371,7 @@ public: + FixedPoint & operator+=(const FixedPoint &other) + { + VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); +- value += detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); ++ value += detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); + return *this; + } + +@@ -384,7 +382,7 @@ public: + FixedPoint & operator-=(const FixedPoint &other) + { + VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>)); +- value -= detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec(other.value); ++ value -= detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value); + return *this; + } + +diff -uprN misc/vigra1.6.0/include/vigra/gaborfilter.hxx misc/build/vigra1.6.0/include/vigra/gaborfilter.hxx +--- misc/vigra1.6.0/include/vigra/gaborfilter.hxx 2008-08-13 08:15:36.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/gaborfilter.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -287,7 +287,11 @@ inline double angularGaborSigma(int dire + Namespace: vigra + */ + template ::other > ++#else ++ class Alloc = std::allocator > ++#endif + class GaborFilterFamily + : public ImageArray + { +diff -uprN misc/vigra1.6.0/include/vigra/gaussians.hxx misc/build/vigra1.6.0/include/vigra/gaussians.hxx +--- misc/vigra1.6.0/include/vigra/gaussians.hxx 2008-08-13 08:15:36.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/gaussians.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -88,26 +88,26 @@ class Gaussian + sigma > 0.0 + \endcode + */ +- explicit Gaussian(T sigma = 1.0, unsigned int derivativeOrder = 0) +- : sigma_(sigma), +- sigma2_(-0.5 / sigma / sigma), ++ explicit Gaussian(T s = 1.0, unsigned int derivOrder = 0) ++ : sigma_(s), ++ sigma2_(-0.5 / s / s), + norm_(0.0), +- order_(derivativeOrder), +- hermitePolynomial_(derivativeOrder / 2 + 1) ++ order_(derivOrder), ++ hermitePolynomial_(derivOrder / 2 + 1) + { +- vigra_precondition(sigma_ > 0.0, ++ vigra_precondition(s > 0.0, + "Gaussian::Gaussian(): sigma > 0 required."); + switch(order_) + { + case 1: + case 2: +- norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sigma); ++ norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * s); + break; + case 3: +- norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sq(sigma) * sigma); ++ norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * sq(s) * s); + break; + default: +- norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / sigma; ++ norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / s; + } + calculateHermitePolynomial(); + } +--- misc/vigra1.6.0/include/vigra/mathutil.hxx 2008-08-13 08:15:38.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/mathutil.hxx 2012-09-21 02:16:23.000000000 -0500 +@@ -88,7 +88,7 @@ using VIGRA_CSTD::ceil; + + // import abs(float), abs(double), abs(long double) from + // and abs(int), abs(long), abs(long long) from +-using std::abs; ++//using std::abs; + + // define the missing variants of abs() to avoid 'ambigous overload' + // errors in template functions +@@ -100,17 +100,41 @@ VIGRA_DEFINE_UNSIGNED_ABS(unsigned char) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned short) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned int) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned long) ++#ifdef VIGRA_HAS_LONG_LONG + VIGRA_DEFINE_UNSIGNED_ABS(unsigned long long) ++#endif + + #undef VIGRA_DEFINE_UNSIGNED_ABS + + #define VIGRA_DEFINE_MISSING_ABS(T) \ + inline T abs(T t) { return t < 0 ? -t : t; } + +-VIGRA_DEFINE_MISSING_ABS(signed char) +-VIGRA_DEFINE_MISSING_ABS(signed short) ++#define VIGRA_DEFINE_SIGNED_ABS(T) \ ++ inline T abs(T t) { return (T)abs(t); } ++#define VIGRA_DEFINE_SIGNED_LABS(T) \ ++ inline T abs(T t) { return (T)labs(t); } ++#define VIGRA_DEFINE_SIGNED_LLABS(T) \ ++ inline T abs(T t) { return (T)llabs(t); } ++#define VIGRA_DEFINE_FABS(T) \ ++ inline T abs(T t) { return (T)fabs(t); } ++ ++VIGRA_DEFINE_SIGNED_ABS(signed char) ++VIGRA_DEFINE_SIGNED_ABS(signed short) ++VIGRA_DEFINE_SIGNED_ABS(signed int) ++VIGRA_DEFINE_SIGNED_LABS(signed long) ++#ifdef VIGRA_HAS_LONG_LONG ++VIGRA_DEFINE_SIGNED_LLABS(signed long long) ++#endif ++VIGRA_DEFINE_FABS(float) ++VIGRA_DEFINE_FABS(double) ++#ifdef VIGRA_HAS_LONG_DOUBLE ++VIGRA_DEFINE_FABS(long double) ++#endif + +-#undef VIGRA_DEFINE_MISSING_ABS ++#undef VIGRA_DEFINE_SIGNED_ABS ++#undef VIGRA_DEFINE_SIGNED_LABS ++#undef VIGRA_DEFINE_SIGNED_LLABS ++#undef VIGRA_DEFINE_FABS + + /*! The rounding function. + +@@ -134,12 +158,14 @@ inline double round(double t) + : ceil(t - 0.5); + } + ++#ifdef VIGRA_HAS_LONG_DOUBLE + inline long double round(long double t) + { + return t >= 0.0 + ? floor(t + 0.5) + : ceil(t - 0.5); + } ++#endif + + /*! Round up to the nearest power of 2. + +@@ -440,9 +466,15 @@ VIGRA_DEFINE_NORM(int) + VIGRA_DEFINE_NORM(unsigned int) + VIGRA_DEFINE_NORM(long) + VIGRA_DEFINE_NORM(unsigned long) ++#ifdef VIGRA_HAS_LONG_LONG ++VIGRA_DEFINE_NORM(long long) ++VIGRA_DEFINE_NORM(unsigned long long) ++#endif + VIGRA_DEFINE_NORM(float) + VIGRA_DEFINE_NORM(double) ++#ifdef VIGRA_HAS_LONG_DOUBLE + VIGRA_DEFINE_NORM(long double) ++#endif + + #undef VIGRA_DEFINE_NORM + +diff -uprN misc/vigra1.6.0/include/vigra/numerictraits.hxx misc/build/vigra1.6.0/include/vigra/numerictraits.hxx +--- misc/vigra1.6.0/include/vigra/numerictraits.hxx 2008-08-13 08:15:39.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/numerictraits.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -863,6 +863,90 @@ struct NumericTraits + } + }; + ++#ifdef VIGRA_HAS_LONG_LONG ++template<> ++struct NumericTraits ++{ ++ typedef long long Type; ++ typedef long long Promote; ++ typedef double RealPromote; ++ typedef std::complex ComplexPromote; ++ typedef Type ValueType; ++ ++ typedef VigraTrueType isIntegral; ++ typedef VigraTrueType isScalar; ++ typedef VigraTrueType isSigned; ++ typedef VigraTrueType isOrdered; ++ typedef VigraFalseType isComplex; ++ ++ static long long zero() { return 0; } ++ static long long one() { return 1; } ++ static long long nonZero() { return 1; } ++ static long long min() { return LLONG_MIN; } ++ static long long max() { return LLONG_MAX; } ++ ++#ifdef NO_INLINE_STATIC_CONST_DEFINITION ++ enum { minConst = LONG_MIN, maxConst = LLONG_MAX }; ++#else ++ static const long long minConst = LLONG_MIN; ++ static const long long maxConst = LLONG_MAX; ++#endif ++ ++ static Promote toPromote(long long v) { return v; } ++ static RealPromote toRealPromote(long long v) { return v; } ++ static long long fromPromote(Promote v) { return v; } ++ static long long fromRealPromote(RealPromote v) { ++ return ((v < 0.0) ++ ? ((v < (RealPromote)LLONG_MIN) ++ ? LLONG_MIN ++ : static_cast(v - 0.5)) ++ : ((v > (RealPromote)LLONG_MAX) ++ ? LLONG_MAX ++ : static_cast(v + 0.5))); ++ } ++}; ++ ++template<> ++struct NumericTraits ++{ ++ typedef unsigned long long Type; ++ typedef unsigned long long Promote; ++ typedef double RealPromote; ++ typedef std::complex ComplexPromote; ++ typedef Type ValueType; ++ ++ typedef VigraTrueType isIntegral; ++ typedef VigraTrueType isScalar; ++ typedef VigraFalseType isSigned; ++ typedef VigraTrueType isOrdered; ++ typedef VigraFalseType isComplex; ++ ++ static unsigned long long zero() { return 0; } ++ static unsigned long long one() { return 1; } ++ static unsigned long long nonZero() { return 1; } ++ static unsigned long long min() { return 0; } ++ static unsigned long long max() { return ULLONG_MAX; } ++ ++#ifdef NO_INLINE_STATIC_CONST_DEFINITION ++ enum { minConst = 0, maxConst = ULLONG_MAX }; ++#else ++ static const unsigned long long minConst = 0; ++ static const unsigned long long maxConst = ULLONG_MAX; ++#endif ++ ++ static Promote toPromote(unsigned long long v) { return v; } ++ static RealPromote toRealPromote(unsigned long long v) { return v; } ++ static unsigned long long fromPromote(Promote v) { return v; } ++ static unsigned long long fromRealPromote(RealPromote v) { ++ return ((v < 0.0) ++ ? 0 ++ : ((v > (RealPromote)ULLONG_MAX) ++ ? ULLONG_MAX ++ : static_cast(v + 0.5))); ++ } ++}; ++#endif ++ + template<> + struct NumericTraits + { +@@ -1050,6 +1134,7 @@ struct NumericTraits + static double fromRealPromote(RealPromote v) { return v; } + }; + ++#ifdef VIGRA_HAS_LONG_DOUBLE + template<> + struct NumericTraits + { +@@ -1079,6 +1164,7 @@ struct NumericTraits + static long double fromPromote(Promote v) { return v; } + static long double fromRealPromote(RealPromote v) { return v; } + }; ++#endif + + #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION + +@@ -1158,9 +1244,15 @@ VIGRA_DEFINE_NORM_TRAITS(int) + VIGRA_DEFINE_NORM_TRAITS(unsigned int) + VIGRA_DEFINE_NORM_TRAITS(long) + VIGRA_DEFINE_NORM_TRAITS(unsigned long) ++#ifdef VIGRA_HAS_LONG_LONG ++VIGRA_DEFINE_NORM_TRAITS(long long) ++VIGRA_DEFINE_NORM_TRAITS(unsigned long long) ++#endif + VIGRA_DEFINE_NORM_TRAITS(float) + VIGRA_DEFINE_NORM_TRAITS(double) ++#ifdef VIGRA_HAS_LONG_DOUBLE + VIGRA_DEFINE_NORM_TRAITS(long double) ++#endif + + #ifdef LLONG_MAX + VIGRA_DEFINE_NORM_TRAITS(long long) +diff -uprN misc/vigra1.6.0/include/vigra/orientedtensorfilters.hxx misc/build/vigra1.6.0/include/vigra/orientedtensorfilters.hxx +--- misc/vigra1.6.0/include/vigra/orientedtensorfilters.hxx 2008-08-13 08:15:40.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/orientedtensorfilters.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -435,7 +435,7 @@ class Sin6RingKernel + if(x == 0 && y == 0) + return weights_(radius_, radius_); + double d = dot(vectors_(x+radius_, y+radius_), v); +- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_); ++ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_); + } + }; + +@@ -456,7 +456,7 @@ class Sin6Kernel + if(x == 0 && y == 0) + return weights_(radius_, radius_); + double d = dot(vectors_(x+radius_, y+radius_), v); +- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_); ++ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_); + } + }; + +@@ -477,7 +477,7 @@ class Cos6RingKernel + if(x == 0 && y == 0) + return weights_(radius_, radius_); + double d = dot(vectors_(x+radius_, y+radius_), v); +- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_); ++ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_); + } + }; + +@@ -498,7 +498,7 @@ class Cos6Kernel + if(x == 0 && y == 0) + return weights_(radius_, radius_); + double d = dot(vectors_(x+radius_, y+radius_), v); +- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_); ++ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_); + } + }; + +diff -uprN misc/vigra1.6.0/include/vigra/polynomial.hxx misc/build/vigra1.6.0/include/vigra/polynomial.hxx +--- misc/vigra1.6.0/include/vigra/polynomial.hxx 2008-08-13 08:15:40.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/polynomial.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -119,10 +119,10 @@ class PolynomialView + of subsequent algorithms (especially root finding) performed on the + polynomial. + */ +- PolynomialView(T * coeffs, unsigned int order, double epsilon = 1.0e-14) ++ PolynomialView(T * coeffs, unsigned int ord, double eps = 1.0e-14) + : coeffs_(coeffs), +- order_(order), +- epsilon_(epsilon) ++ order_(ord), ++ epsilon_(eps) + {} + + /// Access the coefficient of x^i +@@ -245,16 +245,16 @@ class PolynomialView + { epsilon_ = eps; } + + protected: +- PolynomialView(double epsilon = 1e-14) ++ PolynomialView(double eps = 1e-14) + : coeffs_(0), + order_(0), +- epsilon_(epsilon) ++ epsilon_(eps) + {} + +- void setCoeffs(T * coeffs, unsigned int order) ++ void setCoeffs(T * coeffs, unsigned int ord) + { + coeffs_ = coeffs; +- order_ = order; ++ order_ = ord; + } + + T * coeffs_; +@@ -397,9 +397,9 @@ PolynomialView::deflateConjugatePair( + + template + void +-PolynomialView::minimizeOrder(double epsilon) ++PolynomialView::minimizeOrder(double eps) + { +- while(std::abs(coeffs_[order_]) <= epsilon && order_ > 0) ++ while(std::abs(coeffs_[order_]) <= eps && order_ > 0) + --order_; + } + +diff -uprN misc/vigra1.6.0/include/vigra/recursiveconvolution.hxx misc/build/vigra1.6.0/include/vigra/recursiveconvolution.hxx +--- misc/vigra1.6.0/include/vigra/recursiveconvolution.hxx 2008-08-13 08:15:40.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/recursiveconvolution.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -261,16 +261,16 @@ void recursiveFilterLine(SrcIterator is, + { + // correction factors for b + double bright = b; +- double bleft = VIGRA_CSTD::pow(b, w); ++ double bleft = VIGRA_CSTD::pow(b, (double)w); + + for(x=w-1; x>=0; --x, --is, --id) + { + TempType f = b * old; + old = as(is) + f; +- double norm = (1.0 - b) / (1.0 + b - bleft - bright); ++ double norm2 = (1.0 - b) / (1.0 + b - bleft - bright); + bleft /= b; + bright *= b; +- ad.set(norm * (line[x] + f), id); ++ ad.set(norm2 * (line[x] + f), id); + } + } + else if(border == BORDER_TREATMENT_AVOID) +diff -uprN misc/vigra1.6.0/include/vigra/rgbvalue.hxx misc/build/vigra1.6.0/include/vigra/rgbvalue.hxx +--- misc/vigra1.6.0/include/vigra/rgbvalue.hxx 2008-08-13 08:15:41.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/rgbvalue.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -39,6 +39,10 @@ + #ifndef VIGRA_RGBVALUE_HXX + #define VIGRA_RGBVALUE_HXX + ++#if defined __GNUC__ ++#pragma GCC system_header ++#endif ++ + #include // abs(double) + #include // abs(int) + #include "config.hxx" +@@ -702,8 +706,6 @@ operator/=(RGBValue + return l; + } + +-using VIGRA_CSTD::abs; +- + /// component-wise absolute value + template + inline +diff -uprN misc/vigra1.6.0/include/vigra/separableconvolution.hxx misc/build/vigra1.6.0/include/vigra/separableconvolution.hxx +--- misc/vigra1.6.0/include/vigra/separableconvolution.hxx 2008-08-13 08:15:41.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/separableconvolution.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -1022,11 +1022,11 @@ class Kernel1D + */ + InitProxy operator=(value_type const & v) + { +- int size = right_ - left_ + 1; ++ int sz = right_ - left_ + 1; + for(unsigned int i=0; i +-void Kernel1D::normalize(value_type norm, +- unsigned int derivativeOrder, ++void Kernel1D::normalize(value_type normFactor, ++ unsigned int derivOrder, + double offset) + { + typedef typename NumericTraits::RealPromote TmpType; +@@ -1673,7 +1673,7 @@ void Kernel1D::normalize(valu + Iterator k = kernel_.begin(); + TmpType sum = NumericTraits::zero(); + +- if(derivativeOrder == 0) ++ if(derivOrder == 0) + { + for(; k < kernel_.end(); ++k) + { +@@ -1683,11 +1683,11 @@ void Kernel1D::normalize(valu + else + { + unsigned int faculty = 1; +- for(unsigned int i = 2; i <= derivativeOrder; ++i) ++ for(unsigned int i = 2; i <= derivOrder; ++i) + faculty *= i; + for(double x = left() + offset; k < kernel_.end(); ++x, ++k) + { +- sum += *k * VIGRA_CSTD::pow(-x, int(derivativeOrder)) / faculty; ++ sum += *k * VIGRA_CSTD::pow(-x, (double)derivOrder) / faculty; + } + } + +@@ -1695,21 +1695,21 @@ void Kernel1D::normalize(valu + "Kernel1D::normalize(): " + "Cannot normalize a kernel with sum = 0"); + // normalize +- sum = norm / sum; ++ sum = normFactor / sum; + k = kernel_.begin(); + for(; k != kernel_.end(); ++k) + { + *k = *k * sum; + } + +- norm_ = norm; ++ norm_ = normFactor; + } + + /***********************************************************************/ + + template + void Kernel1D::initGaussian(double std_dev, +- value_type norm) ++ value_type normFactor) + { + vigra_precondition(std_dev >= 0.0, + "Kernel1D::initGaussian(): Standard deviation must be >= 0."); +@@ -1742,8 +1742,8 @@ void Kernel1D::initGaussian(d + right_ = 0; + } + +- if(norm != 0.0) +- normalize(norm); ++ if(normFactor != 0.0) ++ normalize(normFactor); + else + norm_ = 1.0; + +@@ -1755,7 +1755,7 @@ void Kernel1D::initGaussian(d + + template + void Kernel1D::initDiscreteGaussian(double std_dev, +- value_type norm) ++ value_type normFactor) + { + vigra_precondition(std_dev >= 0.0, + "Kernel1D::initDiscreteGaussian(): Standard deviation must be >= 0."); +@@ -1797,7 +1797,7 @@ void Kernel1D::initDiscreteGa + er += warray[i]; + } + +- double scale = norm / (2*er - warray[0]); ++ double scale = normFactor / (2*er - warray[0]); + + initExplicitly(-radius, radius); + iterator c = center(); +@@ -1810,12 +1810,12 @@ void Kernel1D::initDiscreteGa + else + { + kernel_.erase(kernel_.begin(), kernel_.end()); +- kernel_.push_back(norm); ++ kernel_.push_back(normFactor); + left_ = 0; + right_ = 0; + } + +- norm_ = norm; ++ norm_ = normFactor; + + // best border treatment for Gaussians is BORDER_TREATMENT_REFLECT + border_treatment_ = BORDER_TREATMENT_REFLECT; +@@ -1826,15 +1826,15 @@ void Kernel1D::initDiscreteGa + template + void + Kernel1D::initGaussianDerivative(double std_dev, +- int order, +- value_type norm) ++ int order, ++ value_type normFactor) + { + vigra_precondition(order >= 0, + "Kernel1D::initGaussianDerivative(): Order must be >= 0."); + + if(order == 0) + { +- initGaussian(std_dev, norm); ++ initGaussian(std_dev, normFactor); + return; + } + +@@ -1865,7 +1865,7 @@ Kernel1D::initGaussianDerivat + + // remove DC, but only if kernel correction is permitted by a non-zero + // value for norm +- if(norm != 0.0) ++ if(normFactor != 0.0) + { + for(unsigned int i=0; i < kernel_.size(); ++i) + { +@@ -1876,8 +1876,8 @@ Kernel1D::initGaussianDerivat + left_ = -radius; + right_ = radius; + +- if(norm != 0.0) +- normalize(norm, order); ++ if(normFactor != 0.0) ++ normalize(normFactor, order); + else + norm_ = 1.0; + +@@ -1891,7 +1891,7 @@ Kernel1D::initGaussianDerivat + template + void + Kernel1D::initBinomial(int radius, +- value_type norm) ++ value_type normFactor) + { + vigra_precondition(radius > 0, + "Kernel1D::initBinomial(): Radius must be > 0."); +@@ -1921,12 +1921,12 @@ Kernel1D::initBinomial(int ra + + for(i=0; i<=radius*2+1; ++i) + { +- kernel_.push_back(kernel[i] * norm); ++ kernel_.push_back(kernel[i] * normFactor); + } + + left_ = -radius; + right_ = radius; +- norm_ = norm; ++ norm_ = normFactor; + + // best border treatment for Binomial is BORDER_TREATMENT_REFLECT + border_treatment_ = BORDER_TREATMENT_REFLECT; +@@ -1936,7 +1936,7 @@ Kernel1D::initBinomial(int ra + + template + void Kernel1D::initAveraging(int radius, +- value_type norm) ++ value_type normFactor) + { + vigra_precondition(radius > 0, + "Kernel1D::initAveraging(): Radius must be > 0."); +@@ -1950,12 +1950,12 @@ void Kernel1D::initAveraging( + + for(int i=0; i<=radius*2+1; ++i) + { +- kernel_.push_back(scale * norm); ++ kernel_.push_back(scale * normFactor); + } + + left_ = -radius; + right_ = radius; +- norm_ = norm; ++ norm_ = normFactor; + + // best border treatment for Averaging is BORDER_TREATMENT_CLIP + border_treatment_ = BORDER_TREATMENT_CLIP; +diff -uprN misc/vigra1.6.0/include/vigra/sized_int.hxx misc/build/vigra1.6.0/include/vigra/sized_int.hxx +--- misc/vigra1.6.0/include/vigra/sized_int.hxx 2008-08-13 08:15:41.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/sized_int.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -73,11 +73,15 @@ struct SelectIntegerType + struct SelectBiggestIntegerType + { +- enum { cursize = LIST::size, +- nextsize = SelectBiggestIntegerType::size, ++ enum { cursize = static_cast< int >(LIST::size), ++ nextsize = static_cast< int >(SelectBiggestIntegerType::size), + size = (cursize < nextsize) ? nextsize : cursize }; + typedef typename + IfBool<(cursize < nextsize), +@@ -86,6 +90,10 @@ struct SelectBiggestIntegerType + type; + }; + ++#if defined __SUNPRO_CC ++#pragma enable_warn ++#endif ++ + template<> + struct SelectBiggestIntegerType + { +diff -uprN misc/vigra1.6.0/include/vigra/splines.hxx misc/build/vigra1.6.0/include/vigra/splines.hxx +--- misc/vigra1.6.0/include/vigra/splines.hxx 2008-08-13 08:15:41.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/splines.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -108,8 +108,8 @@ class BSplineBase + /** Create functor for gevine derivative of the spline. The spline's order + is specified spline by the template argument ORDER. + */ +- explicit BSplineBase(unsigned int derivativeOrder = 0) +- : s1_(derivativeOrder) ++ explicit BSplineBase(unsigned int derivOrder = 0) ++ : s1_(derivOrder) + {} + + /** Unary function call. +@@ -280,8 +280,8 @@ class BSplineBase<0, T> + typedef T result_type; + enum StaticOrder { order = 0 }; + +- explicit BSplineBase(unsigned int derivativeOrder = 0) +- : derivativeOrder_(derivativeOrder) ++ explicit BSplineBase(unsigned int derivOrder = 0) ++ : derivativeOrder_(derivOrder) + {} + + result_type operator()(argument_type x) const +@@ -357,8 +357,8 @@ class BSpline<1, T> + typedef T result_type; + enum StaticOrder { order = 1 }; + +- explicit BSpline(unsigned int derivativeOrder = 0) +- : derivativeOrder_(derivativeOrder) ++ explicit BSpline(unsigned int derivOrder = 0) ++ : derivativeOrder_(derivOrder) + {} + + result_type operator()(argument_type x) const +@@ -454,8 +454,8 @@ class BSpline<2, T> + typedef T result_type; + enum StaticOrder { order = 2 }; + +- explicit BSpline(unsigned int derivativeOrder = 0) +- : derivativeOrder_(derivativeOrder) ++ explicit BSpline(unsigned int derivOrder = 0) ++ : derivativeOrder_(derivOrder) + {} + + result_type operator()(argument_type x) const +@@ -583,8 +583,8 @@ class BSpline<3, T> + typedef T result_type; + enum StaticOrder { order = 3 }; + +- explicit BSpline(unsigned int derivativeOrder = 0) +- : derivativeOrder_(derivativeOrder) ++ explicit BSpline(unsigned int derivOrder = 0) ++ : derivativeOrder_(derivOrder) + {} + + result_type operator()(argument_type x) const +@@ -735,8 +735,8 @@ class BSpline<4, T> + typedef T result_type; + enum StaticOrder { order = 4 }; + +- explicit BSpline(unsigned int derivativeOrder = 0) +- : derivativeOrder_(derivativeOrder) ++ explicit BSpline(unsigned int derivOrder = 0) ++ : derivativeOrder_(derivOrder) + {} + + result_type operator()(argument_type x) const +diff -uprN misc/vigra1.6.0/include/vigra/static_assert.hxx misc/build/vigra1.6.0/include/vigra/static_assert.hxx +--- misc/vigra1.6.0/include/vigra/static_assert.hxx 2008-08-13 08:15:41.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/static_assert.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -115,7 +115,7 @@ assertImpl( void (*)(Predicate), typenam + + TODO: provide more assertion base classes for other (non boolean) types of tests + */ +-#if !defined(__GNUC__) || __GNUC__ > 2 ++#if (!defined(__GNUC__) || __GNUC__ > 2) && (!defined(__SUNPRO_CC) || __SUNPRO_CC > 0x550) + #define VIGRA_STATIC_ASSERT(Predicate) \ + enum { \ + VIGRA_PREPROCESSOR_CONCATENATE(vigra_assertion_in_line_, __LINE__) = sizeof( \ +diff -uprN misc/vigra1.6.0/include/vigra/tinyvector.hxx misc/build/vigra1.6.0/include/vigra/tinyvector.hxx +--- misc/vigra1.6.0/include/vigra/tinyvector.hxx 2008-08-13 08:15:42.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/tinyvector.hxx 2012-09-19 17:30:24.000000000 -0500 +@@ -39,6 +39,10 @@ + #ifndef VIGRA_TINYVECTOR_HXX + #define VIGRA_TINYVECTOR_HXX + ++#if defined __GNUC__ ++#pragma GCC system_header ++#endif ++ + #include // abs(double) + #include // abs(int) + #include // ostream +@@ -49,7 +53,6 @@ + + namespace vigra { + +-using VIGRA_CSTD::abs; + using VIGRA_CSTD::ceil; + using VIGRA_CSTD::floor; + +@@ -439,9 +442,9 @@ class TinyVectorBase + /** Initialize from another sequence (must have length SIZE!) + */ + template +- void init(Iterator i, Iterator end) ++ void init(Iterator i, Iterator iend) + { +- vigra_precondition(end-i == SIZE, ++ vigra_precondition(iend-i == SIZE, + "TinyVector::init(): Sequence has wrong size."); + Loop::assignCast(data_, i); + } -- cgit