diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-24 18:54:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-24 19:32:10 +0100 |
commit | a88e34b21b07f70123926fcb5c505d6afdf99807 (patch) | |
tree | 905059194dcc64c7c163b8912947d8173fd4cc91 /spline/spline.cpp | |
parent | 5bf85412e4eacf92acc936b6e74bce0e2b1055d9 (diff) |
style/quality only
No functional changes.
- add `override' everywhere where missing
- almost pass clang's `-Wweak-vtables'
- avoid some float/double conversions
- remove unused private members
- make signedness conversions explicit
- put stuff in right namespaces to aid analysis
Diffstat (limited to 'spline/spline.cpp')
-rw-r--r-- | spline/spline.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp index 0c619c50..ea5b8c95 100644 --- a/spline/spline.cpp +++ b/spline/spline.cpp @@ -25,7 +25,12 @@ #include <QDebug> -using namespace spline_detail; +namespace spline_detail { + +base_spline_::~base_spline_() = default; +base_spline::~base_spline() = default; +spline_modify_mixin::~spline_modify_mixin() = default; +spline_settings_mixin::~spline_settings_mixin() = default; spline::spline(const QString& name, const QString& axis_name, Axis axis) { @@ -220,7 +225,7 @@ void spline::update_interp_data() const { if (data[i] == magic_fill_value) data[i] = last; - data[i] = (float)clamp(data[i], 0, maxy); + data[i] = clamp(data[i], 0, (float)maxy); last = data[i]; } } @@ -361,7 +366,7 @@ void spline::ensure_valid(points_t& list) const const int sz = list.size(); QList<QPointF> all_points, tmp; - all_points.reserve(sz), tmp.reserve(sz); + all_points.reserve(sz); tmp.reserve(sz); const double maxx = max_input(); @@ -445,14 +450,12 @@ void spline::disconnect_signals() { if (conn_changed) { - QObject::disconnect(conn_changed), conn_changed = {}; - QObject::disconnect(conn_maxx), conn_maxx = {}; - QObject::disconnect(conn_maxy), conn_maxy = {}; + QObject::disconnect(conn_changed); conn_changed = {}; + QObject::disconnect(conn_maxx); conn_maxx = {}; + QObject::disconnect(conn_maxy); conn_maxy = {}; } } -namespace spline_detail { - settings::settings(bundle const& b, const QString& axis_name, Axis idx): b(b ? b : make_bundle("")), opts(axis_name, idx) @@ -460,5 +463,4 @@ settings::settings(bundle const& b, const QString& axis_name, Axis idx): settings::~settings() = default; -} - +} // ns spline_detail |