Control: tags 857067 + patch

Dear maintainer,

I've prepared an NMU for dsdp (versioned as 5.8-9.4). The diff
is attached to this message.

Regards,
James
diff -Nru dsdp-5.8/debian/changelog dsdp-5.8/debian/changelog
--- dsdp-5.8/debian/changelog	2017-03-28 16:40:25.000000000 +0100
+++ dsdp-5.8/debian/changelog	2017-03-28 18:22:35.000000000 +0100
@@ -1,3 +1,13 @@
+dsdp (5.8-9.4) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Revert previous patches in 5.8-9.2 and 5.8-9.3, they are completely wrong
+    and end up causing *flags to always be 0 on 64-bit big-endian systems.
+  * Use correct integer type for Fortran prototypes and variables
+    (Closes: #857067)
+
+ -- James Clarke <jrt...@debian.org>  Tue, 28 Mar 2017 18:22:35 +0100
+
 dsdp (5.8-9.3) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru dsdp-5.8/debian/patches/type-mismatch.patch dsdp-5.8/debian/patches/type-mismatch.patch
--- dsdp-5.8/debian/patches/type-mismatch.patch	2017-03-28 16:26:15.000000000 +0100
+++ dsdp-5.8/debian/patches/type-mismatch.patch	2017-03-28 18:20:40.000000000 +0100
@@ -1,42 +1,39 @@
-Description: Cast INFO to int before storing it in the flag
-Author: Dimitri John Ledkov <x...@ubuntu.com>
-Bug-Ubuntu: https://bugs.launchpad.net/bugs/1543982
-
---- dsdp-5.8.orig/src/vecmat/dlpack.c
-+++ dsdp-5.8/src/vecmat/dlpack.c
-@@ -97,7 +97,7 @@
+Description: Use correct integer type for Fortran prototypes and variables
+ GNU Fortran's default integer width is 32-bit, the same as GCC, therefore use
+ int rather than long int when interfacing with Fortran. This was an issue on
+ 64-bit big-endian systems, since the upper 32 bits of the long would be set,
+ which would also be lost when truncating to a 32-bit integer.
+Author: James Clarke <jrt...@debian.org>
+Bug-Debian: https://bugs.debian.org/857067
+Last-Update: 2017-03-28
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/include/dsdplapack.h
++++ b/include/dsdplapack.h
+@@ -4,11 +4,11 @@
+ \file dsdplapack.h
+ \brief DSDP uses BLAS and LAPACK for many of its operations.
+ */
+-
+-typedef long int ffinteger;
+ /*
+-typedef int ffinteger;
++typedef long int ffinteger;
+ */
++typedef int ffinteger;
++
+ /*
+ #define  __DSDP_NONAMEMANGLING
+ #undef  __DSDP_NONAMEMANGLING
+--- a/src/vecmat/dtrsm2.c
++++ b/src/vecmat/dtrsm2.c
+@@ -1,7 +1,7 @@
+ #include "dsdplapack.h"
  
- static int DTPUMatSolve(void* AA, double b[], double x[], int n){
-   dtpumat* A=(dtpumat*) AA;
--  ffinteger INFO,NRHS=1,LDB=A->n,N=A->n;
-+  ffinteger INFO=0,NRHS=1,LDB=A->n,N=A->n;
-   double *AP=A->val,*ss=A->sscale;
-   char UPLO=A->UPLO;
+-typedef long int integer;
+-typedef long int logical;
++typedef int integer;
++typedef int logical;
  
-@@ -111,7 +111,7 @@
- static int DTPUMatCholeskyFactor(void* AA, int *flag){
-   dtpumat* A=(dtpumat*) AA;
-   int i;
--  ffinteger INFO,LDA=1,N=A->n;
-+  ffinteger INFO=0,LDA=1,N=A->n;
-   double *AP=A->val,*ss=A->sscale,*v;
-   char UPLO=A->UPLO;
- 
-@@ -123,7 +123,7 @@
-     dtpuscalemat(AP,ss,N);
-   }
-   dpptrf(&UPLO, &N, AP, &INFO );
--  *flag=INFO;
-+  *flag=(int) INFO;
-   return 0;
- }
-
-@@ -370,7 +370,7 @@
- 
- static int DTPUMatInvert(void* AA){
-   dtpumat* A=(dtpumat*) AA;
--  ffinteger INFO,N=A->n,nn=N*(N+1)/2;
-+  ffinteger INFO=0,N=A->n,nn=N*(N+1)/2;
-   double *v=A->val,*AP=A->v2,*ss=A->sscale;
-   char UPLO=A->UPLO;
-   memcpy((void*)AP,(void*)v,nn*sizeof(double));
+ #define max(a,b) ((a) >= (b) ? (a) : (b))
+ #define dmax(a,b) (double)max(a,b)

Reply via email to