[pktools] 01/01: Add a patch by Christian Kastner from libfann fixing the va_list issue on arm*.

Bas Couwenberg sebastic at xs4all.nl
Wed Aug 13 13:03:34 UTC 2014


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

sebastic-guest pushed a commit to branch master
in repository pktools.

commit e6f4789d36f9d8278b329c92d5cfa676d06bdd46
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Aug 13 14:51:26 2014 +0200

    Add a patch by Christian Kastner from libfann fixing the va_list issue on arm*.
    
    Thanks Gilles Filippini for pointing out the patch.
---
 debian/changelog                  |  3 ++
 debian/patches/fann-va_list.patch | 59 +++++++++++++++++++++++++++++++++++++++
 debian/patches/series             |  1 +
 3 files changed, 63 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 71956d7..c52beb4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ pktools (2.5.3-1) UNRELEASED; urgency=medium
   * Update copyright file.
   * Remove latest_libLAS_support.patch, included upstream.
   * Remove bandwidth-typo.patch, applied upstream.
+  * Add a patch by Christian Kastner from libfann fixing the va_list issue on
+    arm*. Thanks Gilles Filippini for pointing out the patch.
+    (closes: #757979)
 
  -- Bas Couwenberg <sebastic at xs4all.nl>  Tue, 12 Aug 2014 13:28:30 +0200
 
diff --git a/debian/patches/fann-va_list.patch b/debian/patches/fann-va_list.patch
new file mode 100644
index 0000000..423eab0
--- /dev/null
+++ b/debian/patches/fann-va_list.patch
@@ -0,0 +1,59 @@
+Description: Portable handling for va_list
+ This patch is taken from libfann:
+ http://sources.debian.net/src/libfann/2.1.0~beta~dfsg-10/debian/patches/0004-Portable-handling-for-va_list.patch/
+ .
+ The current code wrongly assumes va_list is always implemented as an array.
+ va_list however is an opaque type, and may also be implemented as a struct,
+ for example.
+ This patch implements handling of va_list in a platform-independent way,
+ fixing a FTBFS on alpha and armel.
+Author: Christian Kastner <debian at kvr.at>
+Bug-Debian: https://bugs.debian.org/757979
+
+--- a/src/algorithms/myfann_cpp.h
++++ b/src/algorithms/myfann_cpp.h
+@@ -1061,9 +1061,12 @@ public:
+         bool create_standard(unsigned int num_layers, ...)
+         {
+             va_list layers;
++            unsigned int arr[num_layers];
++
+             va_start(layers, num_layers);
+-            bool status = create_standard_array(num_layers,
+-                reinterpret_cast<const unsigned int *>(layers));
++            for (unsigned int ii = 0; ii < num_layers; ii++)
++                arr[ii] = va_arg(layers, unsigned int);
++            bool status = create_standard_array(num_layers, arr);
+             va_end(layers);
+             return status;
+         }
+@@ -1111,9 +1114,12 @@ public:
+         bool create_sparse(float connection_rate, unsigned int num_layers, ...)
+         {
+             va_list layers;
++            unsigned int arr[num_layers];
++
+             va_start(layers, num_layers);
+-            bool status = create_sparse_array(connection_rate, num_layers,
+-                reinterpret_cast<const unsigned int *>(layers));
++            for (unsigned int ii = 0; ii < num_layers; ii++)
++                arr[ii] = va_arg(layers, unsigned int);
++            bool status = create_sparse_array(connection_rate, num_layers, arr);
+             va_end(layers);
+             return status;
+         }
+@@ -1158,9 +1164,12 @@ public:
+         bool create_shortcut(unsigned int num_layers, ...)
+         {
+             va_list layers;
++            unsigned int arr[num_layers];
++
+             va_start(layers, num_layers);
+-            bool status = create_shortcut_array(num_layers,
+-                reinterpret_cast<const unsigned int *>(layers));
++            for (unsigned int ii = 0; ii < num_layers; ii++)
++                arr[ii] = va_arg(layers, unsigned int);
++            bool status = create_shortcut_array(num_layers, arr);
+             va_end(layers);
+             return status;
+         }
diff --git a/debian/patches/series b/debian/patches/series
index e9e0975..20d56f7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 automake-subdir-objects.patch
+fann-va_list.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list