From 1501607e482c84976031feb52f60e16ad060b4a2 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 19 Jun 2023 23:01:46 -0700 Subject: [PATCH] [commands] Fix clang-tidy warnings (#5402) --- .../src/main/native/cpp/frc2/command/RamseteCommand.cpp | 8 ++++---- .../src/test/native/cpp/frc2/command/CommandPtrTest.cpp | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/RamseteCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/RamseteCommand.cpp index 2c9229b55a..7a71a0d473 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/RamseteCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/RamseteCommand.cpp @@ -23,7 +23,7 @@ RamseteCommand::RamseteCommand( m_pose(std::move(pose)), m_controller(controller), m_feedforward(feedforward), - m_kinematics(kinematics), + m_kinematics(std::move(kinematics)), m_speeds(std::move(wheelSpeeds)), m_leftController(std::make_unique(leftController)), m_rightController(std::make_unique(rightController)), @@ -45,7 +45,7 @@ RamseteCommand::RamseteCommand( m_pose(std::move(pose)), m_controller(controller), m_feedforward(feedforward), - m_kinematics(kinematics), + m_kinematics(std::move(kinematics)), m_speeds(std::move(wheelSpeeds)), m_leftController(std::make_unique(leftController)), m_rightController(std::make_unique(rightController)), @@ -64,7 +64,7 @@ RamseteCommand::RamseteCommand( : m_trajectory(std::move(trajectory)), m_pose(std::move(pose)), m_controller(controller), - m_kinematics(kinematics), + m_kinematics(std::move(kinematics)), m_outputVel(std::move(output)), m_usePID(false) { AddRequirements(requirements); @@ -80,7 +80,7 @@ RamseteCommand::RamseteCommand( : m_trajectory(std::move(trajectory)), m_pose(std::move(pose)), m_controller(controller), - m_kinematics(kinematics), + m_kinematics(std::move(kinematics)), m_outputVel(std::move(output)), m_usePID(false) { AddRequirements(requirements); diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp index 26077f2012..64b0346767 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandPtrTest.cpp @@ -27,6 +27,7 @@ TEST_F(CommandPtrTest, MovedFrom) { EXPECT_NO_FATAL_FAILURE(scheduler.Cancel(movedTo)); EXPECT_THROW(scheduler.Schedule(movedFrom), frc::RuntimeError); + // NOLINTNEXTLINE (clang-analyzer-cplusplus.Move) EXPECT_THROW(movedFrom.IsScheduled(), frc::RuntimeError); EXPECT_THROW(static_cast(std::move(movedFrom).Repeatedly()), frc::RuntimeError);