summaryrefslogtreecommitdiffhomepage
path: root/spline
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-28 03:02:57 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:18 +0100
commit6f04e4ca46e6f2dcd3eda63529a1bbd915f7676b (patch)
tree9aeb1332980c4285396457ad9f278495064549b5 /spline
parent3be3bb256f3e9362f8889f0532f875c5ad3b41fb (diff)
clang-tidy fixes only
Maybe global `-Wcomma' is too harsh. There should be no functional changes whatsoever.
Diffstat (limited to 'spline')
-rw-r--r--spline/broken/qfunctionconfiguratorplugin.h2
-rw-r--r--spline/spline.cpp10
-rw-r--r--spline/spline.hpp5
3 files changed, 14 insertions, 3 deletions
diff --git a/spline/broken/qfunctionconfiguratorplugin.h b/spline/broken/qfunctionconfiguratorplugin.h
index ca68e0e2..11b9a58c 100644
--- a/spline/broken/qfunctionconfiguratorplugin.h
+++ b/spline/broken/qfunctionconfiguratorplugin.h
@@ -16,7 +16,7 @@ class QFunctionConfiguratorPlugin : public QObject, public QDesignerCustomWidget
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
- QFunctionConfiguratorPlugin(QObject *parent = 0);
+ QFunctionConfiguratorPlugin(QObject *parent = nullptr);
bool isContainer() const;
bool isInitialized() const;
diff --git a/spline/spline.cpp b/spline/spline.cpp
index ea5b8c95..5381a28e 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -221,6 +221,12 @@ void spline::update_interp_data() const
double maxy = max_output();
float last = 0;
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wfloat-equal"
+#endif
+
for (unsigned i = 0; i < unsigned(value_count); i++)
{
if (data[i] == magic_fill_value)
@@ -228,6 +234,10 @@ void spline::update_interp_data() const
data[i] = clamp(data[i], 0, (float)maxy);
last = data[i];
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
}
void spline::remove_point(int i)
diff --git a/spline/spline.hpp b/spline/spline.hpp
index 87489076..e79dd8cc 100644
--- a/spline/spline.hpp
+++ b/spline/spline.hpp
@@ -109,8 +109,6 @@ class OTR_SPLINE_EXPORT spline : public base_spline
QMetaObject::Connection conn_changed, conn_maxx, conn_maxy;
mutable std::vector<float> data = std::vector<float>(value_count, float(-16));
mutable QPointF last_input_value;
- mutable bool activep = false;
- mutable bool validp = false;
std::shared_ptr<QObject> ctx { std::make_shared<QObject>() };
@@ -119,6 +117,9 @@ class OTR_SPLINE_EXPORT spline : public base_spline
static constexpr inline std::size_t value_count = 4096;
+ mutable bool activep = false;
+ mutable bool validp = false;
+
public:
void invalidate_settings();