Browse code

fscanf warning under Linux with BioC

ramon diaz-uriarte (at Phelsuma) authored on 14/08/2019 10:38:39
Showing 3 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: OncoSimulR
2 2
 Type: Package
3 3
 Title: Forward Genetic Simulation of Cancer Progression with Epistasis 
4
-Version: 2.15.1
5
-Date: 2019-06-06
4
+Version: 2.15.2
5
+Date: 2019-08-14
6 6
 Authors@R: c(person("Ramon", "Diaz-Uriarte", role = c("aut", "cre"),
7 7
 		     email = "rdiaz02@gmail.com"),
8 8
 	      person("Mark", "Taylor", role = "ctb", email = "ningkiling@gmail.com"))
... ...
@@ -1,3 +1,6 @@
1
+Changes in version 2.15.2 (2019-08-14):
2
+	- Trying to prevent fscanf warning in FitnessLandscape/input.c
3
+
1 4
 Changes in version 2.15.1 (2019-06-06):
2 5
 	- Added MAGELLAN's sources and functionality from MAGELLAN.
3 6
 	
... ...
@@ -72,10 +72,11 @@ int * GetOrderFromFile( char *filename ){
72 72
 	alleles = (int *) malloc( (size_t) nlocus * sizeof( int )  );
73 73
 	if(! alleles )fprintf(stderr, "ReadFile: cannot allocate alleles, bye\n"), exit(3);
74 74
 
75
-	
75
+
76 76
 	for( l=0; l<nlocus; l++)
77
-		fscanf( f, "%d", alleles+l );
78
-	
77
+	  // fscanf( f, "%d", alleles+l );
78
+	  if(fscanf( f, "%d", alleles+l )){};
79
+	// the ignoring return value of ‘fscanf’ warning	
79 80
 
80 81
 	init_landscape( &fl, nlocus, alleles);
81 82
 	
... ...
@@ -91,9 +92,11 @@ int * GetOrderFromFile( char *filename ){
91 92
 		
92 93
 		for( l=0; l<nlocus; l++)
93 94
 		{
94
-			fscanf( f, "%d", alleles+l );
95
+		  // fscanf( f, "%d", alleles+l );
96
+		  if(fscanf( f, "%d", alleles+l )){};
95 97
 		}
96
-		fscanf( f, "%f", &fitness );
98
+		// fscanf( f, "%f", &fitness );
99
+		if(fscanf( f, "%f", &fitness )){};
97 100
 		
98 101
 		while( ((ch = fgetc(f)) != '\n') && (ch != EOF) );
99 102
 		
... ...
@@ -162,7 +165,8 @@ struct landscape ReadFile( char *filename, int opt_zero ){
162 165
 	
163 166
 	for( l=0; l<nlocus; l++)
164 167
 	{
165
-		fscanf( f, "%d", alleles+l );
168
+	  // fscanf( f, "%d", alleles+l );
169
+		if(fscanf( f, "%d", alleles+l )){};
166 170
 	}
167 171
 	
168 172
 	/*
... ...
@@ -188,9 +192,12 @@ struct landscape ReadFile( char *filename, int opt_zero ){
188 192
 		
189 193
 		for( l=0; l<nlocus; l++)
190 194
 		{
191
-			fscanf( f, "%d", alleles+l );
195
+		  //fscanf( f, "%d", alleles+l );
196
+			if(fscanf( f, "%d", alleles+l )){};
192 197
 		}
193
-		fscanf( f, "%f", &fitness );
198
+		//fscanf( f, "%f", &fitness );
199
+		if(fscanf( f, "%f", &fitness )){};
200
+		
194 201
 		
195 202
 		while( ((ch = fgetc(f)) != '\n') && (ch != EOF) );
196 203