From 7294d6845e0d1eea2a4ac3699c17e0c3cb656bf1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 27 Aug 2018 17:02:20 +0200 Subject: tracker/hatire: appease clang analyzer --- tracker-hatire/ftnoir_tracker_hat.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'tracker-hatire/ftnoir_tracker_hat.cpp') 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" -- cgit v1.2.3