[yoda-svn] yoda: 2 new changesets

YODA Mercurial yoda at projects.hepforge.org
Thu Nov 5 12:15:01 GMT 2015


details:   https://yoda.hepforge.org/hg/yoda/rev/7b8fb0593b57
branches:  
changeset: 1169:7b8fb0593b57
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Nov 05 11:31:19 2015 +0000
description:
Sort out problems with static const variables computed from numeric_limits, which were still warned about by GCC5

details:   https://yoda.hepforge.org/hg/yoda/rev/854737a235ca
branches:  
changeset: 1170:854737a235ca
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Nov 05 12:08:41 2015 +0000
description:
Fix double-dealloc in new Point class hierarchy Python mapping.

diffs (truncated from 72 to 50 lines):

--- a/ChangeLog	Mon Oct 26 17:52:57 2015 +0000
+++ b/ChangeLog	Thu Nov 05 12:08:41 2015 +0000
@@ -1,3 +1,7 @@
+2015-11-05  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Fix double-dealloc in new Point class hierarchy Python mapping.
+
 2015-10-23  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Make the version() function inline, and the numerical constants static.
--- a/include/YODA/Utils/MathUtils.h	Mon Oct 26 17:52:57 2015 +0000
+++ b/include/YODA/Utils/MathUtils.h	Thu Nov 05 12:08:41 2015 +0000
@@ -23,12 +23,15 @@
 #include <numeric>
 #include <cassert>
 #include <limits>
+#include <cfloat>
 
 namespace YODA {
 
 
-  static const double MAXDOUBLE = std::numeric_limits<double>::max();
-  static const double MAXINT = std::numeric_limits<int>::max();
+  /// Pre-defined numeric type limits
+  /// @deprecated Prefer the standard DBL/INT_MAX
+  const static double MAXDOUBLE = DBL_MAX; // was std::numeric_limits<double>::max(); -- warns in GCC5
+  const static double MAXINT = INT_MAX; // was std::numeric_limits<int>::max(); -- warns in GCC5
 
   /// A pre-defined value of \f$ \pi \f$.
   static const double PI = M_PI;
--- a/pyext/yoda/include/Point1D.pyx	Mon Oct 26 17:52:57 2015 +0000
+++ b/pyext/yoda/include/Point1D.pyx	Thu Nov 05 12:08:41 2015 +0000
@@ -6,11 +6,6 @@
     cdef c.Point1D* p1ptr(self) except NULL:
         return <c.Point1D*> self.ptr()
 
-    def __dealloc__(self):
-        cdef c.Point1D *p = self.p1ptr()
-        if self._deallocate:
-            del p
-
 
     def __init__(self, x=0, xerrs=0):
         cutil.set_owned_ptr(self, new c.Point1D())
--- a/pyext/yoda/include/Point2D.pyx	Mon Oct 26 17:52:57 2015 +0000
+++ b/pyext/yoda/include/Point2D.pyx	Thu Nov 05 12:08:41 2015 +0000
@@ -6,11 +6,6 @@
     cdef c.Point2D* p2ptr(self) except NULL:
         return <c.Point2D*> self.ptr()
 


More information about the yoda-svn mailing list