Commit 640f82dd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Clean-up before merge

parent de31a223
......@@ -50,7 +50,6 @@
#include "space.h"
#include "task.h"
#include "timers.h"
#include "tools.h"
#include "version.h"
/**
......@@ -146,7 +145,8 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) {
/* Create file */
char filename[200] = "dependency_graph.dot";
FILE *f = open_and_check_file(filename, "w");
FILE *f = fopen(filename, "w");
if (f == NULL) error("Error opening depenency graph file.");
/* Write header */
fprintf(f, "digraph task_dep {\n");
......
......@@ -23,7 +23,6 @@
#include "../config.h"
/* Some standard headers. */
#include <errno.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
......@@ -695,17 +694,3 @@ int compare_particles(struct part a, struct part b, double threshold) {
#endif
}
/**
* @brief Open a file and verify if it was correctly opened
*
* @param filename Name of the file
* @param mode Opening mode (e.g. 'a', 'w', ..)
*/
FILE *open_and_check_file(const char *filename, const char *mode) {
FILE *f = fopen(filename, mode);
if (f == NULL)
error("Unable to open file '%s' in mode %s, error: %i", filename, mode,
errno);
return f;
}
......@@ -52,6 +52,4 @@ int compare_values(double a, double b, double threshold, double *absDiff,
double *absSum, double *relDiff);
int compare_particles(struct part a, struct part b, double threshold);
FILE *open_and_check_file(const char *filename, const char *mode);
#endif /* SWIFT_TOOL_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment