Implement clang-tidy fixes
clang-tidy allows the CI robot to check many things via static analysis.
All changes here were made by the clang-tidy robot, and include a number
of modernization fixes. updating the tidy file will be done at a later
date.
Signed-off-by: Ed Tanous <etanous@nvidia.com>
Change-Id: I98cc4d600a3c589675507958f6d2350b2141216b
diff --git a/pid/ec/logging.hpp b/pid/ec/logging.hpp
index 3cef589..049d2ed 100644
--- a/pid/ec/logging.hpp
+++ b/pid/ec/logging.hpp
@@ -53,24 +53,24 @@
std::ofstream fileCoeffs;
std::chrono::milliseconds lastLog;
PidCoreContext lastContext;
- bool moved;
+ bool moved = false;
PidCoreLog() :
nameOriginal(), nameClean(), fileContext(), fileCoeffs(), lastLog(),
- lastContext(), moved(false)
+ lastContext()
{}
PidCoreLog(const PidCoreLog& copy) = delete;
PidCoreLog& operator=(const PidCoreLog& copy) = delete;
- PidCoreLog(PidCoreLog&& move)
+ PidCoreLog(PidCoreLog&& move) noexcept
{
// Reuse assignment operator below
*this = std::move(move);
}
- PidCoreLog& operator=(PidCoreLog&& move)
+ PidCoreLog& operator=(PidCoreLog&& move) noexcept
{
if (this != &move)
{
@@ -79,8 +79,8 @@
nameClean = std::move(move.nameClean);
fileContext = std::move(move.fileContext);
fileCoeffs = std::move(move.fileCoeffs);
- lastLog = std::move(move.lastLog);
- lastContext = std::move(move.lastContext);
+ lastLog = move.lastLog;
+ lastContext = move.lastContext;
// Mark the moved object, so destructor knows it was moved
move.moved = true;