[yade] 01/02: Fix FTBFS on 32-bit platforms.

Anton Gladky gladk at moszumanska.debian.org
Mon Sep 1 17:14:52 UTC 2014


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

gladk pushed a commit to branch master
in repository yade.

commit 6a919b153095212fa18ead9efd3cd261d35b787e
Author: Anton Gladky <gladk at debian.org>
Date:   Mon Sep 1 17:46:49 2014 +0200

    Fix FTBFS on 32-bit platforms.
---
 debian/patches/03_fix_i386_segfault.patch | 32 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 2 files changed, 33 insertions(+)

diff --git a/debian/patches/03_fix_i386_segfault.patch b/debian/patches/03_fix_i386_segfault.patch
new file mode 100644
index 0000000..64f430a
--- /dev/null
+++ b/debian/patches/03_fix_i386_segfault.patch
@@ -0,0 +1,32 @@
+From 538d320f9a25b399ae6a19ba0c5517a0ec8c5bcf Mon Sep 17 00:00:00 2001
+From: Anton Gladky <gladky.anton at gmail.com>
+Date: Sun, 31 Aug 2014 11:48:55 +0200
+Subject: [PATCH] Create an array of clump`s memberIds to remove.
+
+During the clump removal with all its members
+there is a situtation on 32-bit platforms, that
+the memberId is not defined correctly after one
+of clump member is already removed.
+
+Create a "static" array of all ids and iterate
+over them.
+---
+ core/BodyContainer.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/core/BodyContainer.cpp b/core/BodyContainer.cpp
+index 2d9c2a6..2edaa66 100644
+--- a/core/BodyContainer.cpp
++++ b/core/BodyContainer.cpp
+@@ -41,8 +41,9 @@ bool BodyContainer::erase(Body::id_t id, bool eraseClumpMembers){//default is fa
+ 		//erase all members if eraseClumpMembers is true:
+ 		const shared_ptr<Clump>& clump=YADE_PTR_CAST<Clump>(b->shape);
+ 		std::map<Body::id_t,Se3r>& members = clump->members;
+-		FOREACH(MemberMap::value_type& mm, members){
+-			const Body::id_t& memberId=mm.first;
++		std::vector<Body::id_t> idsToRemove;
++		FOREACH(MemberMap::value_type mm, members) idsToRemove.push_back(mm.first); // Prepare an array of ids, which need to be removed.
++		FOREACH(Body::id_t memberId, idsToRemove){
+ 			if (eraseClumpMembers) {
+ 				this->erase(memberId,false);	// erase members
+ 			} else {
diff --git a/debian/patches/series b/debian/patches/series
index b4e6505..bc59805 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_remove_google_analytics.patch
+03_fix_i386_segfault.patch

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



More information about the debian-science-commits mailing list