Parcourir la source

src/core/perfmodel/perfmodel_nan.c: we need to read the spaces after the nan value

Nathalie Furmento il y a 11 ans
Parent
commit
97ba85edae
1 fichiers modifiés avec 17 ajouts et 0 suppressions
  1. 17 0
      src/core/perfmodel/perfmodel_nan.c

+ 17 - 0
src/core/perfmodel/perfmodel_nan.c

@@ -24,6 +24,22 @@
 #include <config.h>
 #include <core/perfmodel/perfmodel.h>
 
+#ifdef STARPU_HAVE_WINDOWS
+static
+void _starpu_read_spaces(FILE *f)
+{
+	int c = getc(f);
+	if (c == ' ')
+	{
+		while (c == ' ') c = getc(f);
+	}
+	else
+	{
+		ungetc(c, f);
+	}
+}
+#endif /* STARPU_HAVE_WINDOWS */
+
 int _starpu_read_double(FILE *f, char *format, double *val)
 {
 #ifdef STARPU_HAVE_WINDOWS
@@ -36,6 +52,7 @@ int _starpu_read_double(FILE *f, char *format, double *val)
 	     int x3 = getc(f);
 	     if (x2 == 'a' && x3 == 'n')
 	     {
+		     _starpu_read_spaces(f);
 		     *val = NAN;
 		     return 1;
 	     }