[odb-api] 02/08: * Disable duplicate method in DenseMap that breaks build on 32-bit systems Closes: #880966 * Add namespace to swap call on big-endian systems. Closes: #880968

Alastair McKinstry mckinstry at moszumanska.debian.org
Sat Nov 11 09:33:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository odb-api.

commit 2ccbb5367390ea27fbdbeac936032fcf4965a478
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon Nov 6 17:40:40 2017 +0000

    * Disable duplicate method in DenseMap that breaks build on 32-bit systems
      Closes:  #880966
    * Add namespace to swap call on big-endian systems. Closes: #880968
---
 debian/changelog                  |  3 +++
 debian/patches/series             |  2 ++
 debian/patches/size_t_32bit.patch | 36 ++++++++++++++++++++++++++++++++++++
 debian/patches/swap_decl.patch    | 19 +++++++++++++++++++
 4 files changed, 60 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8acdd56..ae1a5c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ odb-api (0.17.4-2) UNRELEASED; urgency=medium
   * Delete ecbuild configuartion info from include files that break
     multi-arch usability and reproducibility
   * Rename odb -> ecmwf_odb to avoid conflict. Closes: #880890
+  * Disable duplicate method in DenseMap that breaks build on 32-bit systems
+    Closes:  #880966
+  * Add namespace to swap call on big-endian systems. Closes: #880968
 
  -- Alastair McKinstry <mckinstry at debian.org>  Sun, 05 Nov 2017 16:22:05 +0000
 
diff --git a/debian/patches/series b/debian/patches/series
index 86351d2..f62725b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,5 @@ shared_lib.patch
 python3.patch
 unsigned-long-on-32bit.patch
 py3-port.patch
+size_t_32bit.patch
+swap_decl.patch
diff --git a/debian/patches/size_t_32bit.patch b/debian/patches/size_t_32bit.patch
new file mode 100644
index 0000000..7e3f94b
--- /dev/null
+++ b/debian/patches/size_t_32bit.patch
@@ -0,0 +1,36 @@
+Description: Drop duplicate method that causes FTBFS on 32-bit systems
+ Also, need to cast a long in call to std::min on 32-bit systems too
+Author: Alastair McKinstry <mckinstry at debian.org>
+Bug-Origin: https://bugs.debian.org/880966
+Last-Updated: 2017-11-06
+Forwarded: no
+
+Index: odb-api-0.17.4/eckit/src/eckit/container/DenseMap.h
+===================================================================
+--- odb-api-0.17.4.orig/eckit/src/eckit/container/DenseMap.h
++++ odb-api-0.17.4/eckit/src/eckit/container/DenseMap.h
+@@ -138,8 +138,9 @@ public: // methods
+ 	const V& at( const size_t i ) const { ASSERT(i < keys_.size()); return values_[ keys_[i].idx() ]; }
+ 	V& at( const size_t i ) { ASSERT(i < keys_.size()); return values_[ i ]; }
+ 
+-	const V& operator[] (const K& k ) const { return values_[ find(k)->idx() ]; }
+-	V& operator[] (const K& k ) { return values_[ find(k)->idx() ]; }
++	// Dup of size_t below on 32-bit systems. Can it be removed?
++	//const V& operator[] (const K& k ) const { return values_[ find(k)->idx() ]; }
++	//V& operator[] (const K& k ) { return values_[ find(k)->idx() ]; }
+ 
+ 	const V& operator[] (const size_t& i ) const { ASSERT(i < values_.size()); return values_[ i ]; }
+ 	V& operator[] (const size_t& i ) { ASSERT(i < keys_.size()); return values_[ i ]; }
+Index: odb-api-0.17.4/odb_api/src/odb_api/TReadOnlyMemoryDataHandle.h
+===================================================================
+--- odb-api-0.17.4.orig/odb_api/src/odb_api/TReadOnlyMemoryDataHandle.h
++++ odb-api-0.17.4/odb_api/src/odb_api/TReadOnlyMemoryDataHandle.h
+@@ -79,7 +79,7 @@ public:
+ //            dst[i] = *it_;
+ //        return i;
+ 
+-        long len = std::min(n, end_ - it_);
++	  long len = std::min(n, long(end_ - it_));
+         ::memcpy(p, it_, len);
+         it_ += len;
+         return len;
diff --git a/debian/patches/swap_decl.patch b/debian/patches/swap_decl.patch
new file mode 100644
index 0000000..92958a1
--- /dev/null
+++ b/debian/patches/swap_decl.patch
@@ -0,0 +1,19 @@
+Description: Need to add a namespace for swap for big-endian  systems
+Bug-Origin: http://bugs.debian.org/880968
+Author: Alastair McKinstry <mckinstry at debian.org>
+Last-Updated: 2017-11-06
+Forwarded: no
+
+Index: odb-api-0.17.4/odb_api/tests/core/test_select_iterator.cc
+===================================================================
+--- odb-api-0.17.4.orig/odb_api/tests/core/test_select_iterator.cc
++++ odb-api-0.17.4/odb_api/tests/core/test_select_iterator.cc
+@@ -154,7 +154,7 @@ CASE("Test bugfix 01, quote <<UnitTest p
+     for (int i = 0; i < sizeof(REF_DATA) / 8; i++)
+     {
+         for (int j = 0; j < 4; j++)
+-            swap(REF_DATA[i * 8 + j], REF_DATA[(i + 1) * 8 - 1 - j]);
++	  std::swap(REF_DATA[i * 8 + j], REF_DATA[(i + 1) * 8 - 1 - j]);
+         //cout << *(reinterpret_cast<double *>(&REF_DATA[i * 8])) << std::endl;
+     }
+ #endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/odb-api.git



More information about the debian-science-commits mailing list