summaryrefslogtreecommitdiffhomepage
path: root/tracker-joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-20 19:05:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:31:24 +0100
commite202dab212ef8fd284d2745dd66496dcc3a2043e (patch)
tree345437664c02e65f4b6f3b0dd960d20fd5c2bf58 /tracker-joystick
parent48de00ec978261c25e9c4a59479f0607cae751ff (diff)
fix undefined behavior undescore prefixes
Diffstat (limited to 'tracker-joystick')
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.h2
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick_dialog.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/tracker-joystick/ftnoir_tracker_joystick.h b/tracker-joystick/ftnoir_tracker_joystick.h
index c61a1c8f..2fd1068f 100644
--- a/tracker-joystick/ftnoir_tracker_joystick.h
+++ b/tracker-joystick/ftnoir_tracker_joystick.h
@@ -63,7 +63,7 @@ public:
QString name;
QString guid;
};
- QList<joys> _joys;
+ QList<joys> joys_;
private slots:
void doOK();
void doCancel();
diff --git a/tracker-joystick/ftnoir_tracker_joystick_dialog.cpp b/tracker-joystick/ftnoir_tracker_joystick_dialog.cpp
index aa4b783a..aaf3037b 100644
--- a/tracker-joystick/ftnoir_tracker_joystick_dialog.cpp
+++ b/tracker-joystick/ftnoir_tracker_joystick_dialog.cpp
@@ -12,18 +12,18 @@ dialog_joystick::dialog_joystick() : tracker(nullptr)
{
win32_joy_ctx joy_ctx;
- _joys = QList<joys>();
+ joys_ = {};
- for (auto j : joy_ctx.get_joy_info())
- _joys.push_back(joys { j.name, j.guid });
+ for (const auto& j : joy_ctx.get_joy_info())
+ joys_.push_back(joys { j.name, j.guid });
}
{
const QString guid = s.guid;
int idx = 0;
- for (int i = 0; i < _joys.size(); i++)
+ for (int i = 0; i < joys_.size(); i++)
{
- const joys& j = _joys[i];
+ const joys& j = joys_[i];
if (j.guid == guid)
idx = i;
ui.joylist->addItem(j.name + " " + j.guid);
@@ -41,8 +41,8 @@ dialog_joystick::dialog_joystick() : tracker(nullptr)
void dialog_joystick::doOK() {
int idx = ui.joylist->currentIndex();
- joys def { "", "" };
- auto val = _joys.value(idx, def);
+ static const joys def { {}, {} };
+ auto val = joys_.value(idx, def);
s.guid = val.guid;
s.b->save();
close();