From c13040798c66c5254fbcc921842cd519da05a4c5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 1 May 2020 12:53:43 +0200 Subject: cleanup: move FRACTION macro from dive.h to units.h There appears to be no reason to slurp in all dive.h when compiling membuffer.c. units.h might not seem like the perfect place, but it is the most fitting I found. Signed-off-by: Berthold Stoeger --- core/dive.h | 2 -- core/membuffer.c | 2 +- core/units.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dive.h b/core/dive.h index 8e9185daa..c9369885a 100644 --- a/core/dive.h +++ b/core/dive.h @@ -396,8 +396,6 @@ extern const char *existing_filename; extern void subsurface_command_line_init(int *, char ***); extern void subsurface_command_line_exit(int *, char ***); -#define FRACTION(n, x) ((unsigned)(n) / (x)), ((unsigned)(n) % (x)) - extern bool is_dc_planner(const struct divecomputer *dc); extern bool has_planned(const struct dive *dive, bool planned); diff --git a/core/membuffer.c b/core/membuffer.c index 8efb04c9e..d0e5160ef 100644 --- a/core/membuffer.c +++ b/core/membuffer.c @@ -9,7 +9,7 @@ #include #include -#include "dive.h" +#include "units.h" #include "membuffer.h" /* Only for internal use */ diff --git a/core/units.h b/core/units.h index 8839dde1d..4232e24a3 100644 --- a/core/units.h +++ b/core/units.h @@ -13,6 +13,8 @@ extern "C" { #include #endif +#define FRACTION(n, x) ((unsigned)(n) / (x)), ((unsigned)(n) % (x)) + #define O2_IN_AIR 209 // permille #define N2_IN_AIR 781 #define O2_DENSITY 1331 // mg/Liter -- cgit v1.2.3-70-g09d2