Package: phipack / 0.0.20160614-5

phipack.unsigned.char.fixes.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Date: Tue, 8 Sep 2020 19:23:15 -0400
From: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Description: Force signed char on every architecture
Bug-Debian: https://bugs.debian.org/969552

--- a/src/fasta.c
+++ b/src/fasta.c
@@ -36,7 +36,7 @@ along with PhiPack.  If not, see <http:/
 void read_sequence_name(FILE *in_file,char *name, int capacity)
 {
   int i=0;
-  char ch='\0';
+  signed char ch='\0';
 
   ch=fgetc(in_file);
   if(ch != '>')
@@ -97,7 +97,7 @@ char read_seq_part(FILE *in_file,  int b
 {
   int bases_read=0;
   int new_limit;
-  char ch;
+  signed char ch;
   char s[250];
   
   ch=fgetc(in_file);
@@ -175,7 +175,7 @@ void read_fasta(const char* file_name,
   int *seq_counter;
   int i;
  
-  char ch;
+  signed char ch;
 
   int cur_seqs;
   int num_seqs=1,new_num;
--- a/src/global.c
+++ b/src/global.c
@@ -34,7 +34,7 @@ const char AA_AMBIG[] = {'B','Z'};
 const int AA_AMBIG_SIZE =2;
 
 const char GAP[] = {'-'};
-const int GAP_SIZE=2;
+const int GAP_SIZE=1;
 
 cbool memberOf(const char *set, const int num, char ch)
 {
@@ -79,10 +79,10 @@ cbool missing_ambig_State(alignmentClass
   switch(alignKind)
     {
     case DNA:
-      return (memberOf(DNA_MISSING,DNA_MISSING_SIZE,ch) || memberOf(DNA_AMBIG,DNA_AMBIG_SIZE,ch));
+      return (memberOf(DNA_MISSING,DNA_MISSING_SIZE,ch) || memberOf(DNA_AMBIG,DNA_AMBIG_SIZE,ch)) ? TRUE : FALSE;
       break;
     case AA:
-      return (memberOf(AA_MISSING,AA_MISSING_SIZE,ch) || memberOf(AA_AMBIG,AA_AMBIG_SIZE,ch));
+      return (memberOf(AA_MISSING,AA_MISSING_SIZE,ch) || memberOf(AA_AMBIG,AA_AMBIG_SIZE,ch)) ? TRUE : FALSE;
       break;
     case OTHER:
       if(ch == GLOBAL_MISSING)
--- a/src/main.c
+++ b/src/main.c
@@ -71,7 +71,8 @@ void print_usage()
 
 void get_params(int argc, char**argv, options *opt) 
 { 
-  char *cur,ch,nextch;
+  char *cur;
+  signed char ch,nextch;
   char temp[MAX_SIZE+1];
   int i;
   cbool inFileFound=FALSE;
--- a/src/mem.c
+++ b/src/mem.c
@@ -96,7 +96,7 @@ FILE *ffopen(char *name,char *mod)
 
 char ffclose(FILE *handle)
 {
-  char f;
+  signed char f;
   char s[MAX_SIZE+1];
 
   f=fclose(handle);
--- a/src/misc.c
+++ b/src/misc.c
@@ -46,7 +46,7 @@ char *strsub(char *s1, const char *s2, i
 
 char skip_all_space(FILE *in_file)
 {
-  char ch;
+  signed char ch;
   
   ch=fgetc(in_file);
   while((ch != EOF) && isspace(ch))
@@ -61,7 +61,7 @@ char skip_all_space(FILE *in_file)
 
 char skip_newlines(FILE *in_file)
 {
-  char ch;
+  signed char ch;
   
   ch=fgetc(in_file);
   while((ch != EOF) && (ch == '\n'))
@@ -76,7 +76,7 @@ char skip_newlines(FILE *in_file)
 
 char skip_non_newline(FILE *in_file)
 {
-  char ch;
+  signed char ch;
   
   ch=fgetc(in_file);
   while((ch != EOF) && (ch != '\n'))
@@ -90,7 +90,7 @@ char skip_non_newline(FILE *in_file)
 
 char skip_non_newline_space(FILE *in_file)
 {
-  char ch;
+  signed char ch;
   
   ch=fgetc(in_file);
   while((ch != EOF) && (ch != '\n') && isspace(ch))
--- a/src/phylip.c
+++ b/src/phylip.c
@@ -30,7 +30,7 @@
 void read_strict_name(FILE *in_file,char *name, int capacity)
 {
   int i;
-  char ch='\0';
+  signed char ch='\0';
   for(i=0;(i<PHYLIP_SIZE) && (ch!=EOF);i++)
     {
       ch=fgetc(in_file);
@@ -51,7 +51,7 @@ void read_strict_name(FILE *in_file,char
 void read_relaxed_name(FILE *in_file,char *name, int capacity)
 {
   int i=0;
-  char ch='\0',next_ch;
+  signed char ch='\0',next_ch;
   cbool double_space=FALSE;
   
   while((i<capacity) && (ch!=EOF) && (double_space == FALSE))
@@ -129,7 +129,7 @@ void write_phylip(FILE* cur_stream, cboo
 int read_seq_bit(FILE *in_file, int base_limit, align_type* states, int index, int *num_bases)
 {
   int bases_read=num_bases[index];
-  char ch;
+  signed char ch;
   char s[250];
   
   ch=fgetc(in_file);
@@ -213,7 +213,7 @@ void read_phylip(const char* file_name,
   int *seq_counter;
   int i;
   int cur_seq=0;
-  char ch;
+  signed char ch;
 
   in_file=fopen(file_name,"r");
   if(in_file == NULL)
--- a/src/profile.c
+++ b/src/profile.c
@@ -71,7 +71,8 @@ void print_usage()
 
 void get_params(int argc, char**argv, options *opt) 
 { 
-  char *cur,ch,nextch;
+  char *cur;
+  signed char ch,nextch;
   char temp[MAX_SIZE+1];
   int i;
   cbool inFileFound=FALSE;
--- a/src/seqManip.c
+++ b/src/seqManip.c
@@ -190,7 +190,7 @@ void get_informative( align_type **align
 cbool validate_alignment(align_type **alignment, alignmentClass alignKind,int num_taxa, int num_sites)
 {
   int i,j;
-  char ch;
+  signed char ch;
   char s[MAX_SIZE+1];
 
   for(i=0;i<num_taxa;i++)