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

Re: MUMmer patches and Artistic license.



Dear Debian mentors,

we have a patch in the Debian package mummer for which we lost origin and
detailed description. I would like to forward it upstream, but I would prefer
to know what it does before ;) Would somebody have a few minutes to throw an
eye on it?  It is in our SVN, and here is a copy:

http://svn.debian.org/wsvn/debian-med/trunk/packages/mummer/trunk/debian/patches/01sm_src_tigr.diff

diff -urbN src/tigr.orig/annotate.cc src/tigr/annotate.cc
--- ./src/tigr.orig/annotate.cc 2007-07-13 19:06:58.000000000 +0200
+++ ./src/tigr/annotate.cc      2007-11-07 21:47:03.000000000 +0100
@@ -10,6 +10,7 @@
 */
 
 #include "tigrinc.hh"
+#include <assert.h>
 
 #define  FIELD_LEN  20
 #define  MAX_ALIGN  10000
@@ -138,19 +139,19 @@
 //  Print the alignment between strings  A [1 .. M]  and  B [1 .. N] .
 
   {
-   static int  D [MAX_ALIGN] [MAX_ALIGN];
-   static char  Op [MAX_ALIGN] [MAX_ALIGN];
-   static char  Show_A [2 * MAX_ALIGN];
-   static char  Show_B [2 * MAX_ALIGN];
+   int  **D,  *D_buf;
+   char **Op, *Op_buf;
+   char  *Show_A;
+   char  *Show_B;
    int  Errors, Tmp;
    long int  i, j, Ct;
 
-   if  (M >= MAX_ALIGN || N >= MAX_ALIGN)
-       {
-        printf ("\n   *** Too long ***\n\n");
-        fprintf (Gaps_With_Errors_File, "%s %7s\n", Line, "-");
-        return;
-       }
+   assert ( D_buf  = (int  *) calloc ( (M+1)*(N+1), sizeof(int) ) ) ;
+   D  = &D_buf ;
+   assert ( Op_buf = (char *) calloc ( (M+1)*(N+1), sizeof(char) ) ) ;
+   Op = &Op_buf ;
+   assert ( Show_A = (char *) calloc ( 2*(M+1) , sizeof(char) ) ) ;
+   assert ( Show_B = (char *) calloc ( 2*(N+1) , sizeof(char) ) ) ;
 
    D [0] [0] = 0;
    Op [0] [0] = 'a';
@@ -229,5 +230,10 @@
       putchar ('\n');
       Ct -= WIDTH;
      }  while  (Ct > 0);
+
+   free ( D_buf ) ;
+   free ( Op_buf ) ;
+   free ( Show_A ) ;
+   free ( Show_B ) ;
    return;
   }


There is a bit of background on our mailing lists, but it is really parcellar…

>    http://lists.debian.org/debian-med/2007/11/msg00045.html
>    http://lists.debian.org/debian-devel/2005/06/msg00037.html


The take-home message is of course: DEP3 is good for you!

http://dep.debian.net/deps/dep3/

Have a nice day,


-- 
Charles Plessy
Debian Med packaging team,
http://www.debian.org/devel/debian-med
Tsurumi, Kanagawa, Japan


Reply to: