[med-svn] [rnahybrid] 01/01: Fix issues that are becoming visible on arm but might be a problem on all architectures

Andreas Tille tille at debian.org
Tue Sep 26 16:31:26 UTC 2017


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

tille pushed a commit to branch master
in repository rnahybrid.

commit fcadacac2f2abdfb3703212eccb4122eb0940242
Author: Andreas Tille <tille at debian.org>
Date:   Tue Sep 26 18:31:17 2017 +0200

    Fix issues that are becoming visible on arm but might be a problem on all architectures
---
 debian/changelog                    |   4 +
 debian/patches/fix_loop_index.patch |  34 ++++++
 debian/patches/fix_warnings.patch   | 206 ++++++++++++++++++++++++++++++++++++
 debian/patches/series               |   2 +
 4 files changed, 246 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index df93ea0..60c25d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,10 @@ rnahybrid (2.1.2-2) UNRELEASED; urgency=medium
   * Moved packaging to Git
   * debhelper 10
   * Standards-Version: 4.1.0 (no changes needed)
+  * Fix issues that are becoming visible on arm but might be
+    a problem on all architectures (Thanks to Lennart Sorensen
+    <lsorense at csclub.uwaterloo.ca> for the patch)
+    Closes: #861281
 
  -- Andreas Tille <tille at debian.org>  Tue, 26 Sep 2017 18:20:07 +0200
 
