summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-09 15:05:35 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-10 03:18:57 +0100
commitaf2dcca279e6fc23c9b1694170cbdfe36b32eb79 (patch)
treea1d5cf6e77735e40138932705a0cc7287f6c5c73
parent5ad2275e0e50be8a4e9f506fb3f8dab2b02d0420 (diff)
logic, cv: fix header namespace pollution
We've had "using namespace options;" in headers for a while now.
-rw-r--r--cv/affine.cpp4
-rw-r--r--cv/affine.hpp8
-rw-r--r--logic/main-settings.hpp11
-rw-r--r--logic/mappings.hpp1
-rw-r--r--logic/shortcuts.h6
-rw-r--r--logic/state.hpp1
6 files changed, 27 insertions, 4 deletions
diff --git a/cv/affine.cpp b/cv/affine.cpp
index 9018e107..1b37305c 100644
--- a/cv/affine.cpp
+++ b/cv/affine.cpp
@@ -7,6 +7,8 @@
#include "affine.hpp"
+namespace affine_impl {
+
Affine::Affine() : R(mat33::eye()), t(0,0,0) {}
Affine::Affine(const mat33& R, const vec3& t) : R(R),t(t) {}
@@ -30,3 +32,5 @@ vec3 operator*(const Affine& X, const vec3& v)
{
return X.R*v + X.t;
}
+
+} // ns affine_impl
diff --git a/cv/affine.hpp b/cv/affine.hpp
index aedb0bc8..3bc85c95 100644
--- a/cv/affine.hpp
+++ b/cv/affine.hpp
@@ -9,9 +9,10 @@
#include <opencv2/core.hpp>
#include "numeric.hpp"
-using namespace types;
+namespace affine_impl {
+using namespace types;
class Affine final
{
@@ -27,3 +28,8 @@ Affine operator*(const Affine& X, const Affine& Y);
Affine operator*(const mat33& X, const Affine& Y);
Affine operator*(const Affine& X, const mat33& Y);
vec3 operator*(const Affine& X, const vec3& v);
+
+} // ns affine_impl
+
+using affine_impl::Affine;
+using affine_impl::operator *;
diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp
index fd3384eb..3ea68bca 100644
--- a/logic/main-settings.hpp
+++ b/logic/main-settings.hpp
@@ -10,12 +10,15 @@
#include <QString>
#include "options/options.hpp"
-using namespace options;
#include "api/plugin-api.hpp"
#include "spline/axis-opts.hpp"
#include "export.hpp"
+namespace main_settings_impl {
+
+using namespace options;
+
struct OTR_LOGIC_EXPORT key_opts
{
value<QString> keycode, guid;
@@ -58,3 +61,9 @@ struct OTR_LOGIC_EXPORT main_settings final
main_settings();
};
+
+} // ns main_settings_impl
+
+using main_settings_impl::key_opts;
+using main_settings_impl::module_settings;
+using main_settings_impl::main_settings;
diff --git a/logic/mappings.hpp b/logic/mappings.hpp
index 834e969e..7bb5f9af 100644
--- a/logic/mappings.hpp
+++ b/logic/mappings.hpp
@@ -9,7 +9,6 @@
#include "export.hpp"
#include "options/options.hpp"
-using namespace options;
#include "spline/spline.hpp"
#include "main-settings.hpp"
diff --git a/logic/shortcuts.h b/logic/shortcuts.h
index 6f69aba9..457c0d8e 100644
--- a/logic/shortcuts.h
+++ b/logic/shortcuts.h
@@ -25,6 +25,8 @@
#include <vector>
#include <functional>
+namespace shortcuts_impl {
+
using namespace options;
class OTR_LOGIC_EXPORT Shortcuts final : public QObject
@@ -61,3 +63,7 @@ private:
void free_binding(K& key);
void bind_shortcut(K &key, const key_opts& k, bool held);
};
+
+} // ns shortcuts_impl
+
+using shortcuts_impl::Shortcuts;
diff --git a/logic/state.hpp b/logic/state.hpp
index fb9587bf..25205524 100644
--- a/logic/state.hpp
+++ b/logic/state.hpp
@@ -9,7 +9,6 @@
#pragma once
#include "options/options.hpp"
-using namespace options;
#include "api/plugin-support.hpp"
#include "main-settings.hpp"
#include "mappings.hpp"