From cb826bcee74c393f5f13856bebfb9cb60ba51851 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Nov 2020 14:18:09 -0500 Subject: motion_input: Mark member functions as [[nodiscard]] where applicable --- src/input_common/motion_input.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h index abb957f04..ce7ab7f9b 100644 --- a/src/input_common/motion_input.h +++ b/src/input_common/motion_input.h @@ -33,16 +33,17 @@ public: void UpdateRotation(u64 elapsed_time); void UpdateOrientation(u64 elapsed_time); - std::array GetOrientation() const; - Common::Vec3f GetAcceleration() const; - Common::Vec3f GetGyroscope() const; - Common::Vec3f GetRotations() const; - Common::Quaternion GetQuaternion() const; - Input::MotionStatus GetMotion() const; - Input::MotionStatus GetRandomMotion(int accel_magnitude, int gyro_magnitude) const; - - bool IsMoving(f32 sensitivity) const; - bool IsCalibrated(f32 sensitivity) const; + [[nodiscard]] std::array GetOrientation() const; + [[nodiscard]] Common::Vec3f GetAcceleration() const; + [[nodiscard]] Common::Vec3f GetGyroscope() const; + [[nodiscard]] Common::Vec3f GetRotations() const; + [[nodiscard]] Common::Quaternion GetQuaternion() const; + [[nodiscard]] Input::MotionStatus GetMotion() const; + [[nodiscard]] Input::MotionStatus GetRandomMotion(int accel_magnitude, + int gyro_magnitude) const; + + [[nodiscard]] bool IsMoving(f32 sensitivity) const; + [[nodiscard]] bool IsCalibrated(f32 sensitivity) const; private: void ResetOrientation(); -- cgit v1.2.3 From 0a50ba3bd18b6227fda1dc066826eb9cc6948673 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Nov 2020 14:20:41 -0500 Subject: motion_input: Mark constructor as explicit --- src/input_common/motion_input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h index ce7ab7f9b..efe74cf19 100644 --- a/src/input_common/motion_input.h +++ b/src/input_common/motion_input.h @@ -13,7 +13,7 @@ namespace InputCommon { class MotionInput { public: - MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); + explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); MotionInput(const MotionInput&) = default; MotionInput& operator=(const MotionInput&) = default; -- cgit v1.2.3