~ubuntu-branches/debian/jessie/arb/jessie

« back to all changes in this revision

Viewing changes to NALIGNER/ali_sequence.cxx

  • Committer: Package Import Robot
  • Author(s): Elmar Pruesse, Andreas Tille, Elmar Pruesse
  • Date: 2014-09-02 15:15:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140902151506-jihq58b3iz342wif
Tags: 6.0.2-1
[ Andreas Tille ]
* New upstream version
  Closes: #741890
* debian/upstream -> debian/upstream/metadata
* debian/control:
   - Build-Depends: added libglib2.0-dev
   - Depends: added mafft, mrbayes
* debian/rules
   - Add explicite --remove-section=.comment option to manual strip call
* cme fix dpkg-control
* arb-common.dirs: Do not create unneeded lintian dir
* Add turkish debconf translation (thanks for the patch to Mert Dirik
  <mertdirik@gmail.com>)
  Closes: #757497

[ Elmar Pruesse ]
* patches removed:
   - 10_config.makefiles.patch,
     80_no_GL.patch
       removed in favor of creating file from config.makefile.template via 
       sed in debian/control
   - 20_Makefile_main.patch
       merged upstream
   - 21_Makefiles.patch
       no longer needed
   - 30_tmpfile_CVE-2008-5378.patch: 
       merged upstream
   - 50_fix_gcc-4.8.patch:
       merged upstream
   - 40_add_libGLU.patch:
       libGLU not needed for arb_ntree)
   - 60_use_debian_packaged_raxml.patch:
       merged upstream
   - 70_hardening.patch
       merged upstream
   - 72_add_math_lib_to_linker.patch
       does not appear to be needed
* patches added:
   - 10_upstream_r12793__show_db_load_progress:
       backported patch showing progress while ARB is loading a database
       (needed as indicator/splash screen while ARB is launching)
   - 20_upstream_r12794__socket_permissions:
       backported security fix
   - 30_upstream_r12814__desktop_keywords:
       backported add keywords to desktop (fixes lintian warning)
   - 40_upstream_r12815__lintian_spelling:
       backported fix for lintian reported spelling errors
   - 50_private_nameservers
       change configuration to put nameservers into users home dirs
       (avoids need for shared writeable directory)
   - 60_use_debian_phyml
       use phyml from debian package for both interfaces in ARB
* debian/rules:
   - create config.makefile from override_dh_configure target
   - use "make tarfile" in override_dh_install
   - remove extra cleaning not needed for ARB 6
   - use "dh_install --list-missing" to avoid missing files
   - added override_dh_fixperms target
* debian/control:
   - added libarb-dev package
   - Depends: added phyml, xdg-utils
   - Suggests: removed phyml
   - fix lintian duplicate-short-description (new descriptions)
* debian/*.install:
   - "unrolled" confusing globbing to select files
   - pick files from debian/tmp
   - moved all config files to /etc/arb
* debian/arb-common.templates: updated
* scripts:
   - removed arb-add-pt-server
   - launch-wrapper: 
     - only add demo.arb to newly created $ARBUSERDATA
     - pass commandline arguments through bin/arb wrapper
   - preinst: removing old PT server index files on upgrade from 5.5*
   - postinst: set setgid on shared PT dir
* rewrote arb.1 manfile
* added file icon for ARB databases
* using upstream arb_tcp.dat

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
 
3
 
#include <string.h>
4
 
#include <stdlib.h>
5
 
// #include <malloc.h>
6
 
 
7
 
#include "ali_misc.hxx"
 
1
// =============================================================== //
 
2
//                                                                 //
 
3
//   File      : ali_sequence.cxx                                  //
 
4
//   Purpose   :                                                   //
 
5
//                                                                 //
 
6
//   Institute of Microbiology (Technical University Munich)       //
 
7
//   http://www.arb-home.de/                                       //
 
8
//                                                                 //
 
9
// =============================================================== //
 
10
 
8
11
#include "ali_sequence.hxx"
9
12
 
10
 
 
11
 
 
12
 
/*****************************************************************************
13
 
 *
14
 
 *  ALI_SEQUENCE
15
 
 *
16
 
 *****************************************************************************/
