[Python-modules-commits] r21243 - in packages/gamera/trunk/debian (3 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Mon Apr 16 17:59:21 UTC 2012


    Date: Monday, April 16, 2012 @ 17:59:20
  Author: jwilk
Revision: 21243

Cherry-pick upstream patch to fix compatibility with GCC 4.7.

Added:
  packages/gamera/trunk/debian/patches/gcc-4.7-compat.diff
Modified:
  packages/gamera/trunk/debian/changelog
  packages/gamera/trunk/debian/patches/series

Modified: packages/gamera/trunk/debian/changelog
===================================================================
--- packages/gamera/trunk/debian/changelog	2012-04-16 17:49:25 UTC (rev 21242)
+++ packages/gamera/trunk/debian/changelog	2012-04-16 17:59:20 UTC (rev 21243)
@@ -11,8 +11,10 @@
       (nosetests.diff)
     + Build-depend on python-nose instead of python-py.
     + Update the patch running script.
+  * Cherry-pick upstream patch to fix compatibility with GCC 4.7.
+    (gcc-4.7-compat.diff)
 
- -- Jakub Wilk <jwilk at debian.org>  Mon, 16 Apr 2012 19:12:02 +0200
+ -- Jakub Wilk <jwilk at debian.org>  Mon, 16 Apr 2012 19:56:29 +0200
 
 gamera (3.3.2-2) unstable; urgency=low
 

Added: packages/gamera/trunk/debian/patches/gcc-4.7-compat.diff
===================================================================
--- packages/gamera/trunk/debian/patches/gcc-4.7-compat.diff	                        (rev 0)
+++ packages/gamera/trunk/debian/patches/gcc-4.7-compat.diff	2012-04-16 17:59:20 UTC (rev 21243)
@@ -0,0 +1,222 @@
+Description: fix compatiblity with GCC 4.7
+Origin: upstream, http://gamera.svn.sourceforge.net/viewvc/gamera?revision=1335&view=revision
+Last-Update: 2012-04-16
+
+--- a/include/pixel.hpp
++++ b/include/pixel.hpp
+@@ -194,17 +194,17 @@
+ 
+     /// Set the red component to the passed in value.
+     void red(T v) {
+-      setRed(v);
++      this->setRed(v);
+     }
+ 
+     /// Set the green component to the passed in value.
+     void green(T v) {
+-      setGreen(v);
++      this->setGreen(v);
+     }
+ 
+     /// Set the blue component to the passed in value.
+     void blue(T v) {
+-      setBlue(v);
++      this->setBlue(v);
+     }
+ 
+     /// Retrieve the red component - the returned value is an lvalue.
+--- a/include/plugins/deformations.hpp
++++ b/include/plugins/deformations.hpp
+@@ -58,6 +58,46 @@
+   return T(((pix1 * w1) + (pix2 * w2))/(w1 + w2));
+ }
+ 
++inline void filterfunc(RGBPixel &p0, RGBPixel &p1, RGBPixel &oldPixel, RGBPixel origPixel, double &weight) {
++  p0 = origPixel;
++  p1 = RGBPixel(  GreyScalePixel(p0.red() * weight),
++		  GreyScalePixel(p0.green() * weight),
++		  GreyScalePixel(p0.blue() * weight));
++  p0 = RGBPixel(  GreyScalePixel(p0.red() - p1.red() + oldPixel.red()),
++		  GreyScalePixel(p0.green() - p1.green() + oldPixel.green()),
++		  GreyScalePixel(p0.blue() - p1.blue() + oldPixel.blue()));
++  oldPixel = p1;
++}
++
++template<class T>
++inline void filterfunc(T &p0, T &p1, T &oldPixel, T origPixel, double & weight)
++{
++  p0 = origPixel;
++  p1 = (T)(p0 * weight);
++  p0 -= (T)(p1 - oldPixel);
++  oldPixel = p1;
++}
++
++/*
++ * borderfunc
++ *
++ * Corrects the alpha blending of border pixels.
++ *
++ * p0 - Value 1
++ * p1 - Value 2
++ * oldPixel - Value3
++ * origPixel - Pixel that comes from the source
++ * weight - The weight given to the filter
++ * bgcolor - The background color
++ *
++ */
++template<class T>
++inline void borderfunc(T& p0, T& p1, T& oldPixel, T origPixel, double& weight, T bgcolor)
++{
++  filterfunc(p0, p1, oldPixel, origPixel, weight);
++  p0 = norm_weight_avg(bgcolor, origPixel, weight, 1.0-weight);
++}
++
+ /*
+  *  shear_x
+  *  Shears the image horizontally with a shear angle in degrees.
+@@ -75,7 +115,6 @@
+  *
+  *    diff: Correction factor for negative shear values.
+  */
+-
+ template<class T, class U>
+ void shear_x(const T &orig, U &newbmp, size_t &row, size_t shiftAmount, typename T::value_type bgcolor, double weight, size_t diff=0)
+ {
+@@ -176,46 +215,6 @@
+ 
+ 
+ 
+-inline void filterfunc(RGBPixel &p0, RGBPixel &p1, RGBPixel &oldPixel, RGBPixel origPixel, double &weight) {
+-  p0 = origPixel;
+-  p1 = RGBPixel(  GreyScalePixel(p0.red() * weight),
+-		  GreyScalePixel(p0.green() * weight),
+-		  GreyScalePixel(p0.blue() * weight));
+-  p0 = RGBPixel(  GreyScalePixel(p0.red() - p1.red() + oldPixel.red()),
+-		  GreyScalePixel(p0.green() - p1.green() + oldPixel.green()),
+-		  GreyScalePixel(p0.blue() - p1.blue() + oldPixel.blue()));
+-  oldPixel = p1;
+-}
+-
+-template<class T>
+-inline void filterfunc(T &p0, T &p1, T &oldPixel, T origPixel, double & weight)
+-{
+-  p0 = origPixel;
+-  p1 = (T)(p0 * weight);
+-  p0 -= (T)(p1 - oldPixel);
+-  oldPixel = p1;
+-}
+-
+-
+-/*
+- * borderfunc
+- *
+- * Corrects the alpha blending of border pixels.
+- *
+- * p0 - Value 1
+- * p1 - Value 2
+- * oldPixel - Value3
+- * origPixel - Pixel that comes from the source
+- * weight - The weight given to the filter
+- * bgcolor - The background color
+- *
+- */
+-template<class T>
+-inline void borderfunc(T& p0, T& p1, T& oldPixel, T origPixel, double& weight, T bgcolor)
+-{
+-  filterfunc(p0, p1, oldPixel, origPixel, weight);
+-  p0 = norm_weight_avg(bgcolor, origPixel, weight, 1.0-weight);
+-}
+ 
+ inline double sin2(float per, int n)
+ {
+--- a/include/plugins/image_utilities.hpp
++++ b/include/plugins/image_utilities.hpp
+@@ -298,6 +298,18 @@
+   // TODO: Test this
+ 
+   template<class T>
++  void _my_max(const T& a, T& b) {
++    if (a > b)
++      b = a;
++  }
++
++  template<>
++  void _my_max(const ComplexPixel& a, ComplexPixel& b) {
++    if (a.real() > b.real())
++      b = a;
++  }
++  
++  template<class T>
+   typename T::value_type find_max(const T& image) {
+     if (image.nrows() <= 1 || image.ncols() <= 1)
+       throw std::range_error("Image must have nrows and ncols > 0.");
+@@ -309,13 +321,13 @@
+   }
+   
+   template<class T>
+-  void _my_max(const T& a, T& b) {
+-    if (a > b)
++  void _my_min(const T& a, T& b) {
++    if (b > a)
+       b = a;
+   }
+ 
+   template<>
+-  void _my_max(const ComplexPixel& a, ComplexPixel& b) {
++  void _my_min(const ComplexPixel& a, ComplexPixel& b) {
+     if (a.real() > b.real())
+       b = a;
+   }
+@@ -331,17 +343,6 @@
+     return value;
+   }
+   
+-  template<class T>
+-  void _my_min(const T& a, T& b) {
+-    if (b > a)
+-      b = a;
+-  }
+-
+-  template<>
+-  void _my_min(const ComplexPixel& a, ComplexPixel& b) {
+-    if (a.real() > b.real())
+-      b = a;
+-  }
+ 
+   /*
+     Fill an image with white.
+--- a/include/region.hpp
++++ b/include/region.hpp
+@@ -129,7 +129,7 @@
+     RegionMapTemplate() : std::list<region_type>(0) { }
+     virtual ~RegionMapTemplate() { }
+     void add_region(const region_type& x) {
+-      push_back(x);
++      this->push_back(x);
+     }
+     virtual region_type lookup(const rect_t& r) {
+       typename self::iterator answer =
+--- a/include/vigra/README
++++ b/include/vigra/README
+@@ -39,4 +39,8 @@
+      has been taken from the development branch of VIGRA,
+      to avoid rounding errors for exact rotations in rotateImage()
+ 
++ - sized_int.hxx
++     fix for gcc 4.7. This change is already included in the
++     development branch of VIGRA
++
+ Christoph Dalitz
+--- a/include/vigra/sized_int.hxx
++++ b/include/vigra/sized_int.hxx
+@@ -76,8 +76,8 @@
+ template<class LIST>
+ struct SelectBiggestIntegerType
+ {
+-    enum { cursize = LIST::size, 
+-           nextsize = SelectBiggestIntegerType<typename LIST::next>::size,
++    enum { cursize = static_cast<int>(LIST::size),
++           nextsize = static_cast<int>(SelectBiggestIntegerType<typename LIST::next>::size),
+            size = (cursize < nextsize) ? nextsize : cursize };
+     typedef typename 
+        IfBool<(cursize < nextsize), 

Modified: packages/gamera/trunk/debian/patches/series
===================================================================
--- packages/gamera/trunk/debian/patches/series	2012-04-16 17:49:25 UTC (rev 21242)
+++ packages/gamera/trunk/debian/patches/series	2012-04-16 17:59:20 UTC (rev 21243)
@@ -8,3 +8,4 @@
 namespace-package.diff
 graphmodule-fix-type-mismatch.diff
 nosetests.diff
+gcc-4.7-compat.diff




More information about the Python-modules-commits mailing list