summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-18 19:35:08 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-18 19:35:29 +0100
commitd361f57c8064ce13a0478653050b169dc94e2e99 (patch)
tree73613b75bc4e6533455b6c3ad79c3fa39b8554fb
parent2ab18fd01bc7c46043429511a3801846b998c749 (diff)
compat/util: retire
Adjust usages.
-rw-r--r--compat/check-visible.hpp2
-rw-r--r--compat/correlation-calibrator.cpp2
-rw-r--r--compat/library-path.hpp4
-rw-r--r--compat/macros.hpp4
-rw-r--r--compat/math-imports.hpp8
-rw-r--r--compat/math.hpp (renamed from compat/clamp.hpp)24
-rw-r--r--compat/meta.hpp5
-rw-r--r--compat/round.hpp15
-rw-r--r--compat/timer.hpp8
-rw-r--r--compat/util.hpp10
-rw-r--r--csv/csv.cpp2
-rw-r--r--cv/translation-calibrator.cpp4
-rw-r--r--cv/video-property-page.cpp2
-rw-r--r--cv/video-widget.cpp2
-rw-r--r--dinput/keybinding-worker.cpp5
-rw-r--r--ext-falcon-bms-linear-acc/falcon-bms-ext.hpp1
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp4
-rw-r--r--gui/init.cpp2
-rw-r--r--gui/process_detector.cpp3
-rw-r--r--gui/settings.cpp2
-rw-r--r--logic/extensions.cpp1
-rw-r--r--logic/pipeline.cpp2
-rw-r--r--logic/shortcuts.h1
-rw-r--r--logic/work.cpp2
-rw-r--r--migration/20160917_00-accela.cpp1
-rw-r--r--migration/20170420_00-udp-naming.cpp1
-rw-r--r--migration/20171013_00-tracker-pt-threshold.cpp1
-rw-r--r--migration/migration.cpp1
-rw-r--r--options/base-value.hpp1
-rw-r--r--options/bundle.hpp1
-rw-r--r--options/connector.cpp1
-rw-r--r--options/group.cpp2
-rw-r--r--options/group.hpp2
-rw-r--r--options/options.hpp2
-rw-r--r--options/slider.hpp3
-rw-r--r--options/tie.cpp1
-rw-r--r--options/tie.hpp1
-rw-r--r--options/value.hpp3
-rw-r--r--pose-widget/pose-widget.cpp3
-rw-r--r--proto-flightgear/ftnoir_protocol_fg_dialog.cpp2
-rw-r--r--proto-ft/ftnoir_protocol_ft.cpp4
-rw-r--r--proto-ft/ftnoir_protocol_ft_dialog.cpp2
-rw-r--r--proto-libevdev/ftnoir_protocol_libevdev.cpp2
-rw-r--r--proto-mouse/ftnoir_protocol_mouse.cpp3
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp2
-rw-r--r--proto-vjoystick/vjoystick.cpp2
-rw-r--r--proto-wine/ftnoir_protocol_wine.cpp2
-rw-r--r--proto-wine/opentrack-wrapper-wine-windows.cxx2
-rw-r--r--qxt-mini/qxtglobalshortcut.cpp2
-rw-r--r--qxt-mini/qxtglobalshortcut_x11.cpp1
-rw-r--r--spline/spline-widget.cpp2
-rw-r--r--spline/spline.cpp7
-rw-r--r--spline/spline.hpp1
-rw-r--r--tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp2
-rw-r--r--tracker-fusion/fusion.cpp3
-rw-r--r--tracker-hatire/thread.cpp2
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.cpp2
-rw-r--r--tracker-pt/camera.h1
-rw-r--r--tracker-pt/frame.cpp2
-rw-r--r--tracker-pt/ftnoir_tracker_pt.h1
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp1
-rw-r--r--tracker-pt/point_extractor.cpp5
-rw-r--r--tracker-pt/point_tracker.h4
-rw-r--r--tracker-rift-080/ftnoir_tracker_rift_080.cpp1
-rw-r--r--tracker-rift-140/rift-140.cpp1
-rw-r--r--tracker-rs/ftnoir_tracker_rs.cpp2
-rw-r--r--tracker-s2bot/ftnoir_tracker_s2bot.cpp2
-rw-r--r--tracker-steamvr/steamvr.cpp1
-rw-r--r--tracker-steamvr/steamvr.hpp1
-rw-r--r--tracker-test/test.h3
-rw-r--r--tracker-udp/ftnoir_tracker_udp.cpp1
-rw-r--r--variant/default/main-window.cpp3
72 files changed, 92 insertions, 119 deletions
diff --git a/compat/check-visible.hpp b/compat/check-visible.hpp
index f5420a39..a0211982 100644
--- a/compat/check-visible.hpp
+++ b/compat/check-visible.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "export.hpp"
-#include "util.hpp"
+#include "macros.hpp"
#include <QWidget>
diff --git a/compat/correlation-calibrator.cpp b/compat/correlation-calibrator.cpp
index 1d3339d3..aef804d2 100644
--- a/compat/correlation-calibrator.cpp
+++ b/compat/correlation-calibrator.cpp
@@ -1,6 +1,6 @@
#include "correlation-calibrator.hpp"
#include "variance.hpp"
-#include "util.hpp"
+#include "compat/math.hpp"
#include <cmath>
#include <iterator>
diff --git a/compat/library-path.hpp b/compat/library-path.hpp
new file mode 100644
index 00000000..e14cf5e0
--- /dev/null
+++ b/compat/library-path.hpp
@@ -0,0 +1,4 @@
+#pragma once
+
+// from build directory
+#include "__opentrack-library-path.h"
diff --git a/compat/macros.hpp b/compat/macros.hpp
index d51bace7..766730db 100644
--- a/compat/macros.hpp
+++ b/compat/macros.hpp
@@ -71,7 +71,3 @@
# define unlikely(x) (x)
#endif
-#define progn(...) (([&]() { __VA_ARGS__ })())
-#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })())
-
-#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false)
diff --git a/compat/math-imports.hpp b/compat/math-imports.hpp
index 4d8d5a5f..67b7e6ed 100644
--- a/compat/math-imports.hpp
+++ b/compat/math-imports.hpp
@@ -1,11 +1,5 @@
#pragma once
-template <typename T>
-static inline constexpr auto signum(T x)
-{
- return x < T(0) ? -1 : 1;
-}
-
#include <cmath>
using std::copysign;
@@ -51,3 +45,5 @@ using std::uint8_t;
using std::min;
using std::max;
+
+#include "math.hpp"
diff --git a/compat/clamp.hpp b/compat/math.hpp
index 8141e25f..5d80dace 100644
--- a/compat/clamp.hpp
+++ b/compat/math.hpp
@@ -1,10 +1,10 @@
#pragma once
+#include "macros.hpp"
+
#include <cmath>
#include <type_traits>
-#include "macros.hpp"
-
namespace util_detail {
template<typename n>
@@ -52,3 +52,23 @@ inline auto clamp(const t& val, const u& min, const w& max)
using tp = decltype(val + min + max);
return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max);
}
+
+template<typename t>
+inline int iround(const t& val)
+{
+ return int(std::round(val));
+}
+
+template<typename t>
+inline unsigned uround(const t& val)
+{
+ return std::round(std::fmax(t(0), val));
+}
+
+#include "macros.hpp"
+
+template <typename T>
+static force_inline constexpr auto signum(T x)
+{
+ return x < T(0) ? -1 : 1;
+}
diff --git a/compat/meta.hpp b/compat/meta.hpp
index ce81b3d0..80eca89a 100644
--- a/compat/meta.hpp
+++ b/compat/meta.hpp
@@ -12,6 +12,11 @@
template<typename t>
using cv_qualified = std::conditional_t<std::is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>;
+#define progn(...) (([&]() { __VA_ARGS__ })())
+#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })())
+
+#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false)
+
#if 0
#include <tuple>
diff --git a/compat/round.hpp b/compat/round.hpp
deleted file mode 100644
index 90a0ccb3..00000000
--- a/compat/round.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-#include <cmath>
-
-template<typename t>
-inline int iround(const t& val)
-{
- return int(std::round(val));
-}
-
-template<typename t>
-inline unsigned uround(const t& val)
-{
- return std::round(std::fmax(t(0), val));
-}
diff --git a/compat/timer.hpp b/compat/timer.hpp
index ac255a9d..a92d3f68 100644
--- a/compat/timer.hpp
+++ b/compat/timer.hpp
@@ -9,6 +9,9 @@
#pragma once
#include "export.hpp"
+#include "time.hpp"
+
+#include <ctime>
#if defined (_WIN32)
# include <windows.h>
@@ -17,11 +20,6 @@
# include <mach/mach_time.h>
#endif
-#include <ctime>
-
-#include "time.hpp"
-#include "util.hpp"
-
class OTR_COMPAT_EXPORT Timer final
{
struct timespec state;
diff --git a/compat/util.hpp b/compat/util.hpp
deleted file mode 100644
index dda947e5..00000000
--- a/compat/util.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "opentrack-library-path.h"
-#include "run-in-thread.hpp"
-#include "meta.hpp"
-#include "macros.hpp"
-#include "round.hpp"
-#include "clamp.hpp"
-
-#include <QDebug>
diff --git a/csv/csv.cpp b/csv/csv.cpp
index 05df7da0..189d05d9 100644
--- a/csv/csv.cpp
+++ b/csv/csv.cpp
@@ -10,7 +10,7 @@
*/
#include "csv.h"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QTextDecoder>
#include <QFile>
#include <QString>
diff --git a/cv/translation-calibrator.cpp b/cv/translation-calibrator.cpp
index 8d8494b2..aac2434f 100644
--- a/cv/translation-calibrator.cpp
+++ b/cv/translation-calibrator.cpp
@@ -7,10 +7,12 @@
#include "translation-calibrator.hpp"
#include "compat/euler.hpp"
-#include "compat/util.hpp"
+#include "compat/math.hpp"
#include <tuple>
+#include <QDebug>
+
constexpr double TranslationCalibrator::pitch_spacing_in_degrees;
constexpr double TranslationCalibrator::yaw_spacing_in_degrees;
constexpr double TranslationCalibrator::roll_spacing_in_degrees;
diff --git a/cv/video-property-page.cpp b/cv/video-property-page.cpp
index 58670e83..80395c79 100644
--- a/cv/video-property-page.cpp
+++ b/cv/video-property-page.cpp
@@ -12,7 +12,7 @@
#include "compat/camera-names.hpp"
#include "compat/sleep.hpp"
#include "compat/run-in-thread.hpp"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <cstring>
diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp
index 146ddc3f..fd4fe350 100644
--- a/cv/video-widget.cpp
+++ b/cv/video-widget.cpp
@@ -9,8 +9,6 @@
#include "video-widget.hpp"
#include "compat/check-visible.hpp"
-#include "compat/util.hpp"
-
#include <cstring>
#include <opencv2/imgproc.hpp>
diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp
index 3850d80b..30d21534 100644
--- a/dinput/keybinding-worker.cpp
+++ b/dinput/keybinding-worker.cpp
@@ -8,9 +8,8 @@
#ifdef _WIN32
-#include "compat/sleep.hpp"
-#include "compat/util.hpp"
#include "keybinding-worker.hpp"
+#include "compat/meta.hpp"
#include <QDebug>
#include <QMutexLocker>
@@ -195,7 +194,7 @@ void KeybindingWorker::run()
}
}
- portable::sleep(100);
+ Sleep(100);
}
}
diff --git a/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp b/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp
index 6fee7a76..e08d5377 100644
--- a/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp
+++ b/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp
@@ -1,7 +1,6 @@
#pragma once
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
struct falcon_bms_acceleration_ext : IExtension
{
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index 8a403211..c22d1c3d 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -5,10 +5,12 @@
* copyright notice and this permission notice appear in all copies.
*/
#include "ftnoir_filter_accela.h"
+#include "compat/math.hpp"
+#include "api/plugin-api.hpp"
+
#include <algorithm>
#include <QDebug>
#include <QMutexLocker>
-#include "api/plugin-api.hpp"
#include "compat/math-imports.hpp"
diff --git a/gui/init.cpp b/gui/init.cpp
index 7580ba5f..e648cfa0 100644
--- a/gui/init.cpp
+++ b/gui/init.cpp
@@ -14,7 +14,7 @@
#include "migration/migration.hpp"
#include "options/options.hpp"
using namespace options;
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <memory>
#include <cstdlib>
diff --git a/gui/process_detector.cpp b/gui/process_detector.cpp
index f7aeb164..b29df7fb 100644
--- a/gui/process_detector.cpp
+++ b/gui/process_detector.cpp
@@ -7,8 +7,9 @@
*/
#include "process_detector.h"
-#include "compat/process-list.hpp"
#include "options/options.hpp"
+#include "compat/process-list.hpp"
+#include "compat/base-path.hpp"
#include <QList>
#include <QFileDialog>
diff --git a/gui/settings.cpp b/gui/settings.cpp
index c1381915..fe0b3261 100644
--- a/gui/settings.cpp
+++ b/gui/settings.cpp
@@ -8,7 +8,7 @@
#include "settings.hpp"
#include "keyboard.h"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QPushButton>
#include <QLayout>
#include <QDialog>
diff --git a/logic/extensions.cpp b/logic/extensions.cpp
index 395d35ce..22eef6df 100644
--- a/logic/extensions.cpp
+++ b/logic/extensions.cpp
@@ -1,7 +1,6 @@
#include "extensions.hpp"
#include <functional>
-#include "compat/util.hpp"
using namespace options;
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp
index 43cc74c7..de7d94e6 100644
--- a/logic/pipeline.cpp
+++ b/logic/pipeline.cpp
@@ -14,7 +14,7 @@
#include "compat/nan.hpp"
#include "compat/sleep.hpp"
-#include "compat/util.hpp"
+#include "compat/math.hpp"
#include "pipeline.hpp"
diff --git a/logic/shortcuts.h b/logic/shortcuts.h
index 457c0d8e..046e68de 100644
--- a/logic/shortcuts.h
+++ b/logic/shortcuts.h
@@ -11,7 +11,6 @@
#include "options/options.hpp"
#include "main-settings.hpp"
-#include "compat/util.hpp"
#ifdef _WIN32
# include "dinput/keybinding-worker.hpp"
diff --git a/logic/work.cpp b/logic/work.cpp
index a2d06245..cdc27b05 100644
--- a/logic/work.cpp
+++ b/logic/work.cpp
@@ -1,5 +1,5 @@
#include "work.hpp"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QObject>
#include <QMessageBox>
diff --git a/migration/20160917_00-accela.cpp b/migration/20160917_00-accela.cpp
index c5c6f579..33d85273 100644
--- a/migration/20160917_00-accela.cpp
+++ b/migration/20160917_00-accela.cpp
@@ -8,7 +8,6 @@
#include "migration.hpp"
#include "options/options.hpp"
-#include "compat/util.hpp"
#include "filter-accela/accela-settings.hpp"
diff --git a/migration/20170420_00-udp-naming.cpp b/migration/20170420_00-udp-naming.cpp
index b1224c5d..de4674bd 100644
--- a/migration/20170420_00-udp-naming.cpp
+++ b/migration/20170420_00-udp-naming.cpp
@@ -8,7 +8,6 @@
#include "migration.hpp"
#include "options/options.hpp"
-#include "compat/util.hpp"
#include "logic/main-settings.hpp"
using namespace migrations;
diff --git a/migration/20171013_00-tracker-pt-threshold.cpp b/migration/20171013_00-tracker-pt-threshold.cpp
index 4408ccc0..32e69f6d 100644
--- a/migration/20171013_00-tracker-pt-threshold.cpp
+++ b/migration/20171013_00-tracker-pt-threshold.cpp
@@ -8,7 +8,6 @@
#include "migration.hpp"
#include "options/options.hpp"
-#include "compat/util.hpp"
//#include "tracker-pt/ftnoir_tracker_pt_settings.h"
using namespace options;
diff --git a/migration/migration.cpp b/migration/migration.cpp
index 747ea06b..b92d6384 100644
--- a/migration/migration.cpp
+++ b/migration/migration.cpp
@@ -11,7 +11,6 @@
#include "migration.hpp"
#include "options/options.hpp"
-#include "compat/util.hpp"
#include <QString>
#include <QSettings>
diff --git a/options/base-value.hpp b/options/base-value.hpp
index aabced2a..b094d693 100644
--- a/options/base-value.hpp
+++ b/options/base-value.hpp
@@ -5,6 +5,7 @@
#include "connector.hpp"
#include "export.hpp"
+#include "compat/meta.hpp"
#include <QObject>
#include <QString>
diff --git a/options/bundle.hpp b/options/bundle.hpp
index b6189ba6..9b7b7f02 100644
--- a/options/bundle.hpp
+++ b/options/bundle.hpp
@@ -25,7 +25,6 @@
#include <QDebug>
-#include "compat/util.hpp"
#include "export.hpp"
namespace options {
diff --git a/options/connector.cpp b/options/connector.cpp
index 075a57e1..6031d9ed 100644
--- a/options/connector.cpp
+++ b/options/connector.cpp
@@ -6,7 +6,6 @@
* notice appear in all copies.
*/
-#include "compat/util.hpp"
#include "connector.hpp"
#include "value.hpp"
diff --git a/options/group.cpp b/options/group.cpp
index 2d5588a1..69378d51 100644
--- a/options/group.cpp
+++ b/options/group.cpp
@@ -10,7 +10,7 @@
#include "defs.hpp"
#include "compat/timer.hpp"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <cmath>
diff --git a/options/group.hpp b/options/group.hpp
index 0f806f75..c933b134 100644
--- a/options/group.hpp
+++ b/options/group.hpp
@@ -2,8 +2,6 @@
#include "export.hpp"
-#include "compat/util.hpp"
-
// included here to propagate into callers of options::group
#include "metatype.hpp"
diff --git a/options/options.hpp b/options/options.hpp
index 45697597..bc892120 100644
--- a/options/options.hpp
+++ b/options/options.hpp
@@ -6,8 +6,6 @@
*/
#pragma once
-#include "compat/util.hpp"
-
#include "defs.hpp"
#include "bundle.hpp"
#include "group.hpp"
diff --git a/options/slider.hpp b/options/slider.hpp
index 5657ab82..f3ba44f8 100644
--- a/options/slider.hpp
+++ b/options/slider.hpp
@@ -8,8 +8,7 @@
#pragma once
#include "export.hpp"
-
-#include "compat/util.hpp"
+#include "compat/macros.hpp"
#include <QMetaType>
#include <QDataStream>
diff --git a/options/tie.cpp b/options/tie.cpp
index 9e693f5c..baa8bb82 100644
--- a/options/tie.cpp
+++ b/options/tie.cpp
@@ -7,6 +7,7 @@
*/
#include "tie.hpp"
+#include "compat/run-in-thread.hpp"
namespace options {
diff --git a/options/tie.hpp b/options/tie.hpp
index 8d5fe6c5..4ebc1846 100644
--- a/options/tie.hpp
+++ b/options/tie.hpp
@@ -10,6 +10,7 @@
#include "export.hpp"
#include "value.hpp"
+#include "compat/run-in-thread.hpp"
#include <QComboBox>
#include <QCheckBox>
diff --git a/options/value.hpp b/options/value.hpp
index 1da1dd9c..87bb2a85 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -10,12 +10,11 @@
#include "export.hpp"
-#include "compat/util.hpp"
-
#include "bundle.hpp"
#include "slider.hpp"
#include "base-value.hpp"
#include "value-traits.hpp"
+#include "compat/macros.hpp"
#include <cstdio>
#include <type_traits>
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index 5b8fdbbf..69861b24 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -6,10 +6,11 @@
*/
#include "pose-widget.hpp"
-#include "compat/util.hpp"
#include "compat/timer.hpp"
#include "compat/sleep.hpp"
#include "compat/check-visible.hpp"
+#include "compat/math.hpp"
+
#include <cmath>
#include <algorithm>
diff --git a/proto-flightgear/ftnoir_protocol_fg_dialog.cpp b/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
index 43a702f6..f6f8e00d 100644
--- a/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
+++ b/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
@@ -10,7 +10,7 @@
*/
#include "ftnoir_protocol_fg.h"
#include "api/plugin-api.hpp"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QString>
#include <QUrl>
diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp
index 04a5a4cf..f8c5afb8 100644
--- a/proto-ft/ftnoir_protocol_ft.cpp
+++ b/proto-ft/ftnoir_protocol_ft.cpp
@@ -6,11 +6,9 @@
* copyright notice and this permission notice appear in all copies.
*/
-#include "compat/util.hpp"
-
#include "ftnoir_protocol_ft.h"
#include "csv/csv.h"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <cassert>
#include <cstddef>
diff --git a/proto-ft/ftnoir_protocol_ft_dialog.cpp b/proto-ft/ftnoir_protocol_ft_dialog.cpp
index 35f03586..df2878ec 100644
--- a/proto-ft/ftnoir_protocol_ft_dialog.cpp
+++ b/proto-ft/ftnoir_protocol_ft_dialog.cpp
@@ -9,7 +9,7 @@
* copyright notice and this permission notice appear in all copies. *
*/
#include "ftnoir_protocol_ft.h"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QFileDialog>
#include <QFileInfo>
diff --git a/proto-libevdev/ftnoir_protocol_libevdev.cpp b/proto-libevdev/ftnoir_protocol_libevdev.cpp
index 42201b6e..fee7b790 100644
--- a/proto-libevdev/ftnoir_protocol_libevdev.cpp
+++ b/proto-libevdev/ftnoir_protocol_libevdev.cpp
@@ -10,8 +10,6 @@
#include <errno.h>
#include <string.h>
-#include "compat/util.hpp"
-
#include <algorithm>
#define CHECK_LIBEVDEV(expr) if ((error = (expr)) != 0) goto error;
diff --git a/proto-mouse/ftnoir_protocol_mouse.cpp b/proto-mouse/ftnoir_protocol_mouse.cpp
index 3245adf4..ccc91e33 100644
--- a/proto-mouse/ftnoir_protocol_mouse.cpp
+++ b/proto-mouse/ftnoir_protocol_mouse.cpp
@@ -4,8 +4,11 @@
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*/
+
#include "ftnoir_protocol_mouse.h"
+
#include "api/plugin-api.hpp"
+#include "compat/math.hpp"
#include <cmath>
#include <algorithm>
#include <windows.h>
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp
index 812fdcb3..f2a9dd14 100644
--- a/proto-simconnect/ftnoir_protocol_sc.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc.cpp
@@ -11,8 +11,8 @@
*/
#include "ftnoir_protocol_sc.h"
#include "api/plugin-api.hpp"
-#include "opentrack-library-path.h"
#include "compat/timer.hpp"
+#include "compat/library-path.hpp"
simconnect::simconnect() : hSimConnect(nullptr), should_reconnect(false)
{
diff --git a/proto-vjoystick/vjoystick.cpp b/proto-vjoystick/vjoystick.cpp
index a0e5b5b9..73cf74c6 100644
--- a/proto-vjoystick/vjoystick.cpp
+++ b/proto-vjoystick/vjoystick.cpp
@@ -7,7 +7,7 @@
*/
#include "vjoystick.h"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
+#include "compat/math.hpp"
#include <cstring>
#include <QDebug>
diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp
index 07501632..42fb4896 100644
--- a/proto-wine/ftnoir_protocol_wine.cpp
+++ b/proto-wine/ftnoir_protocol_wine.cpp
@@ -1,5 +1,4 @@
#include "ftnoir_protocol_wine.h"
-#include "opentrack-library-path.h"
#include <QString>
#include <QStringList>
#include <QCoreApplication>
@@ -10,6 +9,7 @@
#include <fcntl.h> /* For O_* constants */
#include "csv/csv.h"
#include "compat/macros.hpp"
+#include "compat/library-path.hpp"
wine::wine() : lck_shm(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)), shm(NULL), gameid(0)
{
diff --git a/proto-wine/opentrack-wrapper-wine-windows.cxx b/proto-wine/opentrack-wrapper-wine-windows.cxx
index 3c315d84..e1f91797 100644
--- a/proto-wine/opentrack-wrapper-wine-windows.cxx
+++ b/proto-wine/opentrack-wrapper-wine-windows.cxx
@@ -7,7 +7,7 @@
#include "compat/shm.cpp"
#include "wine-shm.h"
#define OPENTRACK_NO_QT_PATH
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <cstring>
using std::strcat;
diff --git a/qxt-mini/qxtglobalshortcut.cpp b/qxt-mini/qxtglobalshortcut.cpp
index fc0984b6..40a64d80 100644
--- a/qxt-mini/qxtglobalshortcut.cpp
+++ b/qxt-mini/qxtglobalshortcut.cpp
@@ -31,8 +31,6 @@
#include "qxtglobalshortcut_p.h"
-#include "compat/util.hpp"
-
#include <QAbstractEventDispatcher>
#include <QApplication>
#include <QtDebug>
diff --git a/qxt-mini/qxtglobalshortcut_x11.cpp b/qxt-mini/qxtglobalshortcut_x11.cpp
index 12a69637..2609aa7c 100644
--- a/qxt-mini/qxtglobalshortcut_x11.cpp
+++ b/qxt-mini/qxtglobalshortcut_x11.cpp
@@ -46,7 +46,6 @@
#include <xcb/xcb.h>
#include "powerset.hpp"
-#include "compat/util.hpp"
#include <iterator>
#include <vector>
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp
index e4e43f71..c578d70d 100644
--- a/spline/spline-widget.cpp
+++ b/spline/spline-widget.cpp
@@ -5,8 +5,8 @@
* copyright notice and this permission notice appear in all copies.
*/
-#include "compat/util.hpp"
#include "spline-widget.hpp"
+#include "compat/math.hpp"
#include <QPainter>
#include <QPainterPath>
#include <QPaintEvent>
diff --git a/spline/spline.cpp b/spline/spline.cpp
index b6fdd9c5..823fd64f 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -7,6 +7,7 @@
*/
#include "spline.hpp"
+#include "compat/math.hpp"
#include <algorithm>
#include <cstdlib>
@@ -105,12 +106,6 @@ warn_result_unused bool spline::get_last_value(QPointF& point)
return activep;
}
-template <typename T>
-static T signum(T val)
-{
- return (T(0) < val) - (val < T(0));
-}
-
float spline::get_value_internal(int x)
{
if (!validp)
diff --git a/spline/spline.hpp b/spline/spline.hpp
index 1bfe3b46..0d080cef 100644
--- a/spline/spline.hpp
+++ b/spline/spline.hpp
@@ -10,7 +10,6 @@
#include "compat/copyable-mutex.hpp"
#include "options/options.hpp"
-#include "compat/util.hpp"
using namespace options;
#include "axis-opts.hpp"
diff --git a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp
index ab2b5b72..14498861 100644
--- a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp
+++ b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp
@@ -1,6 +1,6 @@
#include "ftnoir_tracker_freepie-udp.h"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
+#include "compat/math.hpp"
#include <cinttypes>
#include <algorithm>
diff --git a/tracker-fusion/fusion.cpp b/tracker-fusion/fusion.cpp
index beeb7f53..98e2465e 100644
--- a/tracker-fusion/fusion.cpp
+++ b/tracker-fusion/fusion.cpp
@@ -7,8 +7,7 @@
*/
#include "fusion.h"
-
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QDebug>
#include <QMessageBox>
diff --git a/tracker-hatire/thread.cpp b/tracker-hatire/thread.cpp
index cb338c4a..6025d74c 100644
--- a/tracker-hatire/thread.cpp
+++ b/tracker-hatire/thread.cpp
@@ -1,6 +1,6 @@
#include "thread.hpp"
#include "compat/sleep.hpp"
-#include "compat/util.hpp"
+#include "compat/base-path.hpp"
#include <utility>
#include <QTextStream>
diff --git a/tracker-joystick/ftnoir_tracker_joystick.cpp b/tracker-joystick/ftnoir_tracker_joystick.cpp
index 42c2214a..27a5408d 100644
--- a/tracker-joystick/ftnoir_tracker_joystick.cpp
+++ b/tracker-joystick/ftnoir_tracker_joystick.cpp
@@ -5,8 +5,8 @@
* copyright notice and this permission notice appear in all copies.
*/
#include "ftnoir_tracker_joystick.h"
-#include "compat/util.hpp"
#include "api/plugin-api.hpp"
+#include "compat/math.hpp"
#include <QMutexLocker>
joystick::joystick()
diff --git a/tracker-pt/camera.h b/tracker-pt/camera.h
index 42eda9f5..96234840 100644
--- a/tracker-pt/camera.h
+++ b/tracker-pt/camera.h
@@ -9,7 +9,6 @@
#include "pt-api.hpp"
-#include "compat/util.hpp"
#include "compat/timer.hpp"
#include <functional>
diff --git a/tracker-pt/frame.cpp b/tracker-pt/frame.cpp
index 330c2313..e403af07 100644
--- a/tracker-pt/frame.cpp
+++ b/tracker-pt/frame.cpp
@@ -1,5 +1,7 @@
#include "frame.hpp"
+#include "compat/math.hpp"
+
#include <cstring>
#include <tuple>
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h
index 0b2a8578..d1f7e1d7 100644
--- a/tracker-pt/ftnoir_tracker_pt.h
+++ b/tracker-pt/ftnoir_tracker_pt.h
@@ -15,7 +15,6 @@
#include "pt-api.hpp"
#include "point_tracker.h"
#include "cv/video-widget.hpp"
-#include "compat/util.hpp"
#include <atomic>
#include <memory>
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
index 350cdb24..2c01c073 100644
--- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp
+++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
@@ -8,6 +8,7 @@
#include "ftnoir_tracker_pt_dialog.h"
+#include "compat/math.hpp"
#include "compat/camera-names.hpp"
#include <opencv2/core.hpp>
#include <QString>
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp
index defdcedc..b67c4036 100644
--- a/tracker-pt/point_extractor.cpp
+++ b/tracker-pt/point_extractor.cpp
@@ -7,13 +7,12 @@
*/
#include "point_extractor.h"
-#include "compat/util.hpp"
#include "point_tracker.h"
#include "frame.hpp"
-#include <QDebug>
-
#include "cv/numeric.hpp"
+#include "compat/math.hpp"
+
#include <opencv2/videoio.hpp>
#undef PREVIEW
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h
index 26677042..6abe5df9 100644
--- a/tracker-pt/point_tracker.h
+++ b/tracker-pt/point_tracker.h
@@ -12,11 +12,13 @@
#include "cv/numeric.hpp"
#include "pt-api.hpp"
-#include <opencv2/core.hpp>
#include <cstddef>
#include <memory>
#include <vector>
#include <array>
+
+#include <opencv2/core.hpp>
+
#include <QObject>
namespace pt_module {
diff --git a/tracker-rift-080/ftnoir_tracker_rift_080.cpp b/tracker-rift-080/ftnoir_tracker_rift_080.cpp
index 4d351dbc..c9f5e4ee 100644
--- a/tracker-rift-080/ftnoir_tracker_rift_080.cpp
+++ b/tracker-rift-080/ftnoir_tracker_rift_080.cpp
@@ -15,7 +15,6 @@
#include "ftnoir_tracker_rift_080.h"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
#include <QString>
diff --git a/tracker-rift-140/rift-140.cpp b/tracker-rift-140/rift-140.cpp
index 9880cb1e..bf02191a 100644
--- a/tracker-rift-140/rift-140.cpp
+++ b/tracker-rift-140/rift-140.cpp
@@ -15,7 +15,6 @@
#include "rift-140.hpp"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
#include <Extras/OVR_Math.h>
#include <QString>
diff --git a/tracker-rs/ftnoir_tracker_rs.cpp b/tracker-rs/ftnoir_tracker_rs.cpp
index 7c4f42a4..7918b6dc 100644
--- a/tracker-rs/ftnoir_tracker_rs.cpp
+++ b/tracker-rs/ftnoir_tracker_rs.cpp
@@ -9,7 +9,7 @@
#include "ftnoir_tracker_rs_controls.h"
#include "imagewidget.h"
#include "api/plugin-api.hpp"
-#include "opentrack-library-path.h"
+#include "compat/library-path.hpp"
#include <QMessageBox>
#include <QProcess>
#include <QStackedLayout>
diff --git a/tracker-s2bot/ftnoir_tracker_s2bot.cpp b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
index 8bd1f5db..a7411fb7 100644
--- a/tracker-s2bot/ftnoir_tracker_s2bot.cpp
+++ b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
@@ -1,6 +1,6 @@
#include "ftnoir_tracker_s2bot.h"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
+#include "compat/math.hpp"
#include <cinttypes>
#include <algorithm>
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index 82a38fb7..80a0e6f1 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -19,7 +19,6 @@
#include "steamvr.hpp"
#include "api/plugin-api.hpp"
-#include "compat/util.hpp"
#include <cstdlib>
#include <cmath>
diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp
index 95829492..4ba4da6d 100644
--- a/tracker-steamvr/steamvr.hpp
+++ b/tracker-steamvr/steamvr.hpp
@@ -1,7 +1,6 @@
#pragma once
#include "api/plugin-api.hpp"
#include "ui_dialog.h"
-#include "compat/util.hpp"
#include "options/options.hpp"
#include "compat/euler.hpp"
diff --git a/tracker-test/test.h b/tracker-test/test.h
index 0d1c9b8d..0f71005f 100644
--- a/tracker-test/test.h
+++ b/tracker-test/test.h
@@ -2,6 +2,7 @@
#include "ui_test.h"
#include "api/plugin-api.hpp"
#include "compat/timer.hpp"
+#include "compat/macros.hpp"
#include <cmath>
@@ -36,7 +37,7 @@ private slots:
class test_metadata : public Metadata
{
public:
- QString name() { return otr_tr("Testing - sine wave"); }
+ QString name() { return _("Testing - sine wave"); }
QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};
diff --git a/tracker-udp/ftnoir_tracker_udp.cpp b/tracker-udp/ftnoir_tracker_udp.cpp
index 41aa96c2..f147e5c6 100644
--- a/tracker-udp/ftnoir_tracker_udp.cpp
+++ b/tracker-udp/ftnoir_tracker_udp.cpp
@@ -9,7 +9,6 @@
#include "ftnoir_tracker_udp.h"
#include "api/plugin-api.hpp"
#include "compat/nan.hpp"
-#include "compat/util.hpp"
#include <iterator>
diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp
index 30efb138..7a9905d0 100644
--- a/variant/default/main-window.cpp
+++ b/variant/default/main-window.cpp
@@ -9,12 +9,13 @@
#include "main-window.hpp"
#include "logic/pipeline.hpp"
#include "options/options.hpp"
-#include "opentrack-library-path.h"
#include "new_file_dialog.h"
#include "migration/migration.hpp"
#include "compat/check-visible.hpp"
#include "compat/sleep.hpp"
#include "compat/macros.hpp"
+#include "compat/library-path.hpp"
+#include "compat/math.hpp"
#include <QMessageBox>
#include <QDesktopServices>