[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#861281: rnahybrid: FTBFS on armel



On Tue, Sep 26, 2017 at 05:48:40PM +0200, Andreas Tille wrote:
> Hi Lennart,
> 
> thanks for your suggestions.  I hereby will forward it upstream hoping
> for comments.

Here is a patch that removes all the warnings I see.  Maybe that will
help.  I don't have an armel to test on.

Most of the warnings are due to missing #include in a lot of places.

-- 
Len Sorensen
diff -ur rnahybrid-2.1.2.orig/src/energy.c rnahybrid-2.1.2/src/energy.c
--- rnahybrid-2.1.2.orig/src/energy.c	2013-08-25 11:51:20.000000000 -0400
+++ rnahybrid-2.1.2/src/energy.c	2017-09-26 11:04:34.747986466 -0400
@@ -536,7 +536,7 @@
 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_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 -ur rnahybrid-2.1.2.orig/src/fasta.h rnahybrid-2.1.2/src/fasta.h
--- rnahybrid-2.1.2.orig/src/fasta.h	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/fasta.h	2017-09-26 11:53:41.134683876 -0400
@@ -11,6 +11,7 @@
 
 #include "globals.h"
 #include <stdio.h>
+#include <stdlib.h>
 
 
 void nextAC(FILE *f, char *ac);
diff -ur rnahybrid-2.1.2.orig/src/hybrid_core.h rnahybrid-2.1.2/src/hybrid_core.h
--- rnahybrid-2.1.2.orig/src/hybrid_core.h	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/hybrid_core.h	2017-09-26 11:50:33.459350394 -0400
@@ -39,5 +39,7 @@
 
 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
diff -ur rnahybrid-2.1.2.orig/src/numerical.c rnahybrid-2.1.2/src/numerical.c
--- rnahybrid-2.1.2.orig/src/numerical.c	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/numerical.c	2017-09-26 12:11:48.331097154 -0400
@@ -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)
diff -ur rnahybrid-2.1.2.orig/src/plot.c rnahybrid-2.1.2/src/plot.c
--- rnahybrid-2.1.2.orig/src/plot.c	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/plot.c	2017-09-26 11:58:03.441787818 -0400
@@ -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);
diff -ur rnahybrid-2.1.2.orig/src/plot.h rnahybrid-2.1.2/src/plot.h
--- rnahybrid-2.1.2.orig/src/plot.h	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/plot.h	2017-09-26 11:57:09.901968143 -0400
@@ -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
diff -ur rnahybrid-2.1.2.orig/src/random.c rnahybrid-2.1.2/src/random.c
--- rnahybrid-2.1.2.orig/src/random.c	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/random.c	2017-09-26 12:11:42.603115516 -0400
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
+#include <ctype.h>
 
 
 
diff -ur rnahybrid-2.1.2.orig/src/rnacalibrate.c rnahybrid-2.1.2/src/rnacalibrate.c
--- rnahybrid-2.1.2.orig/src/rnacalibrate.c	2017-09-26 11:06:45.000000000 -0400
+++ rnahybrid-2.1.2/src/rnacalibrate.c	2017-09-26 12:10:14.555398079 -0400
@@ -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 @@
 
   char letter_one, letter_two;
 
-  int index_one, index_two;
+  char *index_one, *index_two;
 
   int counter;
 
@@ -255,11 +259,11 @@
 	  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 @@
 	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++;
 	}
       }
diff -ur rnahybrid-2.1.2.orig/src/rnaeffective.c rnahybrid-2.1.2/src/rnaeffective.c
--- rnahybrid-2.1.2.orig/src/rnaeffective.c	2017-09-26 11:06:45.000000000 -0400
+++ rnahybrid-2.1.2/src/rnaeffective.c	2017-09-26 12:15:37.282364985 -0400
@@ -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 @@
 
   char letter_one, letter_two;
 
-  int index_one, index_two;
+  char *index_one, *index_two;
 
   int counter;
 
@@ -275,11 +279,11 @@
 	  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 @@
 	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++;
 	}
       }
diff -ur rnahybrid-2.1.2.orig/src/rnahybrid.c rnahybrid-2.1.2/src/rnahybrid.c
--- rnahybrid-2.1.2.orig/src/rnahybrid.c	2013-08-25 09:10:35.000000000 -0400
+++ rnahybrid-2.1.2/src/rnahybrid.c	2017-09-26 11:49:35.187563284 -0400
@@ -8,6 +8,7 @@
 
 #include <stdio.h>  
 #include <string.h> 
+#include <getopt.h>
 #include "config.h"
 #include "plot.h"
 #include "minmax.h"

Reply to: