From dfa9ffbea6b23709a24d0b243799a925dab07d16 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 4 Jun 2022 11:53:28 -0230 Subject: [PATCH] Add extra warning about using brace initialization on json when we shouldn't. --- Changes.txt | 6 ++++++ src/common/PJoystickHandler.hxx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/Changes.txt b/Changes.txt index 44bed594f..9f6bc410d 100644 --- a/Changes.txt +++ b/Changes.txt @@ -14,6 +14,12 @@ 6.6 to 6.7 (June 6, 2022) + * IMPORTANT NOTES: + - Because of fixes to JSON handling, all remappings will be reset + to defaults; if you had custom mappings, they will need to be + re-entered again. + - Because of internal changes, all state files are now invalid. + * Completely reworked the file launcher: - Redesigned user interface - Added tracking of user favorites, recently played and most popular diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index e32f87fac..afbdbed9b 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -49,6 +49,10 @@ class PhysicalJoystickHandler private: struct StickInfo { + // NOTE: For all future linting exercises + // Make sure to *NEVER* use brace initialization or std::move + // on the 'mapping' instance variable; there lay dragons ... + // https://json.nlohmann.me/home/faq/#brace-initialization-yields-arrays explicit StickInfo(nlohmann::json map, PhysicalJoystickPtr stick = nullptr) : mapping(map), joy{std::move(stick)} {}