diff --git a/debian/patches/fix_loop_index.patch b/debian/patches/fix_loop_index.patch
new file mode 100644
index 0000000..84078d4
--- /dev/null
+++ b/debian/patches/fix_loop_index.patch
@@ -0,0 +1,34 @@
+Author: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
+Last-Update: Tue, 26 Sep 2017 11:10:04 -0400
+Bug-Debian: https://bugs.debian.org/861281
+Description: Fix issues that are becoming visible on arm but might be
+ a problem on all architectures.
+ .
+ Is it because of this:
+ energy.c:539:53: note: within this loop
+   for(i=0;i<ALPHASIZE;i++) for(j=0;j<ALPHASIZE;j++) for(k=0;k<=ALPHASIZE;k++) dr_dangle_dg_ar[i][j][k] = 0;
+ .
+ Perhaps that that k<= in the k loop should be < like in the i and j loops so it doesn't go beyond the end of the array.
+ .
+ ALPHASIZE is 6, so the k loop would try go one too far.  Every array allocated with ALPHASIZE certainly don't add one anywhere, so any look going from 0 to ALPHASIZE must use < not <= so there are two places in the file that are wrong.
+
+--- a/src/energy.c
++++ b/src/energy.c
+@@ -536,7 +536,7 @@ void init_tstacki_dg_ar()
+ void init_dr_dangle_dg_ar()
+ {
+   int i,j,k;
+-  for(i=0;i<ALPHASIZE;i++) for(j=0;j<ALPHASIZE;j++) for(k=0;k<=ALPHASIZE;k++) dr_dangle_dg_ar[i][j][k] = 0;
++  for(i=0;i<ALPHASIZE;i++) for(j=0;j<ALPHASIZE;j++) for(k=0;k<ALPHASIZE;k++) dr_dangle_dg_ar[i][j][k] = 0;
+ 
+   dr_dangle_dg_ar[A][U][A] = -0.700;
+   dr_dangle_dg_ar[A][U][C] = -0.100;
+@@ -568,7 +568,7 @@ void init_dr_dangle_dg_ar()
+ void init_dl_dangle_dg_ar()
+ {
+   int i,j,k;
+-  for(i=0;i<=ALPHASIZE;i++) for(j=0;j<ALPHASIZE;j++) for(k=0;k<ALPHASIZE;k++) dl_dangle_dg_ar[i][j][k] = 0;
++  for(i=0;i<ALPHASIZE;i++) for(j=0;j<ALPHASIZE;j++) for(k=0;k<ALPHASIZE;k++) dl_dangle_dg_ar[i][j][k] = 0;
+ 
+   dl_dangle_dg_ar[A][A][U] = -0.300;
+   dl_dangle_dg_ar[C][A][U] = -0.300;
diff --git a/debian/patches/fix_warnings.patch b/debian/patches/fix_warnings.patch
new file mode 100644
index 0000000..a6e2c5c
--- /dev/null
+++ b/debian/patches/fix_warnings.patch
@@ -0,0 +1,206 @@
+Author: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
+Last-Update: Tue, 26 Sep 2017 11:10:04 -0400
+Description: Fix spurious warnings that might in fact be errors
+
+--- a/src/fasta.h
++++ b/src/fasta.h
+@@ -11,6 +11,7 @@
+ 
+ #include "globals.h"
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ 
+ void nextAC(FILE *f, char *ac);
+--- a/src/hybrid_core.h
++++ b/src/hybrid_core.h
+@@ -39,5 +39,7 @@ double calc_hybrid(int i1, int j1, int i
+ 
+ void mainloop(int bflag, int hit_number, int eflag, float energy_cutoff, int pflag, float pvalue_cutoff, int compact_output, char *target_ac, char *target_sq, char *query_ac, char *query_sq, int gflag, int plot_format, float xi, float theta);
+ 
++void tableAlloc(int m, int n);
++
+ 
+ #endif
+--- a/src/numerical.c
++++ b/src/numerical.c
+@@ -9,6 +9,8 @@
+ #include "globals.h"
+ #include "minmax.h"
+ #include "math.h"
++#include <stdlib.h>
++#include <stdio.h>
+ 
+ 
+ int compare_floats (const void *a, const void *b)
+--- a/src/plot.c
++++ b/src/plot.c
+@@ -15,6 +15,8 @@
+ #include <g2_gd.h>
+ #endif
+ 
++int simple_xy_coordinates(short *pair_table, float *x, float *y);
++
+ void   loop(int i, int j, short *pair_table);
+ 
+ short *make_pair_table(const char *structure);
+--- a/src/plot.h
++++ b/src/plot.h
+@@ -10,6 +10,9 @@
+ #define plot_h
+ 
+ #include "config.h"
++#include <stdlib.h>
++#include <string.h>
++#include <math.h>
+ 
+ #define  PSPLOT 0
+ #define PNGPLOT 1
+--- a/src/random.c
++++ b/src/random.c
+@@ -13,6 +13,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <math.h>
++#include <ctype.h>
+ 
+ 
+ 
+--- a/src/rnacalibrate.c
++++ b/src/rnacalibrate.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2004 Marc Rehmsmeier, Peter Steffen, Matthias Hoechsmann */
++/* Copyright (C) 2004 Marc Rehmsmeier, Peter Steffen, Matthias Hoechsmann */;
+ 
+ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */
+ 
+@@ -12,6 +12,9 @@
+ #include "globals.h"
+ #include "minmax.h"
+ #include "mt19937-1.h"
++#include "input.h"
++#include "energy.h"
++#include "fasta.h"
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <time.h>
+@@ -19,6 +22,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <ctype.h>
+ 
+ static char const rcsid[] = "$Id: rnacalibrate.c,v 1.11 2004/11/16 15:42:33 marc Exp $";
+ 
+@@ -85,7 +89,7 @@ int main(int argc, char **argv)
+ 
+   char letter_one, letter_two;
+ 
+-  int index_one, index_two;
++  char *index_one, *index_two;
+ 
+   int counter;
+ 
+@@ -255,11 +259,11 @@ int main(int argc, char **argv)
+ 	  if (letter_two == 'U')
+ 	    letter_two = 'T';
+ 
+-	  index_one = (int) strchr(alphabet,letter_one);
+-	  index_two = (int) strchr(alphabet,letter_two);
++	  index_one = strchr(alphabet,letter_one);
++	  index_two = strchr(alphabet,letter_two);
+ 
+-	  if (index_one != 0 && index_two != 0) {
+-	    freq_di[index_one-(int) alphabet][index_two-(int) alphabet]++;
++	  if (index_one != NULL && index_two != NULL) {
++	    freq_di[index_one-alphabet][index_two-alphabet]++;
+ 	    counter++;
+ 	  }
+ 	}
+@@ -281,11 +285,11 @@ int main(int argc, char **argv)
+ 	if (letter_two == 'U')
+ 	  letter_two = 'T';
+ 
+-	index_one = (int) strchr(alphabet,letter_one);
+-	index_two = (int) strchr(alphabet,letter_two);
++	index_one = strchr(alphabet,letter_one);
++	index_two = strchr(alphabet,letter_two);
+ 
+-	if (index_one != 0 && index_two != 0) {
+-	  freq_di[index_one-(int) alphabet][index_two-(int) alphabet]++;
++	if (index_one != NULL && index_two != NULL) {
++	  freq_di[index_one-alphabet][index_two-alphabet]++;
+ 	  counter++;
+ 	}
+       }
+--- a/src/rnaeffective.c
++++ b/src/rnaeffective.c
+@@ -12,6 +12,9 @@
+ #include "globals.h"
+ #include "minmax.h"
+ #include "mt19937-1.h"
++#include "input.h"
++#include "fasta.h"
++#include "energy.h"
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <time.h>
+@@ -19,6 +22,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <ctype.h>
+ 
+ static char const rcsid[] = "$Id: rnaeffective.c,v 1.6 2004/11/16 15:41:12 marc Exp $";
+ 
+@@ -81,7 +85,7 @@ int main(int argc, char **argv)
+ 
+   char letter_one, letter_two;
+ 
+-  int index_one, index_two;
++  char *index_one, *index_two;
+ 
+   int counter;
+ 
+@@ -275,11 +279,11 @@ int main(int argc, char **argv)
+ 	  if (letter_two == 'U')
+ 	    letter_two = 'T';
+ 
+-	  index_one = (int) strchr(alphabet,letter_one);
+-	  index_two = (int) strchr(alphabet,letter_two);
++	  index_one = strchr(alphabet,letter_one);
++	  index_two = strchr(alphabet,letter_two);
+ 
+-	  if (index_one != 0 && index_two != 0) {
+-	    freq_di[index_one-(int) alphabet][index_two-(int) alphabet]++;
++	  if (index_one != NULL && index_two != NULL) {
++	    freq_di[index_one-alphabet][index_two-alphabet]++;
+ 	    counter++;
+ 	  }
+ 	}
+@@ -301,11 +305,11 @@ int main(int argc, char **argv)
+ 	if (letter_two == 'U')
+ 	  letter_two = 'T';
+ 
+-	index_one = (int) strchr(alphabet,letter_one);
+-	index_two = (int) strchr(alphabet,letter_two);
++	index_one = strchr(alphabet,letter_one);
++	index_two = strchr(alphabet,letter_two);
+ 
+-	if (index_one != 0 && index_two != 0) {
+-	  freq_di[index_one-(int) alphabet][index_two-(int) alphabet]++;
++	if (index_one != NULL && index_two != NULL) {
++	  freq_di[index_one-alphabet][index_two-alphabet]++;
+ 	  counter++;
+ 	}
+       }
+--- a/src/rnahybrid.c
++++ b/src/rnahybrid.c
+@@ -8,6 +8,7 @@
+ 
+ #include <stdio.h>  
+ #include <string.h> 
++#include <getopt.h>
+ #include "config.h"
+ #include "plot.h"
+ #include "minmax.h"
diff --git a/debian/patches/series b/debian/patches/series
index 5330d51..84b47e5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,5 @@ gcc-4.8.patch
 hardening.patch
 fixmanpage.patch
 mayhem_check_if_file_exists.patch
+fix_loop_index.patch
+fix_warnings.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/rnahybrid.git



More information about the debian-med-commit mailing list