From 1496bbc3144b4058b4ef294e912195ff86cb71e1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 12 Mar 2022 10:44:37 +0100 Subject: [PATCH] core: move device related functions from display.h to device.h It is ominous that these functions were declared in display.h. Signed-off-by: Berthold Stoeger --- core/android.cpp | 3 ++- core/device.h | 6 ++++++ core/display.h | 8 -------- core/ios.cpp | 2 +- core/macos.c | 3 ++- core/unix.c | 3 ++- core/windows.c | 3 ++- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/core/android.cpp b/core/android.cpp index 478bb8d86..a3862c4bc 100644 --- a/core/android.cpp +++ b/core/android.cpp @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 /* implements Android specific functions */ #include "dive.h" -#include "display.h" +#include "device.h" +#include "libdivecomputer.h" #include "file.h" #include "qthelper.h" #include diff --git a/core/device.h b/core/device.h index c51164444..147c94bc4 100644 --- a/core/device.h +++ b/core/device.h @@ -57,6 +57,12 @@ extern uint32_t fp_get_deviceid(struct fingerprint_table *table, unsigned int i) extern uint32_t fp_get_diveid(struct fingerprint_table *table, unsigned int i); extern char *fp_get_data(struct fingerprint_table *table, unsigned int i); +extern int is_default_dive_computer_device(const char *); + +typedef void (*device_callback_t)(const char *name, void *userdata); + +extern int enumerate_devices(device_callback_t callback, void *userdata, unsigned int transport); + #ifdef __cplusplus } #endif diff --git a/core/display.h b/core/display.h index 7c8b9d12c..989e23201 100644 --- a/core/display.h +++ b/core/display.h @@ -2,8 +2,6 @@ #ifndef DISPLAY_H #define DISPLAY_H -#include "libdivecomputer.h" - #ifdef __cplusplus extern "C" { #endif @@ -26,12 +24,6 @@ struct plot_info { struct plot_pressure_data *pressures; /* cylinders.nr blocks of nr entries. */ }; -extern int is_default_dive_computer_device(const char *); - -typedef void (*device_callback_t)(const char *name, void *userdata); - -extern int enumerate_devices(device_callback_t callback, void *userdata, unsigned int transport); - #define AMB_PERCENTAGE 50.0 #ifdef __cplusplus diff --git a/core/ios.cpp b/core/ios.cpp index b8fe7227e..70a821be7 100644 --- a/core/ios.cpp +++ b/core/ios.cpp @@ -5,7 +5,7 @@ #include #include "dive.h" #include "file.h" -#include "display.h" +#include "device.h" #include "core/qthelper.h" #include #if !defined(__IPHONE_5_0) diff --git a/core/macos.c b/core/macos.c index 0ee7c1952..e6c93ec02 100644 --- a/core/macos.c +++ b/core/macos.c @@ -7,7 +7,8 @@ #include #include "dive.h" #include "subsurface-string.h" -#include "display.h" +#include "device.h" +#include "libdivecomputer.h" #include #if !defined(__IPHONE_5_0) #include diff --git a/core/unix.c b/core/unix.c index 3c30b36b8..41d6ed09a 100644 --- a/core/unix.c +++ b/core/unix.c @@ -5,7 +5,8 @@ #include "dive.h" #include "file.h" #include "subsurface-string.h" -#include "display.h" +#include "device.h" +#include "libdivecomputer.h" #include "membuffer.h" #include #include diff --git a/core/windows.c b/core/windows.c index b770129c5..3c32f5a64 100644 --- a/core/windows.c +++ b/core/windows.c @@ -4,7 +4,8 @@ #include "ssrf.h" #include #include "dive.h" -#include "display.h" +#include "device.h" +#include "libdivecomputer.h" #include "file.h" #include "errorhelper.h" #include "subsurfacesysinfo.h"