biology/phyml: fix build on recent current

mostly backport of:
	3574fb82d5

Obtained from:	3574fb82d5
This commit is contained in:
Tobias C. Berner 2020-08-29 08:34:27 +00:00
parent cf576d6066
commit 159fcd4b30
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=546884
4 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- src/io.c.orig 2020-07-09 11:49:16 UTC
+++ src/io.c
@@ -39,8 +39,6 @@ t_tree *Read_Tree(char **s_tree)
if((*s_tree)[i] == ',') n_otu++;
}
n_otu+=1;
-
-
tree = Make_Tree_From_Scratch(n_otu,NULL);
subs = Sub_Trees((*s_tree),&degree);
@@ -2312,7 +2310,7 @@ void Print_Fp_Out(FILE *fp_out, time_t t_beg, time_t t
div_t hour,min;
int i, j;
- if (precision > 0) snprintf (format, 8, "%%.%df", precision);
+ if (precision > 0) snprintf(format,8,"%%.%huf",(unsigned short)precision);
if(n_data_set == 1)
{

View File

@ -0,0 +1,11 @@
--- src/phyrex.c.orig 2020-07-09 11:49:16 UTC
+++ src/phyrex.c
@@ -958,7 +958,7 @@ phydbl *PHYREX_MCMC(t_tree *tree)
PHYREX_Label_Nodes_With_Locations(tree);
PHYREX_Label_Edges(tree);
char *s = Write_Tree(tree);
- PhyML_Fprintf(fp_tree,"\ntree %d [&lnP=%f,precision={1.e-1,1e-02,1e-01}] = [&R] %s",tree->mcmc->sample_num,tree->c_lnL,s);
+ PhyML_Fprintf(fp_tree,"\ntree %d [&lnP=%f,precision={1.e-1,1e-02,1e-01}] = [&R] %s",tree->mcmc->run,tree->c_lnL,s);
PhyML_Fprintf(fp_tree,"\nend;");
fseek(fp_tree,-5,SEEK_END);
tree->write_tax_names = YES;

View File

@ -0,0 +1,30 @@
--- src/utilities.c.orig 2020-07-09 11:49:16 UTC
+++ src/utilities.c
@@ -17,6 +17,9 @@ the GNU public licence. See http://www.opensource.org
#include "beagle_utils.h"
#endif
+int CALL;
+int TIME;
+
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
@@ -3066,7 +3069,7 @@ int Assign_State_With_Ambiguity(char *c, int datatype,
if(Is_Ambigu(c,GENERIC,stepsize)) state[0] = T_MAX_ALPHABET-1;
else
{
- char format[6];
+ char format[20];
sprintf(format,"%%%dd",stepsize);
if(!sscanf(c,format,state))
{
@@ -4891,7 +4894,7 @@ int Are_Compatible(char *statea, char *stateb, int ste
else
{
int a,b;
- char format[6];
+ char format[20];
sprintf(format,"%%%dd",stepsize);

View File

@ -0,0 +1,13 @@
--- src/utilities.h.orig 2020-08-29 08:31:23 UTC
+++ src/utilities.h
@@ -94,8 +94,8 @@ static inline int isinf_ld (long double x) { return is
#endif
-int CALL;
-int TIME;
+extern int CALL;
+extern int TIME;
#define SLFV_GAUSSIAN 0 /* Spatial Lambda-Fleming-Viot model (Gaussian) */
#define SLFV_UNIFORM 1 /* Spatial Lambda-Fleming-Viot model (Uniform) */