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++)
