summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-08-27 17:02:20 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-08-27 17:02:20 +0200
commit7294d6845e0d1eea2a4ac3699c17e0c3cb656bf1 (patch)
tree2668463bf0a7b92c2dbc0c427cb466adca0f3eef
parent95100251a8146a7be956669e12b33dfffb1898ab (diff)
tracker/hatire: appease clang analyzer
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.cpp21
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.h2
2 files changed, 7 insertions, 16 deletions
diff --git a/tracker-hatire/ftnoir_tracker_hat.cpp b/tracker-hatire/ftnoir_tracker_hat.cpp
index 3ec89499..d9f0a33b 100644
--- a/tracker-hatire/ftnoir_tracker_hat.cpp
+++ b/tracker-hatire/ftnoir_tracker_hat.cpp
@@ -15,17 +15,11 @@
hatire::hatire()
{
- HAT.Rot[0]=0;
- HAT.Rot[1]=0;
- HAT.Rot[2]=0;
- HAT.Trans[0]=0;
- HAT.Trans[1]=0;
- HAT.Trans[2]=0;
-
- Begin.append((unsigned char) 0xAA);
- Begin.append((unsigned char) 0xAA);
- End.append((unsigned char) 0x55);
- End.append((unsigned char) 0x55);
+
+ Begin.append((unsigned char) 0xAA);
+ Begin.append((unsigned char) 0xAA);
+ End.append((unsigned char) 0x55);
+ End.append((unsigned char) 0x55);
}
hatire::~hatire() = default;
@@ -146,11 +140,8 @@ void hatire::data(double *data)
{ s.EnableRoll, s.InvertRoll, HAT.Rot[s.RollAxis], data[Roll] },
};
- for (unsigned i = 0; i < std::size(spec); i++)
- {
- auto& k = spec[i];
+ for (auto& k : spec)
k.place = (k.sign ? -1 : 1) * (k.enable ? k.input : 0);
- }
}
#include "ftnoir_tracker_hat_dialog.h"
diff --git a/tracker-hatire/ftnoir_tracker_hat.h b/tracker-hatire/ftnoir_tracker_hat.h
index e7d9c0e4..0f88c7f6 100644
--- a/tracker-hatire/ftnoir_tracker_hat.h
+++ b/tracker-hatire/ftnoir_tracker_hat.h
@@ -33,7 +33,7 @@ public:
hatire_thread t;
private:
- TArduinoData ArduinoData, HAT;
+ TArduinoData ArduinoData {}, HAT {};
QByteArray Begin;
QByteArray End;