17
 
 
18
 
 
19
 
int ALI_SEQUENCE::check(void)
 
13
// ---------------------
 
14
//      ALI_SEQUENCE
 
15
 
 
16
int ALI_SEQUENCE::check()
20
17
{
21
18
    unsigned char *seq_buf;
22
19
    unsigned long i;
29
26
    return 1;
30
27
}
31
28
 
32
 
char *ALI_SEQUENCE::string(void)
 
29
char *ALI_SEQUENCE::string()
33
30
{
34
31
    char *str, *str_buf;
35
32
    unsigned char *seq_buf;
36
33
    unsigned long i;
37
34
 
38
 
    str = (char *) CALLOC((unsigned int) seq_len + 1,sizeof(char));
 
35
    str = (char *) CALLOC((unsigned int) seq_len + 1, sizeof(char));
39
36
 
40
37
    str_buf = str;
41
38
    seq_buf = seq;
43
40
        *(str_buf++) = *(seq_buf++);
44
41
    }
45
42
    *str_buf = '\0';
46
 
    ali_sequence_to_string((unsigned char*) str,seq_len);
 
43
    ali_sequence_to_string((unsigned char*) str, seq_len);
47
44
 
48
45
    return str;
49
46
}
50
47
 
51
 
/*****************************************************************************
52
 
 *
53
 
 *  ALI_NORM_SEQUENCE
54
 
 *
55
 
 *****************************************************************************/
 
48
// --------------------------
 
49
//      ALI_NORM_SEQUENCE
56
50
 
57
51
ALI_NORM_SEQUENCE::ALI_NORM_SEQUENCE(char *Name, char *String)
58
52
{
61
55
    int dot_flag;
62
56
    char *str;
63
57
 
64
 
    /*
65
 
     * Count only _BASES_
66
 
     */
 
58
    // Count only _BASES_
67
59
    for (counter = 0, str = String; *str != '\0'; str++)
68
60
        if (ali_is_base(*str))
69
61
            counter++;
70
62
    seq_len = counter;
71
63
 
72
 
    seq = (unsigned char*) CALLOC((unsigned int) seq_len,sizeof(unsigned char));
73
 
    dots = (unsigned char **) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
74
 
    //dots = (unsigned char (*) [1]) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
 
64
    seq      = (unsigned char*) CALLOC((unsigned int) seq_len, sizeof(unsigned char));
 
65
    dots     = (unsigned char **) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
75
66
    seq_name = strdup(Name);
 
67
 
76
68
    if (seq == 0 || dots == 0 || seq_name == 0) {
77
69
        ali_fatal_error("Out of memory");
78
70
    }
107
99
            counter++;
108
100
    seq_len = counter;
109
101
 
110
 
    seq = (unsigned char*) CALLOC((unsigned int) seq_len,sizeof(unsigned char));
111
 
    dots = (unsigned char **) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
112
 
    //dots = (unsigned char (*) [1]) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
 
102
    seq      = (unsigned char*) CALLOC((unsigned int) seq_len, sizeof(unsigned char));
 
103
    dots     = (unsigned char **) CALLOC((unsigned int) (seq_len/8)+1, sizeof(unsigned char));
113
104
    seq_name = strdup(SEQ->name());
 
105
 
114
106
    if (seq == 0 || dots == 0 || seq_name == 0) {
115
107
        ali_fatal_error("Out of memory");
116
108
    }
139
131
    unsigned char *seq_buf;
140
132
    unsigned long i;
141
133
 
142
 
    str = (char *) CALLOC((unsigned int) seq_len + 1,sizeof(char));
 
134
    str = (char *) CALLOC((unsigned int) seq_len + 1, sizeof(char));
143
135
    if (str == 0)
144
136
        ali_fatal_error("Out of memory");
145
137
 
147
139
        *str_buf++ = *seq_buf++;
148
140
    *str_buf = '\0';
149
141
 
150
 
    ali_sequence_to_string((unsigned char*) str,seq_len);
 
142
    ali_sequence_to_string((unsigned char*) str, seq_len);
151
143
 
152
144
    return str;
153
145
}